Package com.sodius.oslc.client.requests
Class CreateProvisionalConsumerKey
- java.lang.Object
-
- com.sodius.oslc.client.requests.AbstractResourceRequest<String>
-
- com.sodius.oslc.client.requests.CreateProvisionalConsumerKey
-
- All Implemented Interfaces:
ResourceRequest<String>
,Callable<String>
public class CreateProvisionalConsumerKey extends AbstractResourceRequest<String>
Executes a POST request to create a provisional key.
- Since:
- 1.11.0
-
-
Constructor Summary
Constructors Constructor Description CreateProvisionalConsumerKey(OslcClient client, URI uri, String consumerName, String consumerSecret, boolean trusted)
Create a new instance to execute a POST on the URI provided, using the given client.CreateProvisionalConsumerKey(URI uri, String consumerName, String consumerSecret, boolean trusted)
Create a new instance to execute a POST on the URI provided
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientResponse
call(OslcResource resource)
Executes the POST request with a JSON payload created from the entityprotected String
createResponse(OslcResource resource, ClientResponse response)
Extract the key from the JSON payload of the response-
Methods inherited from class com.sodius.oslc.client.requests.AbstractResourceRequest
call, createErrorResponse, createResourceResponse, getClient, getUri
-
-
-
-
Constructor Detail
-
CreateProvisionalConsumerKey
public CreateProvisionalConsumerKey(URI uri, String consumerName, String consumerSecret, boolean trusted)
Create a new instance to execute a POST on the URI provided- Parameters:
uri
- the URI used for the underlying request, obtained from a root servicesoauthRequestConsumerKeyUrl
property.consumerName
- the wanted name for the consumerconsumerSecret
- the wanted secret for the consumertrusted
- true if we ask the remote application to trust our consumer at creation- See Also:
RootServices.getOAuthRequestConsumerKey()
-
CreateProvisionalConsumerKey
public CreateProvisionalConsumerKey(OslcClient client, URI uri, String consumerName, String consumerSecret, boolean trusted)
Create a new instance to execute a POST on the URI provided, using the given client.The client must be
unauthenticated
, as requesting a consumer key doesn't necessitate an Authorization header. and some servers may reject using one. The client may be customized usingOslcClientFactory
for specific parameters, like a proxy configuration.- Parameters:
client
- the client to useuri
- the URI used for the underlying request, obtained from a root servicesoauthRequestConsumerKeyUrl
property.consumerName
- the wanted name for the consumerconsumerSecret
- the wanted secret for the consumertrusted
- true if we ask the remote application to trust our consumer at creation- Since:
- 3.5.1
- See Also:
RootServices.getOAuthRequestConsumerKey()
-
-
Method Detail
-
createResponse
protected String createResponse(OslcResource resource, ClientResponse response)
Extract the key from the JSON payload of the response- Specified by:
createResponse
in classAbstractResourceRequest<String>
- Parameters:
resource
- the resource on which a request is executed.response
- the response obtained.- Returns:
- the extraction of the response content into the expected format.
-
call
protected ClientResponse call(OslcResource resource)
Executes the POST request with a JSON payload created from the entity- Specified by:
call
in classAbstractResourceRequest<String>
- Parameters:
resource
- the resource on which to execute a request.- Returns:
- the response of the request execution.
-
-