Class 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 Detail

      • LocalClientState

        public LocalClientState()
      • LocalClientState

        public LocalClientState​(URI baseURI)
      • LocalClientState

        public LocalClientState​(URI baseURI,
                                Map<String,​Object> properties)
      • LocalClientState

        public LocalClientState​(URI baseURI,
                                URI currentURI)
      • LocalClientState

        public LocalClientState​(URI baseURI,
                                URI currentURI,
                                Map<String,​Object> properties)
    • 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
      • 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 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: 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:
        currentURI - baseURI
        headers - request headers, can be null
        templatesMap - initial templates map, can be null
        props - 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: 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:
        currentURI - baseURI
        headers - request headers, can be null
        templatesMap - initial templates map, can be null
        Returns:
        client state