|
Apache CXF API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cxf.jaxrs.client.AbstractClient
org.apache.cxf.jaxrs.client.WebClient
public class WebClient
Http-centric web client
| Field Summary |
|---|
| Fields inherited from class org.apache.cxf.jaxrs.client.AbstractClient |
|---|
cfg |
| Constructor Summary | |
|---|---|
protected |
WebClient(java.lang.String baseAddress)
|
protected |
WebClient(java.net.URI baseAddress)
|
| Method Summary | ||
|---|---|---|
WebClient |
accept(javax.ws.rs.core.MediaType... types)
sets HTTP Accept header |
|
WebClient |
accept(java.lang.String... types)
sets HTTP Accept header |
|
WebClient |
acceptEncoding(java.lang.String... encodings)
sets HTTP Accept-Encoding header |
|
WebClient |
acceptLanguage(java.lang.String... languages)
sets HTTP Accept-Language header |
|
WebClient |
back(boolean fast)
Goes back |
|
static Client |
client(java.lang.Object proxy)
Converts proxy to Client |
|
WebClient |
cookie(javax.ws.rs.core.Cookie cookie)
sets HTTP Cookie header |
|
static WebClient |
create(java.lang.String baseAddress)
Creates WebClient |
|
static WebClient |
create(java.lang.String baseAddress,
java.util.List<?> providers)
Creates WebClient |
|
static WebClient |
create(java.lang.String baseAddress,
java.util.List<?> providers,
java.lang.String configLocation)
Creates a Spring-configuration aware WebClient |
|
static WebClient |
create(java.lang.String baseAddress,
java.lang.String configLocation)
Creates a Spring-configuration aware WebClient |
|
static WebClient |
create(java.lang.String baseAddress,
java.lang.String username,
java.lang.String password,
java.lang.String configLocation)
Creates a Spring-configuration aware WebClient which will do basic authentication |
|
static WebClient |
create(java.net.URI baseURI)
Creates WebClient |
|
javax.ws.rs.core.Response |
delete()
Does HTTP DELETE invocation |
|
protected javax.ws.rs.core.Response |
doChainedInvocation(java.lang.String httpMethod,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers,
java.lang.Object body,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
|
|
protected javax.ws.rs.core.Response |
doInvoke(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
|
|
WebClient |
encoding(java.lang.String encoding)
sets HTTP Content-Encoding header |
|
javax.ws.rs.core.Response |
form(Form form)
Posts form data |
|
javax.ws.rs.core.Response |
form(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> values)
Posts form data |
|
static WebClient |
fromClient(Client client)
Creates WebClient, baseURI will be set to Client currentURI |
|
static WebClient |
fromClient(Client client,
boolean inheritHeaders)
Creates WebClient, baseURI will be set to Client currentURI |
|
javax.ws.rs.core.Response |
get()
Does HTTP GET invocation |
|
|
get(java.lang.Class<T> responseClass)
Does HTTP GET invocation and returns typed response object |
|
|
getCollection(java.lang.Class<T> memberClass)
Does HTTP GET invocation and returns a collection of typed objects |
|
static ClientConfiguration |
getConfig(java.lang.Object client)
Retieves ClientConfiguration |
|
protected java.net.HttpURLConnection |
getConnection(java.lang.String methodName)
|
|
protected javax.ws.rs.core.Response |
handleResponse(java.net.HttpURLConnection conn,
Message outMessage,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
|
|
javax.ws.rs.core.Response |
head()
Does HTTP HEAD invocation |
|
WebClient |
header(java.lang.String name,
java.lang.Object... values)
Sets arbitrary HTTP Header |
|
WebClient |
headers(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> map)
Sets HTTP Headers |
|
javax.ws.rs.core.Response |
invoke(java.lang.String httpMethod,
java.lang.Object body)
Does HTTP invocation |
|
|
invoke(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<T> responseClass)
Does HTTP invocation and returns types response object |
|
|
invokeAndGetCollection(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<T> memberClass)
Does HTTP invocation and returns a collection of typed objects |
|
WebClient |
language(java.lang.String language)
sets HTTP Content-Language header |
|
WebClient |
match(javax.ws.rs.core.EntityTag tag,
boolean ifNot)
sets HTTP If-Match or If-None-Match header |
|
WebClient |
matrix(java.lang.String name,
java.lang.Object... values)
Updates the current URI matrix parameters |
|
WebClient |
modified(java.util.Date date,
boolean ifNot)
sets HTTP If-Modified-Since or If-Unmodified-Since header |
|
javax.ws.rs.core.Response |
options()
Does HTTP OPTIONS invocation |
|
WebClient |
path(java.lang.Object path)
Updates the current URI path |
|
WebClient |
path(java.lang.String path,
java.lang.Object... values)
Updates the current URI path with path segment which may contain template variables |
|
javax.ws.rs.core.Response |
post(java.lang.Object body)
Does HTTP POST invocation |
|
|
post(java.lang.Object body,
java.lang.Class<T> responseClass)
Does HTTP POST invocation and returns typed response object |
|
|
postAndGetCollection(java.lang.Object body,
java.lang.Class<T> memberClass)
Does HTTP POST invocation and returns a collection of typed objects |
|
javax.ws.rs.core.Response |
put(java.lang.Object body)
Does HTTP PUT invocation |
|
WebClient |
query(java.lang.String name,
java.lang.Object... values)
Updates the current URI query parameters |
|
WebClient |
reset()
Resets the headers and response state if any |
|
WebClient |
to(java.lang.String newAddress,
boolean forward)
Moves WebClient to a new baseURI or forwards to new currentURI |
|
WebClient |
type(javax.ws.rs.core.MediaType ct)
sets HTTP Content-Type header |
|
WebClient |
type(java.lang.String type)
sets HTTP Content-Type header |
|
| Methods inherited from class org.apache.cxf.jaxrs.client.AbstractClient |
|---|
addParametersToBuilder, createHttpConnection, createMessage, createSimpleMessage, getBaseURI, getConfiguration, getCurrentBuilder, getCurrentURI, getHeaders, getResponse, prepareConduitSelector, readBody, reportNoMessageHandler, resetBaseAddress, resetCurrentBuilder, resetResponse, setAllHeaders, setConfiguration, setResponseBuilder, setupInInterceptorChain, setupOutInterceptorChain, writeBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected WebClient(java.lang.String baseAddress)
protected WebClient(java.net.URI baseAddress)
| Method Detail |
|---|
public static WebClient create(java.lang.String baseAddress)
baseAddress - baseAddresspublic static WebClient create(java.net.URI baseURI)
baseURI - baseURI
public static WebClient create(java.lang.String baseAddress,
java.util.List<?> providers)
baseURI - baseURIproviders - list of providers
public static WebClient create(java.lang.String baseAddress,
java.util.List<?> providers,
java.lang.String configLocation)
baseAddress - baseAddressproviders - list of providersconfigLocation - classpath location of Spring configuration resource, can be null
public static WebClient create(java.lang.String baseAddress,
java.lang.String configLocation)
baseAddress - baseAddressconfigLocation - classpath location of Spring configuration resource, can be null
public static WebClient create(java.lang.String baseAddress,
java.lang.String username,
java.lang.String password,
java.lang.String configLocation)
baseAddress - baseAddressusername - usernamepassword - passwordconfigLocation - classpath location of Spring configuration resource, can be null
public static WebClient fromClient(Client client)
client - existing client
public static WebClient fromClient(Client client,
boolean inheritHeaders)
client - existing clientinheritHeaders - if existing Client headers can be inherited by new proxy
and subresource proxies if anypublic static Client client(java.lang.Object proxy)
proxy - the proxy
public static ClientConfiguration getConfig(java.lang.Object client)
client - proxy or http-centric Client
public javax.ws.rs.core.Response invoke(java.lang.String httpMethod,
java.lang.Object body)
httpMethod - HTTP methodbody - request body, can be null
public javax.ws.rs.core.Response post(java.lang.Object body)
body - request body, can be null
public javax.ws.rs.core.Response put(java.lang.Object body)
body - request body, can be null
public javax.ws.rs.core.Response get()
public javax.ws.rs.core.Response head()
public javax.ws.rs.core.Response options()
public javax.ws.rs.core.Response delete()
public javax.ws.rs.core.Response form(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> values)
values - form values
public javax.ws.rs.core.Response form(Form form)
form - form values
public <T> T invoke(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<T> responseClass)
httpMethod - HTTP methodbody - request body, can be nullresponseClass - expected type of response object
public <T> java.util.Collection<T> invokeAndGetCollection(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<T> memberClass)
httpMethod - HTTP methodbody - request body, can be nullmemberClass - expected type of collection member class
public <T> T post(java.lang.Object body,
java.lang.Class<T> responseClass)
body - request body, can be nullresponseClass - expected type of response object
public <T> java.util.Collection<? extends T> postAndGetCollection(java.lang.Object body,
java.lang.Class<T> memberClass)
body - request body, can be nullmemberClass - expected type of collection member class
public <T> java.util.Collection<? extends T> getCollection(java.lang.Class<T> memberClass)
body - request body, can be nullmemberClass - expected type of collection member class
public <T> T get(java.lang.Class<T> responseClass)
body - request body, can be nullresponseClass - expected type of response object
public WebClient path(java.lang.Object path)
path - new relative path segment
public WebClient path(java.lang.String path,
java.lang.Object... values)
path - new relative path segmentvalues - template variable values
public WebClient query(java.lang.String name,
java.lang.Object... values)
name - query namevalues - query values
public WebClient matrix(java.lang.String name,
java.lang.Object... values)
name - matrix namevalues - matrix values
public WebClient to(java.lang.String newAddress,
boolean forward)
newAddress - new URIforward - if true then currentURI will be based on baseURI
public WebClient back(boolean fast)
fast - if true then goes back to baseURI otherwise to a previous path segment
public WebClient type(javax.ws.rs.core.MediaType ct)
AbstractClient
type in interface Clienttype in class AbstractClientct - JAXRS MediaType representing Content-Type value
public WebClient type(java.lang.String type)
AbstractClient
type in interface Clienttype in class AbstractClienttype - Content-Type value
public WebClient accept(javax.ws.rs.core.MediaType... types)
AbstractClient
accept in interface Clientaccept in class AbstractClienttypes - list of JAXRS MediaTypes representing Accept header values
public WebClient accept(java.lang.String... types)
AbstractClient
accept in interface Clientaccept in class AbstractClienttypes - list of Accept header values
public WebClient language(java.lang.String language)
AbstractClient
language in interface Clientlanguage in class AbstractClientlanguage - Content-Language header value
public WebClient acceptLanguage(java.lang.String... languages)
AbstractClient
acceptLanguage in interface ClientacceptLanguage in class AbstractClientlanguages - list of Accept-Language header values
public WebClient encoding(java.lang.String encoding)
AbstractClient
encoding in interface Clientencoding in class AbstractClientencoding - Content-Encoding header value
public WebClient acceptEncoding(java.lang.String... encodings)
AbstractClient
acceptEncoding in interface ClientacceptEncoding in class AbstractClientencodings - list of Accept-Encoding header value
public WebClient match(javax.ws.rs.core.EntityTag tag,
boolean ifNot)
AbstractClient
match in interface Clientmatch in class AbstractClienttag - ETag valueifNot - if true then If-None-Match is set, If-Match otherwise
public WebClient modified(java.util.Date date,
boolean ifNot)
AbstractClient
modified in interface Clientmodified in class AbstractClientdate - 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
public WebClient cookie(javax.ws.rs.core.Cookie cookie)
AbstractClient
cookie in interface Clientcookie in class AbstractClientcookie - Cookie value
public WebClient header(java.lang.String name,
java.lang.Object... values)
AbstractClient
header in interface Clientheader in class AbstractClientname - header namevalues - list of header values
public WebClient headers(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> map)
AbstractClient
headers in interface Clientheaders in class AbstractClientmap - headers
public WebClient reset()
AbstractClient
reset in interface Clientreset in class AbstractClient
protected javax.ws.rs.core.Response doInvoke(java.lang.String httpMethod,
java.lang.Object body,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
protected javax.ws.rs.core.Response doChainedInvocation(java.lang.String httpMethod,
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> headers,
java.lang.Object body,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
protected javax.ws.rs.core.Response handleResponse(java.net.HttpURLConnection conn,
Message outMessage,
java.lang.Class<?> responseClass,
java.lang.reflect.Type genericType)
protected java.net.HttpURLConnection getConnection(java.lang.String methodName)
|
Apache CXF API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||