Package org.apache.cxf.jaxrs.client
Class LocalClientState
- java.lang.Object
-
- 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
Constructors Constructor Description LocalClientState()LocalClientState(URI baseURI)LocalClientState(URI baseURI, URI currentURI)LocalClientState(URI baseURI, URI currentURI, Map<String,Object> properties)LocalClientState(URI baseURI, Map<String,Object> properties)LocalClientState(LocalClientState cs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URIgetBaseURI()Gets the base URIjavax.ws.rs.core.UriBuildergetCurrentBuilder()Gets the current builderjavax.ws.rs.core.MultivaluedMap<String,String>getRequestHeaders()Gets the request headersjavax.ws.rs.core.ResponsegetResponse()Gets Responsejavax.ws.rs.core.MultivaluedMap<String,String>getTemplates()Gets the templates mapClientStatenewState(URI currentURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templatesMap)The factory method for creating a new state.ClientStatenewState(URI currentURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templatesMap, Map<String,Object> props)The factory method for creating a new state.voidreset()Resets the current state to the baseURIvoidsetBaseURI(URI baseURI)Sets the base URIvoidsetCurrentBuilder(javax.ws.rs.core.UriBuilder currentBuilder)Sets the current buildervoidsetRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)Sets the request headersvoidsetResponse(javax.ws.rs.core.Response r)Sets ResponsevoidsetTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)Sets the map containing template name and value pairs
-
-
-
Method Detail
-
setCurrentBuilder
public void setCurrentBuilder(javax.ws.rs.core.UriBuilder currentBuilder)
Description copied from interface:ClientStateSets the current builder- Specified by:
setCurrentBuilderin interfaceClientState- Parameters:
currentBuilder- the builder
-
getCurrentBuilder
public javax.ws.rs.core.UriBuilder getCurrentBuilder()
Description copied from interface:ClientStateGets the current builder- Specified by:
getCurrentBuilderin interfaceClientState- Returns:
-
setBaseURI
public void setBaseURI(URI baseURI)
Description copied from interface:ClientStateSets the base URI- Specified by:
setBaseURIin interfaceClientState- Parameters:
baseURI- baseURI
-
getBaseURI
public URI getBaseURI()
Description copied from interface:ClientStateGets the base URI- Specified by:
getBaseURIin interfaceClientState- Returns:
- baseURI
-
setResponse
public void setResponse(javax.ws.rs.core.Response r)
Description copied from interface:ClientStateSets Response- Specified by:
setResponsein interfaceClientState- Parameters:
r- response
-
getResponse
public javax.ws.rs.core.Response getResponse()
Description copied from interface:ClientStateGets Response- Specified by:
getResponsein interfaceClientState- Returns:
- response
-
setRequestHeaders
public void setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> requestHeaders)
Description copied from interface:ClientStateSets the request headers- Specified by:
setRequestHeadersin interfaceClientState- Parameters:
requestHeaders- request headers
-
getRequestHeaders
public javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
Description copied from interface:ClientStateGets the request headers- Specified by:
getRequestHeadersin interfaceClientState- Returns:
- request headers, may be immutable
-
getTemplates
public javax.ws.rs.core.MultivaluedMap<String,String> getTemplates()
Description copied from interface:ClientStateGets the templates map- Specified by:
getTemplatesin interfaceClientState- Returns:
- templates
-
setTemplates
public void setTemplates(javax.ws.rs.core.MultivaluedMap<String,String> map)
Description copied from interface:ClientStateSets the map containing template name and value pairs- Specified by:
setTemplatesin interfaceClientState
-
reset
public void reset()
Description copied from interface:ClientStateResets the current state to the baseURI- Specified by:
resetin interfaceClientState
-
newState
public ClientState newState(URI currentURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templatesMap, Map<String,Object> props)
Description copied from interface:ClientStateThe 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:
newStatein interfaceClientState- Parameters:
currentURI- baseURIheaders- request headers, can be nulltemplatesMap- initial templates map, can be nullprops- additional properties, could be null- Returns:
- client state
-
newState
public ClientState newState(URI currentURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.ws.rs.core.MultivaluedMap<String,String> templatesMap)
Description copied from interface:ClientStateThe 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:
newStatein interfaceClientState- Parameters:
currentURI- baseURIheaders- request headers, can be nulltemplatesMap- initial templates map, can be null- Returns:
- client state
-
-