|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Resource
Represents a web resource, enabling the invocation of different http methods
| Method Summary | ||
|---|---|---|
Resource |
accept(javax.ws.rs.core.MediaType... values)
Add values to the Accept header. |
|
Resource |
accept(String... values)
Add values to the Accept header. |
|
Resource |
acceptLanguage(Locale... values)
Add values to the Accept-Language header. |
|
Resource |
acceptLanguage(String... values)
Add values to the Accept-Language header. |
|
Object |
attribute(String key)
Get an attribute |
|
Resource |
attribute(String key,
Object value)
Set an attribute on the resource. |
|
Resource |
contentType(javax.ws.rs.core.MediaType mediaType)
Set the Content-Type header, overriding any previous value. |
|
Resource |
contentType(String mediaType)
Set the Content-Type header, overriding any previous value. |
|
Resource |
cookie(javax.ws.rs.core.Cookie value)
Add a Cookie value. |
|
Resource |
cookie(String value)
Add a Cookie value. |
|
ClientResponse |
delete()
Invoke the DELETE method |
|
|
delete(Class<T> responseEntity)
Invoke the DELETE method |
|
|
delete(EntityType<T> responseEntity)
Invoke the DELETE method |
|
ClientResponse |
get()
Invoke the GET method |
|
|
get(Class<T> responseEntity)
Invoke the GET method |
|
|
get(EntityType<T> responseEntity)
Invoke the GET method |
|
javax.ws.rs.core.UriBuilder |
getUriBuilder()
Get the UriBuilder associated with this resource. |
|
ClientResponse |
head()
Invoke the HEAD method |
|
Resource |
header(String name,
String... values)
Add a request header to be used in every invocation |
|
|
invoke(String method,
Class<T> responseEntity,
Object requestEntity)
Invoke a request to the uri associated with the resource, and with any headers and attributes set on the resource. |
|
|
invoke(String method,
EntityType<T> responseEntity,
Object requestEntity)
Invoke a request to the uri associated with the resource, and with any headers and attributes set on the resource. |
|
ClientResponse |
options()
Invoke the OPTIONS method |
|
|
post(Class<T> responseEntity,
Object requestEntity)
Invoke the POST method |
|
|
post(EntityType<T> responseEntity,
Object requestEntity)
Invoke the POST method |
|
ClientResponse |
post(Object requestEntity)
Invoke the POST method |
|
|
put(Class<T> responseEntity,
Object requestEntity)
Invoke the PUT method |
|
|
put(EntityType<T> responseEntity,
Object requestEntity)
Invoke the PUT method |
|
ClientResponse |
put(Object requestEntity)
Invoke the PUT method |
|
Resource |
queryParam(String key,
Object... values)
Add a query parameter to the uri |
|
Resource |
queryParams(javax.ws.rs.core.MultivaluedMap<String,String> params)
Add all the query parameters from the provided multivalued map. |
|
Resource |
uri(String uri)
Set the uri of this resource and create a new UriBuilder |
|
Resource |
uri(URI uri)
Set the uri of this resource and create a new UriBuilder |
|
| Method Detail |
|---|
Resource header(String name,
String... values)
name - name of the header to add. the name of the header is case
insensitive.values - the values of the header. All of the values will be added
to the same header, separated by a commas (,).
Resource accept(String... values)
values - accept header values to add
Resource accept(javax.ws.rs.core.MediaType... values)
values - accept header values to add
Resource acceptLanguage(String... values)
values - accept-langage header values to add
Resource acceptLanguage(Locale... values)
values - accept-langage header values to add
Resource cookie(String value)
value - the cookie value to add
Resource cookie(javax.ws.rs.core.Cookie value)
value - the cookie value to add
Resource contentType(String mediaType)
mediaType - the content type to set
Resource contentType(javax.ws.rs.core.MediaType mediaType)
mediaType - the content type to set
Resource queryParam(String key,
Object... values)
key - the name of the query parametervalues - values of the query parameters. A query parameter will be
added for every value
Resource queryParams(javax.ws.rs.core.MultivaluedMap<String,String> params)
params - multivalued map of parameters.
Resource attribute(String key,
Object value)
BaseRequestResponse.getAttributes()
and BaseRequestResponse.getAttributes() methods.
key - attribute keyvalue - attribute value
Object attribute(String key)
key - attribute key
javax.ws.rs.core.UriBuilder getUriBuilder()
UriBuilder associated with this resource. All
modifications to the builder affect the uri of the resource
UriBuilder associated with this resourceResource uri(URI uri)
uri - the new uri for this resource
Resource uri(String uri)
uri - the new uri for this resource
<T> T invoke(String method,
Class<T> responseEntity,
Object requestEntity)
ClientWebException is thrown.
T - the type of response entity to returnmethod - the http request methodresponseEntity - the class of the response entity to returnrequestEntity - the request entity for methods that can send an
entity (PUT, POST)
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encounters
<T> T invoke(String method,
EntityType<T> responseEntity,
Object requestEntity)
ClientWebException is thrown.
T - the type of response entity to returnmethod - the http request methodresponseEntity - an instance of EntityType specifying the
response entity to returnrequestEntity - the request entity for methods that can send an
entity (PUT, POST)
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encountersClientResponse head()
ClientResponse options()
<T> T get(Class<T> responseEntity)
T - type of response entityresponseEntity - response entity class
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encounters<T> T get(EntityType<T> responseEntity)
T - type of response entityresponseEntity - an instance of EntityType specifying the
response entity to return
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encountersClientResponse get()
<T> T post(Class<T> responseEntity,
Object requestEntity)
T - type of response entityresponseEntity - response entity classrequestEntity - request entity to send
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encounters
<T> T post(EntityType<T> responseEntity,
Object requestEntity)
T - type of response entityresponseEntity - an instance of EntityType specifying the
response entity to returnrequestEntity - request entity to send
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encountersClientResponse post(Object requestEntity)
<T> T put(Class<T> responseEntity,
Object requestEntity)
T - type of response entityresponseEntity - response entity classrequestEntity - request entity to send
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encounters
<T> T put(EntityType<T> responseEntity,
Object requestEntity)
T - type of response entityresponseEntity - an instance of EntityType specifying the
response entity to returnrequestEntity - request entity to send
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encountersClientResponse put(Object requestEntity)
<T> T delete(Class<T> responseEntity)
T - type of response entityresponseEntity - response entity class
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encounters<T> T delete(EntityType<T> responseEntity)
T - type of response entityresponseEntity - an instance of EntityType specifying the
response entity to return
ClientWebException - if the response code represents an error code
ClientRuntimeException - if there are other exceptions that the Wink client encountersClientResponse delete()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||