public abstract class PluginResponseFilter
extends java.lang.Object
| Constructor and Description |
|---|
PluginResponseFilter() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
filter(java.lang.String serverType,
PluginServiceCallbacks callbacks,
javax.servlet.http.HttpServletRequest request,
com.ibm.json.java.JSONObject jsonResponse)
Filters the response from the service.
|
abstract java.lang.String[] |
getFilteredServices()
Returns an array of the services that are extended by this filter.
|
PluginServletResponseWrapper |
wrapResponse(PluginServiceCallbacks callbacks,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
com.ibm.json.java.JSONArtifact jsonRequest)
Allows a request filter to wrap the incoming response object.
|
public abstract java.lang.String[] getFilteredServices()
String array of names of the services. These are the servlet paths or Struts action names.public PluginServletResponseWrapper wrapResponse(PluginServiceCallbacks callbacks, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, com.ibm.json.java.JSONArtifact jsonRequest) throws java.lang.Exception
callbacks - An instance of PluginServiceCallbacks that contains several functions that can be used by
the service. These functions provide access to plug-in configuration and content server APIs.request - The HttpServletRequest object that provides the request. The service can access the
invocation parameters from the request. Note: The request object can be passed to a
response filter to allow a plug-in to communicate information between a request and response filter.response - The HttpServletResponse object that provides the response. The service can set headers
and/or wrap this response in an instance of PluginServletResponseWrapperjsonRequest - A JSONArtifact that provides the request in JSON format. If the request does not include
a JSON Artifact object, this parameter returns null.PluginServletResponseWrapper, that wraps the passed in response object, can
be returned. Return null if the response is not to be wrapped.java.lang.Exceptionpublic abstract void filter(java.lang.String serverType,
PluginServiceCallbacks callbacks,
javax.servlet.http.HttpServletRequest request,
com.ibm.json.java.JSONObject jsonResponse)
throws java.lang.Exception
serverType - A String that indicates the type of server that is associated with the service. This
value can be one or more of the following values separated by commas:
| Server Type | Description |
|---|---|
p8 |
IBM FileNet P8 |
cm |
IBM Content Manager |
od |
IBM Content Manager OnDemand |
common |
For services that are not associated with a particular server |
callbacks - An instance of the
PluginServiceCallbacks class that
contains functions that can be used by the service. These functions provide access to plug-in
configuration and content server APIs.request - An HttpServletRequest object that provides the request. The service can access the
invocation parameters from the request.jsonResponse - The JSONObject object that is generated by the service. Typically, this object is
serialized and sent as the response. The filter modifies this object to change the response that is
sent.java.lang.Exception - For exceptions that occur when the service is running. Information about the exception is logged as
part of the client logging and an error response is automatically generated and returned.