Interface InvocationBuilderListener.InvocationBuilderContext

  • Enclosing interface:
    InvocationBuilderListener

    public static interface InvocationBuilderListener.InvocationBuilderContext
    An Invocation.Builder subset of setter methods.
    • Method Detail

      • cacheControl

        InvocationBuilderListener.InvocationBuilderContext cacheControl​(jakarta.ws.rs.core.CacheControl cacheControl)
        Set the cache control data of the message.
        Parameters:
        cacheControl - the cache control directives, if null any existing cache control directives will be removed.
        Returns:
        the updated context.
      • getAccepted

        List<String> getAccepted()
        Get the accepted response media types.
        Returns:
        accepted response media types.
      • getAcceptedLanguages

        List<String> getAcceptedLanguages()
        Get acceptable languages.
        Returns:
        acceptable languages.
      • getCacheControls

        List<jakarta.ws.rs.core.CacheControl> getCacheControls()
        Get the cache control data of the message.
        Returns:
        the cache control data of the message.
      • getConfiguration

        jakarta.ws.rs.core.Configuration getConfiguration()
        Get runtime configuration.
        Returns:
        runtime configuration.
      • getCookies

        Map<String,​jakarta.ws.rs.core.Cookie> getCookies()
        Get any cookies that accompanied the request.
        Returns:
        a read-only map of cookie name (String) to Cookie.
      • getEncodings

        List<String> getEncodings()
        Get acceptable encodings.
        Returns:
        acceptable encodings.
      • getHeader

        List<String> getHeader​(String name)
        Get the values of a HTTP request header. The returned List is read-only.
        Parameters:
        name - the header name, case insensitive.
        Returns:
        a read-only list of header values.
      • getHeaders

        jakarta.ws.rs.core.MultivaluedMap<String,​Object> getHeaders()
        Get the mutable message headers multivalued map.
        Returns:
        mutable multivalued map of message headers.
      • getProperty

        Object getProperty​(String name)
        Returns the property with the given name registered in the current request/response exchange context, or null if there is no property by that name.

        A property allows filters and interceptors to exchange additional custom information not already provided by this interface.

        A list of supported properties can be retrieved using getPropertyNames(). Custom property names should follow the same convention as package names.

        Parameters:
        name - a String specifying the name of the property.
        Returns:
        an Object containing the value of the property, or null if no property exists matching the given name.
        See Also:
        getPropertyNames()
      • getUri

        URI getUri()
        Get the request URI.
        Returns:
        request URI.
      • header

        InvocationBuilderListener.InvocationBuilderContext header​(String name,
                                                                  Object value)
        Add an arbitrary header.
        Parameters:
        name - the name of the header
        value - the value of the header, the header will be serialized using a RuntimeDelegate.HeaderDelegate if one is available via RuntimeDelegate.createHeaderDelegate(java.lang.Class) for the class of value or using its toString method if a header delegate is not available. If value is null then all current headers of the same name will be removed.
        Returns:
        the updated context.
      • headers

        InvocationBuilderListener.InvocationBuilderContext headers​(jakarta.ws.rs.core.MultivaluedMap<String,​Object> headers)
        Replaces all existing headers with the newly supplied headers.
        Parameters:
        headers - new headers to be set, if null all existing headers will be removed.
        Returns:
        the updated context.
      • property

        InvocationBuilderListener.InvocationBuilderContext property​(String name,
                                                                    Object value)
        Set a new property in the context of a request represented by this invocation builder.

        The property is available for a later retrieval via ClientRequestContext.getProperty(String) or InterceptorContext.getProperty(String). If a property with a given name is already set in the request context, the existing value of the property will be updated. Setting a null value into a property effectively removes the property from the request property bag.

        Parameters:
        name - property name.
        value - (new) property value. null value removes the property with the given name.
        Returns:
        the updated context.
        See Also:
        Invocation.property(String, Object)
      • removeProperty

        void removeProperty​(String name)
        Removes a property with the given name from the current request/response exchange context. After removal, subsequent calls to getProperty(java.lang.String) to retrieve the property value will return null.
        Parameters:
        name - a String specifying the name of the property to be removed.