Interface InvocationBuilderListener.InvocationBuilderContext

Enclosing interface:
InvocationBuilderListener

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

    • accept

      Add the accepted response media types.
      Parameters:
      mediaTypes - accepted response media types.
      Returns:
      the updated context.
    • accept

      Add the accepted response media types.
      Parameters:
      mediaTypes - accepted response media types.
      Returns:
      the updated context.
    • acceptLanguage

      Add acceptable languages.
      Parameters:
      locales - an array of the acceptable languages.
      Returns:
      the updated context.
    • acceptLanguage

      Add acceptable languages.
      Parameters:
      locales - an array of the acceptable languages.
      Returns:
      the updated context.
    • acceptEncoding

      Add acceptable encodings.
      Parameters:
      encodings - an array of the acceptable encodings.
      Returns:
      the updated context.
    • cookie

      Add a cookie to be set.
      Parameters:
      cookie - to be set.
      Returns:
      the updated context.
    • cookie

      Add a cookie to be set.
      Parameters:
      name - the name of the cookie.
      value - the value of the cookie.
      Returns:
      the updated context.
    • 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<CacheControl> getCacheControls()
      Get the cache control data of the message.
      Returns:
      the cache control data of the message.
    • getConfiguration

      Configuration getConfiguration()
      Get runtime configuration.
      Returns:
      runtime configuration.
    • getCookies

      Map<String,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

      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

      Collection<String> getPropertyNames()
      Returns an immutable collection containing the property names available within the context of the current request/response exchange context.

      Use the getProperty(java.lang.String) method with a property name to get the value of a property.

      Returns:
      an immutable collection of property names.
      See Also:
    • getUri

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

      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

      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

      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:
    • 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.