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 forHttpServlet
implementations, providingSupportsPatch
andHasDynamicAuthorization
support.- 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 protected
HttpServletBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doPatch(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Perform a HTTP PATCH operation.AuthorizationConstraint
getConstraint(javax.servlet.http.HttpServletRequest request)
Determine theAuthorizationConstraint
that applies to a resource.boolean
onError(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 void
service(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.IOException
Description copied from interface:SupportsPatch
Perform 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:
doPatch
in interfaceSupportsPatch
- Parameters:
request
- anHttpServletRequest
object that contains the request the client has made of the servletresponse
- anHttpServletResponse
object 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:HasDynamicAuthorization
Determine theAuthorizationConstraint
that applies to a resource.- Specified by:
getConstraint
in interfaceHasDynamicAuthorization
- Parameters:
request
- anHttpServletRequest
object that contains the request the client has made of the servlet- Returns:
AuthorizationConstraint
instance if a constraint applies to the request.null
if no constraint applies to the request.HasDynamicAuthorization.USE_DEFAULT_CONSTRAINTS
if this method cannot determine what constraint applies to the request, and therefore the runtime's defaultAuthorizationConstraint
discovery 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.IOException
Description copied from interface:ErrorResponseHandler
Called when the runtime is about to raise an error condition (i.e report an HTTP status code in the 400-499 range).- Specified by:
onError
in interfaceErrorResponseHandler
- Parameters:
request
- TheHttpServletRequest
for the current requestresponse
- TheHttpServletResponse
for 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:
service
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
-
-