Package com.sodius.oslc.client
Interface OslcResource
public interface OslcResource
Represents an OSLC resource, enabling the invocation of different HTTP methods.
This interface is not intended to be implemented by clients.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdd values to the Accept header.Add values to the Accept header.acceptLanguage(String... values) Add values to the Accept-Language header.acceptLanguage(Locale... values) Add values to the Accept-Language header.Get an attributeSet an attribute on the resource.contentType(MediaType mediaType) Set the Content-Type header, overriding any previous value.contentType(String mediaType) Set the Content-Type header, overriding any previous value.Add a Cookie value.Add a Cookie value.delete()Invoke the DELETE methodget()Invoke the GET methodGet theUriBuilderassociated with this resource.head()Invoke the HEAD methodAdds 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.options()Invoke the OPTIONS methodExecutes a PATCH request on the OSLC resource.Invoke the POST methodInvoke the PUT methodqueryParam(String key, Object... values) Add a query parameter to the uriqueryParams(MultivaluedMap<String, String> params) Add all the query parameters from the provided multivalued map.Set the uri of this resource and create a new UriBuilderSet the uri of this resource and create a new UriBuilder
-
Method Details
-
header
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.- Parameters:
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 (,).- Returns:
- this resource instance
- Since:
- 1.9.1
-
accept
Add values to the Accept header.- Parameters:
values- accept header values to add- Returns:
- this resource instance
-
accept
Add values to the Accept header.- Parameters:
values- accept header values to add- Returns:
- this resource instance
-
acceptLanguage
Add values to the Accept-Language header.- Parameters:
values- accept-language header values to add- Returns:
- this resource instance
- Since:
- 3.2.0
-
acceptLanguage
Add values to the Accept-Language header.- Parameters:
values- accept-language header values to add- Returns:
- this resource instance
- Since:
- 3.2.0
-
cookie
Add a Cookie value. Every call to this method will create a new Cookie header.- Parameters:
value- the cookie value to add- Returns:
- this resource instance
-
cookie
Add a Cookie value. Every call to this method will create a new Cookie header.- Parameters:
value- the cookie value to add- Returns:
- this resource instance
-
contentType
Set the Content-Type header, overriding any previous value.- Parameters:
mediaType- the content type to set- Returns:
- this resource instance
-
contentType
Set the Content-Type header, overriding any previous value.- Parameters:
mediaType- the content type to set- Returns:
- this resource instance
-
queryParam
Add a query parameter to the uri- Parameters:
key- the name of the query parametervalues- values of the query parameters. A query parameter will be added for every value- Returns:
- this resource instance
-
queryParams
Add all the query parameters from the provided multivalued map.- Parameters:
params- multivalued map of parameters.- Returns:
- this resource instance
-
attribute
Set an attribute on the resource.- Parameters:
key- attribute keyvalue- attribute value- Returns:
- this resource instance
-
attribute
Get an attribute- Parameters:
key- attribute key- Returns:
- attribute value, or null if the attribute is not set
-
getUriBuilder
UriBuilder getUriBuilder()Get theUriBuilderassociated with this resource. All modifications to the builder affect the uri of the resource- Returns:
- the
UriBuilderassociated with this resource
-
uri
Set the uri of this resource and create a new UriBuilder- Parameters:
uri- the new uri for this resource- Returns:
- this resource instance
-
uri
Set the uri of this resource and create a new UriBuilder- Parameters:
uri- the new uri for this resource- Returns:
- this resource instance
-
head
ClientResponse head()Invoke the HEAD method- Returns:
- the ClientResponse for the invocation
-
options
ClientResponse options()Invoke the OPTIONS method- Returns:
- the ClientResponse for the invocation
-
get
ClientResponse get()Invoke the GET method- Returns:
- the ClientResponse for the invocation
-
post
Invoke the POST method- Parameters:
requestEntity- the request entity- Returns:
- the ClientResponse for the invocation
-
put
Invoke the PUT method- Parameters:
requestEntity- the request entity- Returns:
- the ClientResponse for the invocation
-
delete
ClientResponse delete()Invoke the DELETE method- Returns:
- the ClientResponse for the invocation
-
patch
Executes a PATCH request on the OSLC resource.- Parameters:
requestEntity- the entity to send as request payload.- Returns:
- the response of the request execution.
- Since:
- 1.2.0
-