|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cxf.jaxrs.client.AbstractClient
public abstract class AbstractClient
Common proxy and http-centric client implementation
Field Summary | |
---|---|
protected ClientConfiguration |
cfg
|
protected static String |
KEEP_CONDUIT_ALIVE
|
protected static String |
REQUEST_CONTEXT
|
protected static String |
RESPONSE_CONTEXT
|
Constructor Summary | |
---|---|
protected |
AbstractClient(ClientState initialState)
|
protected |
AbstractClient(URI baseURI)
|
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... encs)
sets HTTP Accept-Encoding header |
|
Client |
acceptLanguage(String... languages)
sets HTTP Accept-Language header |
|
protected static void |
addParametersToBuilder(javax.ws.rs.core.UriBuilder ub,
String paramName,
Object pValue,
ParameterType pt)
|
|
protected URI |
calculateNewRequestURI(Map<String,Object> reqContext)
|
|
protected void |
checkClientException(Message outMessage,
Exception ex)
|
|
protected void |
completeExchange(Object response,
Exchange exchange,
boolean proxy)
|
|
Client |
cookie(javax.ws.rs.core.Cookie cookie)
sets HTTP Cookie header |
|
protected Exchange |
createExchange(Message m,
Exchange exchange)
|
|
protected Message |
createMessage(Object body,
String httpMethod,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
URI currentURI,
Exchange exchange,
Map<String,Object> invocationContext,
boolean proxy)
|
|
Client |
encoding(String enc)
sets HTTP Content-Encoding header |
|
URI |
getBaseURI()
Gets the base URI this Client has been intialized with |
|
protected ClientConfiguration |
getConfiguration()
|
|
protected List<?> |
getContentsList(Object body)
|
|
protected javax.ws.rs.core.UriBuilder |
getCurrentBuilder()
|
|
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 |
|
protected Map<String,Object> |
getRequestContext(Message outMessage)
|
|
javax.ws.rs.core.Response |
getResponse()
Gets the response state if any |
|
protected ClientState |
getState()
|
|
protected javax.ws.rs.core.MultivaluedMap<String,String> |
getTemplateParametersMap(URITemplate template,
List<Object> values)
|
|
Client |
header(String name,
Object... values)
Sets arbitrary HTTP Header |
|
Client |
headers(javax.ws.rs.core.MultivaluedMap<String,String> map)
Sets HTTP Headers |
|
Object[] |
invoke(BindingOperationInfo oi,
Object[] params,
Map<String,Object> context,
Exchange exchange)
|
|
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 |
|
protected String[] |
parseQuotedHeaderValue(String originalValue)
|
|
protected void |
prepareConduitSelector(Message message,
URI currentURI,
boolean proxy)
|
|
protected Object[] |
preProcessResult(Message message)
|
|
protected
|
readBody(javax.ws.rs.core.Response r,
Message outMessage,
Class<T> cls,
Type type,
Annotation[] anns)
|
|
protected static void |
reportMessageHandlerProblem(String name,
Class<?> cls,
javax.ws.rs.core.MediaType ct,
Throwable cause,
javax.ws.rs.core.Response response)
|
|
Client |
reset()
Resets the headers and response state if any |
|
protected void |
resetBaseAddress(URI uri)
|
|
protected void |
resetCurrentBuilder(URI uri)
|
|
protected void |
resetResponse()
|
|
protected abstract Object |
retryInvoke(URI newRequestURI,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
Object body,
Exchange exchange,
Map<String,Object> invContext)
|
|
protected static void |
setAllHeaders(javax.ws.rs.core.MultivaluedMap<String,String> headers,
HttpURLConnection conn)
|
|
protected void |
setConfiguration(ClientConfiguration config)
|
|
protected void |
setContexts(Message message,
Exchange exchange,
Map<String,Object> context,
boolean proxy)
|
|
protected void |
setEmptyRequestProperty(Message outMessage,
String httpMethod)
|
|
protected void |
setPlainOperationNameProperty(Message outMessage,
String name)
|
|
protected javax.ws.rs.core.Response.ResponseBuilder |
setResponseBuilder(Message outMessage,
Exchange exchange)
|
|
protected static PhaseInterceptorChain |
setupInInterceptorChain(ClientConfiguration cfg)
|
|
protected static PhaseInterceptorChain |
setupOutInterceptorChain(ClientConfiguration cfg)
|
|
Client |
type(javax.ws.rs.core.MediaType ct)
sets HTTP Content-Type header |
|
Client |
type(String type)
sets HTTP Content-Type header |
|
protected void |
waitForResponseCode(Exchange exchange)
|
|
protected
|
writeBody(T o,
Message outMessage,
Class<?> cls,
Type type,
Annotation[] anns,
javax.ws.rs.core.MultivaluedMap<String,Object> headers,
OutputStream os)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String REQUEST_CONTEXT
protected static final String RESPONSE_CONTEXT
protected static final String KEEP_CONDUIT_ALIVE
protected ClientConfiguration cfg
Constructor Detail |
---|
protected AbstractClient(URI baseURI)
protected AbstractClient(ClientState initialState)
Method Detail |
---|
public Client header(String name, Object... values)
header
in interface Client
name
- header namevalues
- list of header values
public Client headers(javax.ws.rs.core.MultivaluedMap<String,String> map)
headers
in interface Client
map
- headers
public Client accept(javax.ws.rs.core.MediaType... types)
accept
in interface Client
types
- list of JAXRS MediaTypes representing Accept header values
public Client type(javax.ws.rs.core.MediaType ct)
type
in interface Client
ct
- JAXRS MediaType representing Content-Type value
public Client type(String type)
type
in interface Client
type
- Content-Type value
public Client accept(String... types)
accept
in interface Client
types
- list of Accept header values
public Client cookie(javax.ws.rs.core.Cookie cookie)
cookie
in interface Client
cookie
- Cookie value
public Client modified(Date date, boolean ifNot)
modified
in interface Client
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
public Client language(String language)
language
in interface Client
language
- Content-Language header value
public Client match(javax.ws.rs.core.EntityTag tag, boolean ifNot)
match
in interface Client
tag
- ETag valueifNot
- if true then If-None-Match is set, If-Match otherwise
public Client acceptLanguage(String... languages)
acceptLanguage
in interface Client
languages
- list of Accept-Language header values
public Client acceptEncoding(String... encs)
acceptEncoding
in interface Client
encs
- list of Accept-Encoding header value
public Client encoding(String enc)
encoding
in interface Client
enc
- Content-Encoding header value
public javax.ws.rs.core.MultivaluedMap<String,String> getHeaders()
getHeaders
in interface Client
public URI getBaseURI()
getBaseURI
in interface Client
public URI getCurrentURI()
getCurrentURI
in interface Client
public javax.ws.rs.core.Response getResponse()
getResponse
in interface Client
public Client reset()
reset
in interface Client
protected ClientState getState()
protected javax.ws.rs.core.UriBuilder getCurrentBuilder()
protected void resetResponse()
protected void resetBaseAddress(URI uri)
protected void resetCurrentBuilder(URI uri)
protected javax.ws.rs.core.MultivaluedMap<String,String> getTemplateParametersMap(URITemplate template, List<Object> values)
protected javax.ws.rs.core.Response.ResponseBuilder setResponseBuilder(Message outMessage, Exchange exchange) throws Exception
Exception
protected <T> void writeBody(T o, Message outMessage, Class<?> cls, Type type, Annotation[] anns, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
protected <T> T readBody(javax.ws.rs.core.Response r, Message outMessage, Class<T> cls, Type type, Annotation[] anns)
protected void completeExchange(Object response, Exchange exchange, boolean proxy)
protected Object[] preProcessResult(Message message) throws Exception
Exception
protected void checkClientException(Message outMessage, Exception ex) throws Exception
Exception
protected void waitForResponseCode(Exchange exchange)
protected URI calculateNewRequestURI(Map<String,Object> reqContext)
public Object[] invoke(BindingOperationInfo oi, Object[] params, Map<String,Object> context, Exchange exchange) throws Exception
invoke
in interface Retryable
Exception
protected abstract Object retryInvoke(URI newRequestURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, Object body, Exchange exchange, Map<String,Object> invContext) throws Throwable
Throwable
protected static void addParametersToBuilder(javax.ws.rs.core.UriBuilder ub, String paramName, Object pValue, ParameterType pt)
protected static void reportMessageHandlerProblem(String name, Class<?> cls, javax.ws.rs.core.MediaType ct, Throwable cause, javax.ws.rs.core.Response response)
protected static void setAllHeaders(javax.ws.rs.core.MultivaluedMap<String,String> headers, HttpURLConnection conn)
protected String[] parseQuotedHeaderValue(String originalValue)
protected ClientConfiguration getConfiguration()
protected void setConfiguration(ClientConfiguration config)
protected void prepareConduitSelector(Message message, URI currentURI, boolean proxy)
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg)
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg)
protected Message createMessage(Object body, String httpMethod, javax.ws.rs.core.MultivaluedMap<String,String> headers, URI currentURI, Exchange exchange, Map<String,Object> invocationContext, boolean proxy)
protected Map<String,Object> getRequestContext(Message outMessage)
protected List<?> getContentsList(Object body)
protected Exchange createExchange(Message m, Exchange exchange)
protected void setContexts(Message message, Exchange exchange, Map<String,Object> context, boolean proxy)
protected void setEmptyRequestProperty(Message outMessage, String httpMethod)
protected void setPlainOperationNameProperty(Message outMessage, String name)
|
Apache CXF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |