Class HttpServletBase
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- oracle.dbtools.plugin.api.servlet.HttpServletBase
-
- All Implemented Interfaces:
java.io.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 forHttpServletimplementations, providingSupportsPatchandHasDynamicAuthorizationsupport.- Author:
- cdivilly
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface oracle.dbtools.plugin.api.servlet.HasDynamicAuthorization
USE_DEFAULT_CONSTRAINTS
-
Fields inherited from interface oracle.dbtools.plugin.api.servlet.SupportsPatch
PATCH
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpServletBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoPatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Perform a HTTP PATCH operation.AuthorizationConstraintgetConstraint(javax.servlet.http.HttpServletRequest request)Determine theAuthorizationConstraintthat applies to a resource.booleanonError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int statusCode, java.lang.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, service
-
-
-
-
Method Detail
-
doPatch
public void doPatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOExceptionDescription 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 handledjava.io.IOException- 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, java.io.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 handledjava.io.IOException- 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, java.lang.Throwable cause) throws javax.servlet.ServletException, java.io.IOExceptionDescription 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 handledjava.io.IOException- 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, java.io.IOException- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
-