public class CreateProvisionalConsumerKey extends AbstractResourceRequest<String>
Executes a POST request to create a provisional key.
Constructor and Description |
---|
CreateProvisionalConsumerKey(URI uri,
String consumerName,
String consumerSecret,
boolean trusted)
Create a new instance to execute a POST on the URI provided
|
Modifier and Type | Method and Description |
---|---|
protected ClientResponse |
call(OslcResource resource)
Executes the POST request with a JSON payload created from the entity
|
protected String |
createResponse(OslcResource resource,
ClientResponse response)
Extract the key from the JSON payload of the response
|
call, createErrorResponse, createResourceResponse, getClient, getUri
public CreateProvisionalConsumerKey(URI uri, String consumerName, String consumerSecret, boolean trusted)
uri
- the URI used for the underlying request, obtained from a root services oauthRequestConsumerKeyUrl
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 creationRootServices.getOAuthRequestConsumerKey()
protected String createResponse(OslcResource resource, ClientResponse response)
createResponse
in class AbstractResourceRequest<String>
resource
- the resource on which a request is executed.response
- the response obtained.protected ClientResponse call(OslcResource resource)
call
in class AbstractResourceRequest<String>
resource
- the resource on which to execute a request.