Class VitroApiServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.cornell.mannlib.vitro.webapp.controller.api.VitroApiServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
IndividualListRdfController,SparqlQueryApiController,SparqlUpdateApiController
public class VitroApiServlet extends javax.servlet.http.HttpServletThe base class for Vitro servlets that implement the API. We don't want the API servlets to extend VitroHttpServlet, because we want the following behavior:- No redirecting to the login page if not authorized
- No redirecting to the home page on insufficient authorization
- GET and POST requests are not necessarily equivalent.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classVitroApiServlet.AuthExceptionprotected static classVitroApiServlet.BadParameterException
-
Constructor Summary
Constructors Constructor Description VitroApiServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfirmAuthorization(javax.servlet.http.HttpServletRequest req, AuthorizationRequest requiredActions)If they have not provided an email/password combo that will authorize them for this action, throw an AuthException.protected StringparseAcceptHeader(javax.servlet.http.HttpServletRequest req, Collection<String> availableTypes, String defaultType)protected voidsendShortResponse(int statusCode, String message, Throwable e, javax.servlet.http.HttpServletResponse resp)protected voidsendShortResponse(int statusCode, String message, javax.servlet.http.HttpServletResponse resp)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
confirmAuthorization
protected void confirmAuthorization(javax.servlet.http.HttpServletRequest req, AuthorizationRequest requiredActions) throws VitroApiServlet.AuthExceptionIf they have not provided an email/password combo that will authorize them for this action, throw an AuthException.- Throws:
VitroApiServlet.AuthException
-
parseAcceptHeader
protected String parseAcceptHeader(javax.servlet.http.HttpServletRequest req, Collection<String> availableTypes, String defaultType) throws AcceptHeaderParsingException, NotAcceptableException
-
sendShortResponse
protected void sendShortResponse(int statusCode, String message, javax.servlet.http.HttpServletResponse resp) throws IOException- Throws:
IOException
-
sendShortResponse
protected void sendShortResponse(int statusCode, String message, Throwable e, javax.servlet.http.HttpServletResponse resp) throws IOException- Throws:
IOException
-
-