com.sun.ws.rest.api.client
Class ClientFilter
java.lang.Object
com.sun.ws.rest.api.client.ClientFilter
- All Implemented Interfaces:
- ClientHandler
public abstract class ClientFilter
- extends java.lang.Object
- implements ClientHandler
A client filter capable of modifying the outbound HTTP request or
the inbound HTTP response.
An application-based filter extends this class and implements the
ClientHandler.handle(com.sun.ws.rest.api.client.ClientRequest)
method. The general implementation pattern
is as follows:
class AppClientFilter extends ClientFilter {
public ClientResponse handle(ClientRequest cr) {
// Modify the request
ClientRequest mcr = modifyRequest(cr);
// Call the next client handler in the filter chain
ClientResponse resp = getNext(mcr);
// Modify the response
return modifyResponse(resp);
}
private byte[] loadClassData(String name) {
// load the class data from the connection
. . .
}
}
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClientFilter
public ClientFilter()
getNext
public final ClientHandler getNext()
- Get the next client handler to invoke in the chain
of filters.
- Returns:
- the next client handler.
handle
public abstract ClientResponse handle(ClientRequest cr)
throws ClientHandlerException
- Description copied from interface:
ClientHandler
- Handle a HTTP request as a
ClientRequest
and return the HTTP
response as a ClientResponse
.
- Specified by:
handle
in interface ClientHandler
- Parameters:
cr
- the HTTP request.
- Returns:
- the HTTP response.
- Throws:
ClientHandlerException
- if the client
handler fails to process the request or response.