Apache CXF API

org.apache.cxf.jaxrs.client
Class LocalClientState

java.lang.Object
  extended by org.apache.cxf.jaxrs.client.LocalClientState
All Implemented Interfaces:
ClientState

public class LocalClientState
extends Object
implements ClientState

Keeps the client state such as the baseURI, currentURI, requestHeaders, current response


Constructor Summary
LocalClientState()
           
LocalClientState(LocalClientState cs)
           
LocalClientState(URI baseURI)
           
 
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 getResponse()
          Gets Response
 javax.ws.rs.core.MultivaluedMap<String,String> getTemplates()
          Gets the templates map
 ClientState newState(URI newBaseURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templatesMap)
          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 setResponse(javax.ws.rs.core.Response r)
          Sets Response
 void setTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)
          Sets the map containing template name and value pairs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalClientState

public LocalClientState()

LocalClientState

public LocalClientState(URI baseURI)

LocalClientState

public LocalClientState(LocalClientState cs)
Method Detail

setCurrentBuilder

public void setCurrentBuilder(javax.ws.rs.core.UriBuilder currentBuilder)
Description copied from interface: ClientState
Sets the current builder

Specified by:
setCurrentBuilder in interface ClientState
Parameters:
currentBuilder - the builder

getCurrentBuilder

public javax.ws.rs.core.UriBuilder getCurrentBuilder()
Description copied from interface: ClientState
Gets the current builder

Specified by:
getCurrentBuilder in interface ClientState
Returns:

setBaseURI

public void setBaseURI(URI baseURI)
Description copied from interface: ClientState
Sets the base URI

Specified by:
setBaseURI in interface ClientState
Parameters:
baseURI - baseURI

getBaseURI

public URI getBaseURI()
Description copied from interface: ClientState
Gets the base URI

Specified by:
getBaseURI in interface ClientState
Returns:
baseURI

setResponse

public void setResponse(javax.ws.rs.core.Response r)
Description copied from interface: ClientState
Sets Response

Specified by:
setResponse in interface ClientState
Parameters:
r - response

getResponse

public javax.ws.rs.core.Response getResponse()
Description copied from interface: ClientState
Gets Response

Specified by:
getResponse in interface ClientState
Returns:
response

setRequestHeaders

public void setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)
Description copied from interface: ClientState
Sets the request headers

Specified by:
setRequestHeaders in interface ClientState
Parameters:
requestHeaders - request headers

getRequestHeaders

public javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
Description copied from interface: ClientState
Gets the request headers

Specified by:
getRequestHeaders in interface ClientState
Returns:
request headers, may be immutable

getTemplates

public javax.ws.rs.core.MultivaluedMap<String,String> getTemplates()
Description copied from interface: ClientState
Gets the templates map

Specified by:
getTemplates in interface ClientState
Returns:
templates

setTemplates

public void setTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)
Description copied from interface: ClientState
Sets the map containing template name and value pairs

Specified by:
setTemplates in interface ClientState

reset

public void reset()
Description copied from interface: ClientState
Resets the current state to the baseURI

Specified by:
reset in interface ClientState

newState

public ClientState newState(URI newBaseURI,
                            javax.ws.rs.core.MultivaluedMap<String,String> headers,
                            javax.ws.rs.core.MultivaluedMap<String,String> templatesMap)
Description copied from interface: ClientState
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

Specified by:
newState in interface ClientState
Parameters:
newBaseURI - baseURI
headers - request headers, can be null
templatesMap - initial templates map, can be null
Returns:
client state

Apache CXF API

Apache CXF