Interface InvocationBuilderListener.InvocationBuilderContext
-
- Enclosing interface:
- InvocationBuilderListener
public static interface InvocationBuilderListener.InvocationBuilderContextAnInvocation.Buildersubset of setter methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InvocationBuilderListener.InvocationBuilderContextaccept(jakarta.ws.rs.core.MediaType... mediaTypes)Add the accepted response media types.InvocationBuilderListener.InvocationBuilderContextaccept(String... mediaTypes)Add the accepted response media types.InvocationBuilderListener.InvocationBuilderContextacceptEncoding(String... encodings)Add acceptable encodings.InvocationBuilderListener.InvocationBuilderContextacceptLanguage(String... locales)Add acceptable languages.InvocationBuilderListener.InvocationBuilderContextacceptLanguage(Locale... locales)Add acceptable languages.InvocationBuilderListener.InvocationBuilderContextcacheControl(jakarta.ws.rs.core.CacheControl cacheControl)Set the cache control data of the message.InvocationBuilderListener.InvocationBuilderContextcookie(jakarta.ws.rs.core.Cookie cookie)Add a cookie to be set.InvocationBuilderListener.InvocationBuilderContextcookie(String name, String value)Add a cookie to be set.List<String>getAccepted()Get the accepted response media types.List<String>getAcceptedLanguages()Get acceptable languages.List<jakarta.ws.rs.core.CacheControl>getCacheControls()Get the cache control data of the message.jakarta.ws.rs.core.ConfigurationgetConfiguration()Get runtime configuration.Map<String,jakarta.ws.rs.core.Cookie>getCookies()Get any cookies that accompanied the request.List<String>getEncodings()Get acceptable encodings.List<String>getHeader(String name)Get the values of a HTTP request header.jakarta.ws.rs.core.MultivaluedMap<String,Object>getHeaders()Get the mutable message headers multivalued map.ObjectgetProperty(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.Collection<String>getPropertyNames()Returns an immutablecollectioncontaining the property names available within the context of the current request/response exchange context.URIgetUri()Get the request URI.InvocationBuilderListener.InvocationBuilderContextheader(String name, Object value)Add an arbitrary header.InvocationBuilderListener.InvocationBuilderContextheaders(jakarta.ws.rs.core.MultivaluedMap<String,Object> headers)Replaces all existing headers with the newly supplied headers.InvocationBuilderListener.InvocationBuilderContextproperty(String name, Object value)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 Detail
-
accept
InvocationBuilderListener.InvocationBuilderContext accept(String... mediaTypes)
Add the accepted response media types.- Parameters:
mediaTypes- accepted response media types.- Returns:
- the updated context.
-
accept
InvocationBuilderListener.InvocationBuilderContext accept(jakarta.ws.rs.core.MediaType... mediaTypes)
Add the accepted response media types.- Parameters:
mediaTypes- accepted response media types.- Returns:
- the updated context.
-
acceptLanguage
InvocationBuilderListener.InvocationBuilderContext acceptLanguage(Locale... locales)
Add acceptable languages.- Parameters:
locales- an array of the acceptable languages.- Returns:
- the updated context.
-
acceptLanguage
InvocationBuilderListener.InvocationBuilderContext acceptLanguage(String... locales)
Add acceptable languages.- Parameters:
locales- an array of the acceptable languages.- Returns:
- the updated context.
-
acceptEncoding
InvocationBuilderListener.InvocationBuilderContext acceptEncoding(String... encodings)
Add acceptable encodings.- Parameters:
encodings- an array of the acceptable encodings.- Returns:
- the updated context.
-
cookie
InvocationBuilderListener.InvocationBuilderContext cookie(jakarta.ws.rs.core.Cookie cookie)
Add a cookie to be set.- Parameters:
cookie- to be set.- Returns:
- the updated context.
-
cookie
InvocationBuilderListener.InvocationBuilderContext cookie(String name, String value)
Add a cookie to be set.- Parameters:
name- the name of the cookie.value- the value of the cookie.- Returns:
- the updated context.
-
cacheControl
InvocationBuilderListener.InvocationBuilderContext cacheControl(jakarta.ws.rs.core.CacheControl 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
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.
-
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, 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()
-
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:
getProperty(java.lang.String)
-
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 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
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, ifnullall 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)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:
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 togetProperty(java.lang.String)to retrieve the property value will returnnull.- Parameters:
name- aStringspecifying the name of the property to be removed.
-
-