Package org.apache.cxf.jaxrs.client
Interface Client
-
- All Known Implementing Classes:
AbstractClient,ClientProxyImpl,MicroProfileClientProxyImpl,WebClient
public interface ClientRepresents common proxy and http-centric client capabilities
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Clientaccept(String... types)Set HTTP Accept headerClientaccept(javax.ws.rs.core.MediaType... types)Set HTTP Accept headerClientacceptEncoding(String... encodings)Set HTTP Accept-Encoding headerClientacceptLanguage(String... languages)Set HTTP Accept-Language headerClientauthorization(Object auth)Set HTTP Authorization headervoidclose()Release the internal state and configuration associated with this clientClientcookie(javax.ws.rs.core.Cookie cookie)Set HTTP Cookie headerClientencoding(String encoding)Set HTTP Content-Encoding headerURIgetBaseURI()Get the base URI this Client has been intialized withURIgetCurrentURI()Get the current URI this Client is working withjavax.ws.rs.core.MultivaluedMap<String,String>getHeaders()Get the copy of request headersjavax.ws.rs.core.ResponsegetResponse()Get the response state if anyClientheader(String name, Object... values)Set arbitrary HTTP HeaderClientheaders(javax.ws.rs.core.MultivaluedMap<String,String> map)Set HTTP HeadersClientlanguage(String language)Set HTTP Content-Language headerClientmatch(javax.ws.rs.core.EntityTag tag, boolean ifNot)Set HTTP If-Match or If-None-Match headerClientmodified(Date date, boolean ifNot)Set HTTP If-Modified-Since or If-Unmodified-Since headerClientquery(String name, Object... values)Update the current URI query parametersClientreset()Reset the headers and response state if anyClienttype(String type)Set HTTP Content-Type headerClienttype(javax.ws.rs.core.MediaType ct)Set HTTP Content-Type header
-
-
-
Method Detail
-
type
Client type(javax.ws.rs.core.MediaType ct)
Set HTTP Content-Type header- Parameters:
ct- JAXRS MediaType representing Content-Type value- Returns:
- the updated Client
-
type
Client type(String type)
Set HTTP Content-Type header- Parameters:
type- Content-Type value- Returns:
- the updated Client
-
accept
Client accept(javax.ws.rs.core.MediaType... types)
Set HTTP Accept header- Parameters:
types- list of JAXRS MediaTypes representing Accept header values- Returns:
- the updated Client
-
accept
Client accept(String... types)
Set HTTP Accept header- Parameters:
types- list of Accept header values- Returns:
- the updated Client
-
language
Client language(String language)
Set HTTP Content-Language header- Parameters:
language- Content-Language header value- Returns:
- the updated Client
-
acceptLanguage
Client acceptLanguage(String... languages)
Set HTTP Accept-Language header- Parameters:
languages- list of Accept-Language header values- Returns:
- the updated Client
-
encoding
Client encoding(String encoding)
Set HTTP Content-Encoding header- Parameters:
encoding- Content-Encoding header value- Returns:
- the updated Client
-
acceptEncoding
Client acceptEncoding(String... encodings)
Set HTTP Accept-Encoding header- Parameters:
encodings- list of Accept-Encoding header value- Returns:
- the updated Client
-
match
Client match(javax.ws.rs.core.EntityTag tag, boolean ifNot)
Set HTTP If-Match or If-None-Match header- Parameters:
tag- ETag valueifNot- if true then If-None-Match is set, If-Match otherwise- Returns:
- the updated Client
-
modified
Client modified(Date date, boolean ifNot)
Set HTTP If-Modified-Since or If-Unmodified-Since header- Parameters:
date- Date value, will be formated as "EEE, dd MMM yyyy HH:mm:ss zzz"ifNot- if true then If-Unmodified-Since is set, If-Modified-Since otherwise- Returns:
- the updated Client
-
cookie
Client cookie(javax.ws.rs.core.Cookie cookie)
Set HTTP Cookie header- Parameters:
cookie- Cookie value- Returns:
- the updated Client
-
authorization
Client authorization(Object auth)
Set HTTP Authorization header- Parameters:
auth- Authorization value- Returns:
- the updated Client
-
query
Client query(String name, Object... values)
Update the current URI query parameters- Parameters:
name- query namevalues- query values- Returns:
- updated WebClient
-
header
Client header(String name, Object... values)
Set arbitrary HTTP Header- Parameters:
name- header namevalues- list of header values- Returns:
- the updated Client
-
headers
Client headers(javax.ws.rs.core.MultivaluedMap<String,String> map)
Set HTTP Headers- Parameters:
map- headers- Returns:
- the updated Client
-
reset
Client reset()
Reset the headers and response state if any- Returns:
- the updated Client
-
getHeaders
javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
Get the copy of request headers- Returns:
- request headers
-
getBaseURI
URI getBaseURI()
Get the base URI this Client has been intialized with- Returns:
- base URI
-
getCurrentURI
URI getCurrentURI()
Get the current URI this Client is working with- Returns:
- current URI
-
getResponse
javax.ws.rs.core.Response getResponse()
Get the response state if any- Returns:
- JAXRS Response response
-
close
void close()
Release the internal state and configuration associated with this client
-
-