Apache CXF API

org.apache.cxf.jaxrs.client
Interface ClientState

All Known Implementing Classes:
LocalClientState, ThreadLocalClientState

public interface ClientState

Represents the client state : - baseURI - current uri builder - current requestHeaders - current template parameters map - last response


Method Summary
 URI getBaseURI()
          Gets the base URI
 javax.ws.rs.core.UriBuilder getCurrentBuilder()
          Gets the current builder
 javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
          Gets the request headers
 javax.ws.rs.core.Response.ResponseBuilder getResponseBuilder()
          Gets the responseBuilder
 javax.ws.rs.core.MultivaluedMap<String,String> getTemplates()
          Gets the templates map
 ClientState newState(URI baseURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templates)
          The factory method for creating a new state.
 void reset()
          Resets the current state to the baseURI
 void setBaseURI(URI baseURI)
          Sets the base URI
 void setCurrentBuilder(javax.ws.rs.core.UriBuilder currentBuilder)
          Sets the current builder
 void setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)
          Sets the request headers
 void setResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder responseBuilder)
          Sets the responseBuilder
 void setTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)
          Sets the map containing template name and value pairs
 

Method Detail

setCurrentBuilder

void setCurrentBuilder(javax.ws.rs.core.UriBuilder currentBuilder)
Sets the current builder

Parameters:
currentBuilder - the builder

getCurrentBuilder

javax.ws.rs.core.UriBuilder getCurrentBuilder()
Gets the current builder

Returns:

setBaseURI

void setBaseURI(URI baseURI)
Sets the base URI

Parameters:
baseURI - baseURI

getBaseURI

URI getBaseURI()
Gets the base URI

Returns:
baseURI

setResponseBuilder

void setResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder responseBuilder)
Sets the responseBuilder

Parameters:
responseBuilder - responseBuilder

getResponseBuilder

javax.ws.rs.core.Response.ResponseBuilder getResponseBuilder()
Gets the responseBuilder

Returns:
responseBuilder

setRequestHeaders

void setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)
Sets the request headers

Parameters:
requestHeaders - request headers

getRequestHeaders

javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
Gets the request headers

Returns:
request headers, may be immutable

setTemplates

void setTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)
Sets the map containing template name and value pairs

Parameters:
templates -

getTemplates

javax.ws.rs.core.MultivaluedMap<String,String> getTemplates()
Gets the templates map

Returns:
templates

reset

void reset()
Resets the current state to the baseURI


newState

ClientState newState(URI baseURI,
                     javax.ws.rs.core.MultivaluedMap<String,String> headers,
                     javax.ws.rs.core.MultivaluedMap<String,String> templates)
The factory method for creating a new state. Example, proxy and WebClient.fromClient will use this method when creating subresource proxies and new web clients respectively to ensure thet stay thread-local if needed

Parameters:
baseURI - baseURI
headers - request headers, can be null
templates - initial templates map, can be null
Returns:
client state

Apache CXF API

Apache CXF