Class HttpServletBase
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
oracle.dbtools.plugin.api.servlet.HttpServletBase
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,ErrorResponseHandler,HasDynamicAuthorization,SupportsPatch
public abstract class HttpServletBase
extends javax.servlet.http.HttpServlet
implements HasDynamicAuthorization, ErrorResponseHandler, SupportsPatch
Alternative base class for
HttpServlet implementations, providing
SupportsPatch and HasDynamicAuthorization support.- Author:
- cdivilly
- See Also:
-
Field Summary
Fields inherited from interface oracle.dbtools.plugin.api.servlet.HasDynamicAuthorization
USE_DEFAULT_CONSTRAINTSFields inherited from interface oracle.dbtools.plugin.api.servlet.SupportsPatch
PATCH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoPatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Perform a HTTP PATCH operation.getConstraint(javax.servlet.http.HttpServletRequest request) Determine theAuthorizationConstraintthat applies to a resource.booleanonError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int statusCode, Throwable cause) Called when the runtime is about to raise an error condition (i.e report an HTTP status code in the 400-499 range).protected voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Constructor Details
-
HttpServletBase
protected HttpServletBase()
-
-
Method Details
-
doPatch
public void doPatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Description copied from interface:SupportsPatchPerform a HTTP PATCH operation. The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. The set of changes is represented in a format called a "patch document" identified by a media type. The server MUST apply the entire set of changes atomically and never provide (e.g., in response to a GET during this operation) a partially modified representation. If the entire patch document cannot be successfully applied, then the server MUST NOT apply any of the changes.- Specified by:
doPatchin interfaceSupportsPatch- Parameters:
request- anHttpServletRequestobject that contains the request the client has made of the servletresponse- anHttpServletResponseobject that contains the response the servlet sends to the client- Throws:
javax.servlet.ServletException- if the request for the PATCH could not be handledIOException- if an input or output error is detected when the servlet handles the PATCH request
-
getConstraint
public AuthorizationConstraint getConstraint(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException, IOException Description copied from interface:HasDynamicAuthorizationDetermine theAuthorizationConstraintthat applies to a resource.- Specified by:
getConstraintin interfaceHasDynamicAuthorization- Parameters:
request- anHttpServletRequestobject that contains the request the client has made of the servlet- Returns:
AuthorizationConstraintinstance if a constraint applies to the request.nullif no constraint applies to the request.HasDynamicAuthorization.USE_DEFAULT_CONSTRAINTSif this method cannot determine what constraint applies to the request, and therefore the runtime's defaultAuthorizationConstraintdiscovery logic will be applied to the request.- Throws:
javax.servlet.ServletException- if the request for the dynamic privilege could not be handledIOException- if an input or output error is detected when the servlet determines theAuthorizationConstraint
-
onError
public boolean onError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int statusCode, Throwable cause) throws javax.servlet.ServletException, IOException Description copied from interface:ErrorResponseHandlerCalled when the runtime is about to raise an error condition (i.e report an HTTP status code in the 400-499 range).- Specified by:
onErrorin interfaceErrorResponseHandler- Parameters:
request- TheHttpServletRequestfor the current requestresponse- TheHttpServletResponsefor the current responsestatusCode- The HTTP status code to be raisedcause- The cause of the error condition, may be null- Returns:
- If this handler generates a response for the error condition this
method must return
true. If this method does not handle the error condition this method must returnfalse. In which case the standard runtime's error handling will be invoked - Throws:
javax.servlet.ServletException- if the request cannot be handledIOException- if an I/O error occurs while reading the request or writing the response
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException - Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-