Package org.apache.cxf.jaxrs.client
Class ThreadLocalClientState
java.lang.Object
org.apache.cxf.jaxrs.client.ThreadLocalClientState
- All Implemented Interfaces:
ClientState
Keeps the client state such as the baseURI, currentURI, requestHeaders, current response
in a thread local storage
-
Constructor Summary
ConstructorsConstructorDescriptionThreadLocalClientState(String baseURI) ThreadLocalClientState(String baseURI, long timeToKeepState) ThreadLocalClientState(String baseURI, long timeToKeepState, Map<String, Object> properties) ThreadLocalClientState(String baseURI, Map<String, Object> properties) ThreadLocalClientState(LocalClientState initialState, long timeToKeepState) -
Method Summary
Modifier and TypeMethodDescriptionGets the base URIjakarta.ws.rs.core.UriBuilderGets the current builderGets the request headersjakarta.ws.rs.core.ResponseGets Responseprotected ClientStategetState()Gets the templates mapnewState(URI currentURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, jakarta.ws.rs.core.MultivaluedMap<String, String> templates) The factory method for creating a new state.newState(URI currentURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, jakarta.ws.rs.core.MultivaluedMap<String, String> templates, Map<String, Object> properties) The factory method for creating a new state.voidreset()Resets the current state to the baseURIvoidsetBaseURI(URI baseURI) Sets the base URIvoidsetCurrentBuilder(jakarta.ws.rs.core.UriBuilder currentBuilder) Sets the current buildervoidsetRequestHeaders(jakarta.ws.rs.core.MultivaluedMap<String, String> requestHeaders) Sets the request headersvoidsetResponse(jakarta.ws.rs.core.Response response) Sets ResponsevoidsetTemplates(jakarta.ws.rs.core.MultivaluedMap<String, String> map) Sets the map containing template name and value pairsvoidsetTimeToKeepState(long timeToKeepState)
-
Constructor Details
-
ThreadLocalClientState
-
ThreadLocalClientState
-
ThreadLocalClientState
-
ThreadLocalClientState
-
ThreadLocalClientState
-
-
Method Details
-
setCurrentBuilder
public void setCurrentBuilder(jakarta.ws.rs.core.UriBuilder currentBuilder) Description copied from interface:ClientStateSets the current builder- Specified by:
setCurrentBuilderin interfaceClientState- Parameters:
currentBuilder- the builder
-
getCurrentBuilder
public jakarta.ws.rs.core.UriBuilder getCurrentBuilder()Description copied from interface:ClientStateGets the current builder- Specified by:
getCurrentBuilderin interfaceClientState- Returns:
-
setBaseURI
Description copied from interface:ClientStateSets the base URI- Specified by:
setBaseURIin interfaceClientState- Parameters:
baseURI- baseURI
-
getBaseURI
Description copied from interface:ClientStateGets the base URI- Specified by:
getBaseURIin interfaceClientState- Returns:
- baseURI
-
setResponse
public void setResponse(jakarta.ws.rs.core.Response response) Description copied from interface:ClientStateSets Response- Specified by:
setResponsein interfaceClientState- Parameters:
response- response
-
getResponse
public jakarta.ws.rs.core.Response getResponse()Description copied from interface:ClientStateGets Response- Specified by:
getResponsein interfaceClientState- Returns:
- response
-
setRequestHeaders
Description copied from interface:ClientStateSets the request headers- Specified by:
setRequestHeadersin interfaceClientState- Parameters:
requestHeaders- request headers
-
getRequestHeaders
Description copied from interface:ClientStateGets the request headers- Specified by:
getRequestHeadersin interfaceClientState- Returns:
- request headers, may be immutable
-
getTemplates
Description copied from interface:ClientStateGets the templates map- Specified by:
getTemplatesin interfaceClientState- Returns:
- templates
-
setTemplates
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, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, jakarta.ws.rs.core.MultivaluedMap<String, String> templates) 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 nulltemplates- initial templates map, can be null- Returns:
- client state
-
newState
public ClientState newState(URI currentURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, jakarta.ws.rs.core.MultivaluedMap<String, String> templates, Map<String, Object> properties) 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 nulltemplates- initial templates map, can be nullproperties- additional properties, could be null- Returns:
- client state
-
getState
-
setTimeToKeepState
public void setTimeToKeepState(long timeToKeepState)
-