|
||||||||||
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(java.lang.String... values)
Add values to the Accept header. |
|
Resource |
acceptLanguage(java.util.Locale... values)
Add values to the Accept-Language header. |
|
Resource |
acceptLanguage(java.lang.String... values)
Add values to the Accept-Language header. |
|
java.lang.Object |
attribute(java.lang.String key)
Get an attribute |
|
Resource |
attribute(java.lang.String key,
java.lang.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(java.lang.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(java.lang.String value)
Add a Cookie value. |
|
ClientResponse |
delete()
Invoke the DELETE method |
|
|
delete(java.lang.Class<T> responseEntity)
Invoke the DELETE method |
|
|
delete(EntityType<T> responseEntity)
Invoke the DELETE method |
|
ClientResponse |
get()
Invoke the GET method |
|
|
get(java.lang.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(java.lang.String name,
java.lang.String... values)
Add a request header to be used in every invocation |
|
|
invoke(java.lang.String method,
java.lang.Class<T> responseEntity,
java.lang.Object requestEntity)
Invoke a request to the uri associated with the resource, and with any headers and attributes set on the resource. |
|
|
invoke(java.lang.String method,
EntityType<T> responseEntity,
java.lang.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(java.lang.Class<T> responseEntity,
java.lang.Object requestEntity)
Invoke the POST method |
|
|
post(EntityType<T> responseEntity,
java.lang.Object requestEntity)
Invoke the POST method |
|
ClientResponse |
post(java.lang.Object requestEntity)
Invoke the POST method |
|
|
put(java.lang.Class<T> responseEntity,
java.lang.Object requestEntity)
Invoke the PUT method |
|
|
put(EntityType<T> responseEntity,
java.lang.Object requestEntity)
Invoke the PUT method |
|
ClientResponse |
put(java.lang.Object requestEntity)
Invoke the PUT method |
|
Resource |
queryParam(java.lang.String key,
java.lang.Object... values)
Add a query parameter to the uri |
|
Resource |
queryParams(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> params)
Add all the query parameters from the provided multivalued map. |
|
Resource |
uri(java.lang.String uri)
Set the uri of this resource and create a new UriBuilder |
|
Resource |
uri(java.net.URI uri)
Set the uri of this resource and create a new UriBuilder |
Method Detail |
---|
Resource header(java.lang.String name, java.lang.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(java.lang.String... values)
values
- accept header values to add
Resource accept(javax.ws.rs.core.MediaType... values)
values
- accept header values to add
Resource acceptLanguage(java.lang.String... values)
values
- accept-langage header values to add
Resource acceptLanguage(java.util.Locale... values)
values
- accept-langage header values to add
Resource cookie(java.lang.String value)
value
- the cookie value to add
Resource cookie(javax.ws.rs.core.Cookie value)
value
- the cookie value to add
Resource contentType(java.lang.String mediaType)
mediaType
- the content type to set
Resource contentType(javax.ws.rs.core.MediaType mediaType)
mediaType
- the content type to set
Resource queryParam(java.lang.String key, java.lang.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<java.lang.String,java.lang.String> params)
params
- multivalued map of parameters.
Resource attribute(java.lang.String key, java.lang.Object value)
BaseRequestResponse.getAttributes()
and BaseRequestResponse.getAttributes()
methods.
key
- attribute keyvalue
- attribute value
java.lang.Object attribute(java.lang.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(java.net.URI uri)
uri
- the new uri for this resource
Resource uri(java.lang.String uri)
uri
- the new uri for this resource
<T> T invoke(java.lang.String method, java.lang.Class<T> responseEntity, java.lang.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(java.lang.String method, EntityType<T> responseEntity, java.lang.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(java.lang.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(java.lang.Class<T> responseEntity, java.lang.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, java.lang.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(java.lang.Object requestEntity)
<T> T put(java.lang.Class<T> responseEntity, java.lang.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, java.lang.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(java.lang.Object requestEntity)
<T> T delete(java.lang.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 |