Class SolidClient

java.lang.Object
com.inrupt.client.solid.SolidClient

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

    • 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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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 Resource> CompletionStage<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
    • getClientBuilder

      public static SolidClient.Builder getClientBuilder()
      Get a SolidClient.Builder for the current application.
      Returns:
      a client builder