Apache CXF API

org.apache.cxf.jaxrs.client
Interface Client

All Known Implementing Classes:
AbstractClient, ClientProxyImpl, WebClient

public interface Client

Represents common proxy and http-centric client capabilities


Method Summary
 Client accept(javax.ws.rs.core.MediaType... types)
          sets HTTP Accept header
 Client accept(String... types)
          sets HTTP Accept header
 Client acceptEncoding(String... encodings)
          sets HTTP Accept-Encoding header
 Client acceptLanguage(String... languages)
          sets HTTP Accept-Language header
 Client cookie(javax.ws.rs.core.Cookie cookie)
          sets HTTP Cookie header
 Client encoding(String encoding)
          sets HTTP Content-Encoding header
 URI getBaseURI()
          Gets the base URI this Client has been intialized with
 URI getCurrentURI()
          Gets the current URI this Client is working with
 javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
          Gets the copy of request headers
 javax.ws.rs.core.Response getResponse()
          Gets the response state if any
 Client header(String name, Object... values)
          Sets arbitrary HTTP Header
 Client headers(javax.ws.rs.core.MultivaluedMap<String,String> map)
          Sets HTTP Headers
 Client language(String language)
          sets HTTP Content-Language header
 Client match(javax.ws.rs.core.EntityTag tag, boolean ifNot)
          sets HTTP If-Match or If-None-Match header
 Client modified(Date date, boolean ifNot)
          sets HTTP If-Modified-Since or If-Unmodified-Since header
 Client reset()
          Resets the headers and response state if any
 Client type(javax.ws.rs.core.MediaType ct)
          sets HTTP Content-Type header
 Client type(String type)
          sets HTTP Content-Type header
 

Method Detail

type

Client type(javax.ws.rs.core.MediaType ct)
sets HTTP Content-Type header

Parameters:
ct - JAXRS MediaType representing Content-Type value
Returns:
the updated Client

type

Client type(String type)
sets HTTP Content-Type header

Parameters:
type - Content-Type value
Returns:
the updated Client

accept

Client accept(javax.ws.rs.core.MediaType... types)
sets HTTP Accept header

Parameters:
types - list of JAXRS MediaTypes representing Accept header values
Returns:
the updated Client

accept

Client accept(String... types)
sets HTTP Accept header

Parameters:
types - list of Accept header values
Returns:
the updated Client

language

Client language(String language)
sets HTTP Content-Language header

Parameters:
language - Content-Language header value
Returns:
the updated Client

acceptLanguage

Client acceptLanguage(String... languages)
sets HTTP Accept-Language header

Parameters:
languages - list of Accept-Language header values
Returns:
the updated Client

encoding

Client encoding(String encoding)
sets HTTP Content-Encoding header

Parameters:
encoding - Content-Encoding header value
Returns:
the updated Client

acceptEncoding

Client acceptEncoding(String... encodings)
sets 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)
sets HTTP If-Match or If-None-Match header

Parameters:
tag - ETag value
ifNot - if true then If-None-Match is set, If-Match otherwise
Returns:
the updated Client

modified

Client modified(Date date,
                boolean ifNot)
sets 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)
sets HTTP Cookie header

Parameters:
cookie - Cookie value
Returns:
the updated Client

header

Client header(String name,
              Object... values)
Sets arbitrary HTTP Header

Parameters:
name - header name
values - list of header values
Returns:
the updated Client

headers

Client headers(javax.ws.rs.core.MultivaluedMap<String,String> map)
Sets HTTP Headers

Parameters:
map - headers
Returns:
the updated Client

reset

Client reset()
Resets the headers and response state if any

Returns:
the updated Client

getHeaders

javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
Gets the copy of request headers

Returns:
request headers

getBaseURI

URI getBaseURI()
Gets the base URI this Client has been intialized with

Returns:
base URI

getCurrentURI

URI getCurrentURI()
Gets the current URI this Client is working with

Returns:
current URI

getResponse

javax.ws.rs.core.Response getResponse()
Gets the response state if any

Returns:
JAXRS Response response

Apache CXF API

Apache CXF