Package com.inrupt.client.solid
Class SolidClient
- java.lang.Object
-
- com.inrupt.client.solid.SolidClient
-
public class SolidClient extends Object
A high-level client for interacting with Solid resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SolidClient.Builder
A builder class for aSolidClient
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Resource>
CompletionStage<T>create(T resource)
Create a new Solid Resource.<T extends Resource>
CompletionStage<T>create(T resource, Headers headers)
Create a new Solid Resource.CompletionStage<Void>
delete(URI resource)
Delete an existing Solid Resource.CompletionStage<Void>
delete(URI resource, Headers headers)
Delete an existing Solid Resource.<T extends Resource>
CompletionStage<Void>delete(T resource)
Delete an existing Solid Resource.<T extends Resource>
CompletionStage<Void>delete(T resource, Headers headers)
Delete an existing Solid Resource.static SolidClient
getClient()
Get theSolidClient
for the current application.static SolidClient.Builder
getClientBuilder()
Get aSolidClient.Builder
for the current application.<T extends Resource>
CompletionStage<T>read(URI identifier, Headers headers, Class<T> clazz)
Read a Solid Resource into a particular defined type.<T extends Resource>
CompletionStage<T>read(URI identifier, Class<T> clazz)
Read a Solid Resource into a particular defined type.<T> CompletionStage<Response<T>>
send(Request request, Response.BodyHandler<T> responseBodyHandler)
Perform a low-level HTTP request.SolidClient
session(Session session)
Create a session-scoped client.<T extends Resource>
CompletionStage<T>update(T resource)
Update an existing Solid Resource.<T extends Resource>
CompletionStage<T>update(T resource, Headers headers)
Update an existing Solid Resource.
-
-
-
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 requestresponseBodyHandler
- 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 identifierclazz
- 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 identifierheaders
- headers to add to this requestclazz
- 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 resourceheaders
- 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 resourceheaders
- 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 URIheaders
- 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 resourceheaders
- headers to add to this request- Returns:
- the next stage of completion
-
getClient
public static SolidClient getClient()
Get theSolidClient
for the current application.- Returns:
- the client instance
-
getClientBuilder
public static SolidClient.Builder getClientBuilder()
Get aSolidClient.Builder
for the current application.- Returns:
- a client builder
-
-