Class CreateProvisionalConsumerKey

    • 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 services oauthRequestConsumerKeyUrl property.
        consumerName - the wanted name for the consumer
        consumerSecret - the wanted secret for the consumer
        trusted - 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 using OslcClientFactory for specific parameters, like a proxy configuration.

        Parameters:
        client - the client to use
        uri - the URI used for the underlying request, obtained from a root services oauthRequestConsumerKeyUrl property.
        consumerName - the wanted name for the consumer
        consumerSecret - the wanted secret for the consumer
        trusted - 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 class AbstractResourceRequest<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 class AbstractResourceRequest<String>
        Parameters:
        resource - the resource on which to execute a request.
        Returns:
        the response of the request execution.