Class SolidClient


  • public class SolidClient
    extends Object
    A high-level client for interacting with Solid resources.
    • Method Detail

      • session

        public SolidClient session​(Session session)
        Create a session-scoped client.
        Parameters:
        session - the session
        Returns:
        a session-scoped client
      • send

        public <T> CompletionStage<Response<T>> send​(Request request,
                                                     Response.BodyHandler<T> responseBodyHandler)
        Perform a low-level HTTP request.
        Type Parameters:
        T - the response handler type
        Parameters:
        request - the request
        responseBodyHandler - the body handler
        Returns:
        the response
      • read

        public <T extends ResourceCompletionStage<T> read​(URI identifier,
                                                            Class<T> clazz)
        Read a Solid Resource into a particular defined type.
        Type Parameters:
        T - the resource type
        Parameters:
        identifier - the identifier
        clazz - the desired resource type
        Returns:
        the next stage of completion, including the new resource
      • read

        public <T extends ResourceCompletionStage<T> read​(URI identifier,
                                                            Headers headers,
                                                            Class<T> clazz)
        Read a Solid Resource into a particular defined type.
        Type Parameters:
        T - the resource type
        Parameters:
        identifier - the identifier
        headers - headers to add to this request
        clazz - the desired resource type
        Returns:
        the next stage of completion, including the new resource
      • create

        public <T extends ResourceCompletionStage<T> create​(T resource)
        Create a new Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        Returns:
        the next stage of completion
      • create

        public <T extends ResourceCompletionStage<T> create​(T resource,
                                                              Headers headers)
        Create a new Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        headers - headers to add to this request
        Returns:
        the next stage of completion
      • update

        public <T extends ResourceCompletionStage<T> update​(T resource)
        Update an existing Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        Returns:
        the next stage of completion
      • update

        public <T extends ResourceCompletionStage<T> update​(T resource,
                                                              Headers headers)
        Update an existing Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        headers - headers to add to this request
        Returns:
        the next stage of completion
      • delete

        public CompletionStage<Void> delete​(URI resource)
        Delete an existing Solid Resource.
        Parameters:
        resource - the resource URI
        Returns:
        the next stage of completion
      • delete

        public CompletionStage<Void> delete​(URI resource,
                                            Headers headers)
        Delete an existing Solid Resource.
        Parameters:
        resource - the resource URI
        headers - headers to add to this request
        Returns:
        the next stage of completion
      • delete

        public <T extends ResourceCompletionStage<Void> delete​(T resource)
        Delete an existing Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        Returns:
        the next stage of completion
      • delete

        public <T extends ResourceCompletionStage<Void> delete​(T resource,
                                                                 Headers headers)
        Delete an existing Solid Resource.
        Type Parameters:
        T - the resource type
        Parameters:
        resource - the resource
        headers - headers to add to this request
        Returns:
        the next stage of completion
      • getClient

        public static SolidClient getClient()
        Get the SolidClient for the current application.
        Returns:
        the client instance