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 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
      • setResponse

        void setResponse​(javax.ws.rs.core.Response response)
        Sets Response
        Parameters:
        response - response
      • getResponse

        javax.ws.rs.core.Response getResponse()
        Gets Response
        Returns:
        response
      • 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> templates)
        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
      • newState

        default ClientState newState​(URI baseURI,
                                     javax.ws.rs.core.MultivaluedMap<String,​String> headers,
                                     javax.ws.rs.core.MultivaluedMap<String,​String> templates,
                                     Map<String,​Object> properties)
        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
        properties - additional properties, could be null
        Returns:
        client state