public interface OslcResource
Represents an OSLC resource, enabling the invocation of different HTTP methods.
This interface is not intended to be implemented by clients.
OslcClient.resource(URI)
Modifier and Type | Method and Description |
---|---|
OslcResource |
accept(MediaType... values)
Add values to the Accept header.
|
OslcResource |
accept(String... values)
Add values to the Accept header.
|
Object |
attribute(String key)
Get an attribute
|
OslcResource |
attribute(String key,
Object value)
Set an attribute on the resource.
|
OslcResource |
contentType(MediaType mediaType)
Set the Content-Type header, overriding any previous value.
|
OslcResource |
contentType(String mediaType)
Set the Content-Type header, overriding any previous value.
|
OslcResource |
cookie(Cookie value)
Add a Cookie value.
|
OslcResource |
cookie(String value)
Add a Cookie value.
|
ClientResponse |
delete()
Invoke the DELETE method
|
ClientResponse |
get()
Invoke the GET method
|
UriBuilder |
getUriBuilder()
Get the
UriBuilder associated with this resource. |
ClientResponse |
head()
Invoke the HEAD method
|
OslcResource |
header(String name,
String... values)
Adds a request header to be used in every invocation, making sure that any existing header with the same name is removed before adding the new
one.
|
ClientResponse |
options()
Invoke the OPTIONS method
|
ClientResponse |
patch(Object requestEntity)
Executes a PATCH request on the OSLC resource.
|
ClientResponse |
post(Object requestEntity)
Invoke the POST method
|
ClientResponse |
put(Object requestEntity)
Invoke the PUT method
|
OslcResource |
queryParam(String key,
Object... values)
Add a query parameter to the uri
|
OslcResource |
queryParams(MultivaluedMap<String,String> params)
Add all the query parameters from the provided multivalued map.
|
OslcResource |
uri(String uri)
Set the uri of this resource and create a new UriBuilder
|
OslcResource |
uri(URI uri)
Set the uri of this resource and create a new UriBuilder
|
OslcResource 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 (,).OslcResource accept(String... values)
values
- accept header values to addOslcResource accept(MediaType... values)
values
- accept header values to addOslcResource cookie(String value)
value
- the cookie value to addOslcResource cookie(Cookie value)
value
- the cookie value to addOslcResource contentType(String mediaType)
mediaType
- the content type to setOslcResource contentType(MediaType mediaType)
mediaType
- the content type to setOslcResource 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 valueOslcResource queryParams(MultivaluedMap<String,String> params)
params
- multivalued map of parameters.OslcResource attribute(String key, Object value)
key
- attribute keyvalue
- attribute valueObject attribute(String key)
key
- attribute keyUriBuilder getUriBuilder()
UriBuilder
associated with this resource.
All modifications to the builder affect the uri of the resourceUriBuilder
associated with this resourceOslcResource uri(URI uri)
uri
- the new uri for this resourceOslcResource uri(String uri)
uri
- the new uri for this resourceClientResponse head()
ClientResponse options()
ClientResponse get()
ClientResponse post(Object requestEntity)
requestEntity
- the request entityClientResponse put(Object requestEntity)
requestEntity
- the request entityClientResponse delete()
ClientResponse patch(Object requestEntity)
requestEntity
- the entity to send as request payload.