com.ibm.xdms.xcap.filter
Interface XcapFilter
- All Known Implementing Classes:
- BaseXcapFilter
public interface XcapFilter
A XCAP filter is an object that performs filtering tasks on either an XCAP
request, on the XCAP response, or both. Filters perform filtering in the
doFilter method.
Examples that have been identified for this design are
- Authorization Filters
- Constraint Checking/Enforcement Filters
- Storage Filters
Field Summary |
static java.lang.String |
COPYRIGHT
|
Method Summary |
void |
destroy()
Called to indicate to a filter that it is being taken out of service. |
void |
doDelete(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
The doDelete method of the XcapFilter is called each time a
request/response pair is passed through the chain due to a client request
to delete a resource at the end of the chain. |
void |
doGet(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
The doGet method of the XcapFilter is called each time a request/response
pair is passed through the chain due to a client request for a resource
at the end of the chain. |
void |
doPost(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
The doPost method of the XcapFilter is called each time a
request/response pair is passed through the chain due to a client request
to perform a search at the end of the chain. |
void |
doPut(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
The doPut method of the XcapFilter is called each time a request/response
pair is passed through the chain due to a client request to put a
resource at the end of the chain. |
void |
init(XcapCaps xcapCaps,
ApplicationUsage appUsage,
AuidConfig auidConfig)
Called to indicate to a filter that it is being placed into service. |
COPYRIGHT
static final java.lang.String COPYRIGHT
destroy
void destroy()
- Called to indicate to a filter that it is being taken out of service.
This method is only called once all threads within the filter's doFilter
method have exited or after a timeout period has passed. After this
method is called, it will not be called again on the instance of this
filter.
This method gives the filter an opportunity to clean up any resources
that are being held (for example, memory, file handles, threads) and make
sure that any persistent state is synchronized with the filter's current
state in memory.
doGet
void doGet(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
throws java.io.IOException,
XdmsException
- The doGet method of the XcapFilter is called each time a request/response
pair is passed through the chain due to a client request for a resource
at the end of the chain. The XcapFilterChain passed in to this method
allows the Filter to pass on the request and response to the next entity
in the chain. A typical implementation of this method would follow the
following pattern:
- Examine the request
- Optionally wrap the request object with a custom implementation to
filter content or headers for input filtering
- Optionally wrap the response object with a custom implementation to
filter content or headers for output filtering
-
- Either invoke the next entity in the chain using the FilterChain
object (chain.doFilter()),
- or not pass on the request/response pair to the next entity in the
filter chain to block the request processing
- Directly set headers on the response after invocation of the next
entity in the filter chain.
- Parameters:
request
- XCAP Server Requestresponse
- XCAP Server Responsechain
- XCAP Filter Chain
- Throws:
IOException
XdmsException
doDelete
void doDelete(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
throws java.io.IOException,
XdmsException
- The doDelete method of the XcapFilter is called each time a
request/response pair is passed through the chain due to a client request
to delete a resource at the end of the chain. The XcapFilterChain passed
in to this method allows the Filter to pass on the request and response
to the next entity in the chain. A typical implementation of this method
would follow the following pattern:
- Examine the request
- Optionally wrap the request object with a custom implementation to
filter content or headers for input filtering
- Optionally wrap the response object with a custom implementation to
filter content or headers for output filtering
-
- Either invoke the next entity in the chain using the FilterChain
object (chain.doFilter()),
- or not pass on the request/response pair to the next entity in the
filter chain to block the request processing
- Directly set headers on the response after invocation of the next
entity in the filter chain.
- Parameters:
request
- XCAP Server Requestresponse
- XCAP Server Responsechain
- XCAP Filter Chain
- Throws:
IOException
XdmsException
doPost
void doPost(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
throws java.io.IOException,
XdmsException
- The doPost method of the XcapFilter is called each time a
request/response pair is passed through the chain due to a client request
to perform a search at the end of the chain. The XcapFilterChain passed
in to this method allows the Filter to pass on the request and response
to the next entity in the chain. A typical implementation of this method
would follow the following pattern:
- Examine the request
- Optionally wrap the request object with a custom implementation to
filter content or headers for input filtering
- Optionally wrap the response object with a custom implementation to
filter content or headers for output filtering
-
- Either invoke the next entity in the chain using the FilterChain
object (chain.doFilter()),
- or not pass on the request/response pair to the next entity in the
filter chain to block the request processing
- Directly set headers on the response after invocation of the next
entity in the filter chain.
- Parameters:
request
- XCAP Server Requestresponse
- XCAP Server Responsechain
- XCAP Filter Chain
- Throws:
IOException
XdmsException
doPut
void doPut(XcapServerRequest request,
XcapServerResponse response,
XcapFilterChain chain)
throws java.io.IOException,
XdmsException
- The doPut method of the XcapFilter is called each time a request/response
pair is passed through the chain due to a client request to put a
resource at the end of the chain. The XcapFilterChain passed in to this
method allows the Filter to pass on the request and response to the next
entity in the chain. A typical implementation of this method would follow
the following pattern:
- Examine the request
- Optionally wrap the request object with a custom implementation to
filter content or headers for input filtering
- Optionally wrap the response object with a custom implementation to
filter content or headers for output filtering
-
- Either invoke the next entity in the chain using the FilterChain
object (chain.doFilter()),
- or not pass on the request/response pair to the next entity in the
filter chain to block the request processing
- Directly set headers on the response after invocation of the next
entity in the filter chain.
- Parameters:
request
- XCAP Server Requestresponse
- XCAP Server Responsechain
- XCAP Filter Chain
- Throws:
IOException
XdmsException
init
void init(XcapCaps xcapCaps,
ApplicationUsage appUsage,
AuidConfig auidConfig)
throws XdmsException
- Called to indicate to a filter that it is being placed into service. The
init method is called exactly once after instantiating the filter. The
init method must complete successfully before the filter is asked to do
any filtering work.
- Parameters:
xcapCaps
- The entire xcap capabilities object for the XDMS.appUsage
- The application usage for this filter.auidConfig
- The AUID configuration for this filter.
- Throws:
XdmsException
- Thrown if the filter should not be used