Interface InvocationBuilderListener.InvocationBuilderContext
- Enclosing interface:
- InvocationBuilderListener
Invocation.Builder subset of setter methods.-
Method Summary
Modifier and TypeMethodDescriptionAdd the accepted response media types.Add the accepted response media types.acceptEncoding(String... encodings) Add acceptable encodings.acceptLanguage(String... locales) Add acceptable languages.acceptLanguage(Locale... locales) Add acceptable languages.cacheControl(CacheControl cacheControl) Set the cache control data of the message.Add a cookie to be set.Add a cookie to be set.Get the accepted response media types.Get acceptable languages.Get the cache control data of the message.Get runtime configuration.Get any cookies that accompanied the request.Get acceptable encodings.Get the values of a HTTP request header.Get the mutable message headers multivalued map.getProperty(String name) Returns the property with the given name registered in the current request/response exchange context, ornullif there is no property by that name.Returns an immutablecollectioncontaining the property names available within the context of the current request/response exchange context.getUri()Get the request URI.Add an arbitrary header.headers(MultivaluedMap<String, Object> headers) Replaces all existing headers with the newly supplied headers.Set a new property in the context of a request represented by this invocation builder.voidremoveProperty(String name) Removes a property with the given name from the current request/response exchange context.
-
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, ifnullany existing cache control directives will be removed.- Returns:
- the updated context.
-
getAccepted
Get the accepted response media types.- Returns:
- accepted response media types.
-
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
Get any cookies that accompanied the request.- Returns:
- a read-only map of cookie name (String) to
Cookie.
-
getEncodings
Get acceptable encodings.- Returns:
- acceptable encodings.
-
getHeader
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
MultivaluedMap<String,Object> getHeaders()Get the mutable message headers multivalued map.- Returns:
- mutable multivalued map of message headers.
-
getProperty
Returns the property with the given name registered in the current request/response exchange context, ornullif 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- aStringspecifying the name of the property.- Returns:
- an
Objectcontaining the value of the property, ornullif no property exists matching the given name. - See Also:
-
getPropertyNames
Collection<String> getPropertyNames()Returns an immutablecollectioncontaining 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
collectionof 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 headervalue- the value of the header, the header will be serialized using aRuntimeDelegate.HeaderDelegateif one is available viaRuntimeDelegate.createHeaderDelegate(java.lang.Class)for the class ofvalueor using itstoStringmethod if a header delegate is not available. Ifvalueisnullthen 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, ifnullall 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)orInterceptorContext.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 anullvalue into a property effectively removes the property from the request property bag.- Parameters:
name- property name.value- (new) property value.nullvalue removes the property with the given name.- Returns:
- the updated context.
- See Also:
-
removeProperty
Removes a property with the given name from the current request/response exchange context. After removal, subsequent calls togetProperty(java.lang.String)to retrieve the property value will returnnull.- Parameters:
name- aStringspecifying the name of the property to be removed.
-