Package org.fcrepo.client
Class TransactionalFcrepoClient
- java.lang.Object
-
- org.fcrepo.client.FcrepoClient
-
- org.fcrepo.client.TransactionalFcrepoClient
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class TransactionalFcrepoClient extends FcrepoClient
A Transaction aware client which adds the Atomic_ID header to requests and provides functionality for interacting with the Fedora Transaction API- Author:
- mikejritter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.fcrepo.client.FcrepoClient
FcrepoClient.FcrepoClientBuilder
-
-
Field Summary
-
Fields inherited from class org.fcrepo.client.FcrepoClient
TRANSACTION_ENDPOINT
-
-
Constructor Summary
Constructors Constructor Description TransactionalFcrepoClient(URI transactionURI, FcrepoHttpClientBuilder httpClientBuilder, Boolean throwExceptionOnFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PutBuildercommit()Commit a transaction by performing a PUTDeleteBuilderdelete(URI url)Make a DELETE request to delete a resourceGetBuilderget(URI url)Make a GET request to retrieve the content of a resourceURIgetTransactionURI()HeadBuilderhead(URI url)Make a HEAD request to retrieve resource headers.PostBuilderkeepAlive()Keep a transaction alive by performing a POSTOptionsBuilderoptions(URI url)Make a OPTIONS request to output information about the supported HTTP methods, etc.PatchBuilderpatch(URI url)Make a PATCH request to modify the triples associated with a resource with SPARQL-Update.PostBuilderpost(URI url)Make a POST request to create a new resource within an LDP container.PutBuilderput(URI url)Make a PUT request to create a resource with a specified path, or replace the triples associated with a resource with the triples provided in the request body.DeleteBuilderrollback()Rollback a transaction by performing a DELETEGetBuilderstatus()Retrieve the status of a transaction by performing a GET-
Methods inherited from class org.fcrepo.client.FcrepoClient
client, close, createMemento, createMemento, createMemento, executeRequest, startTransactionClient, transactionalClient
-
-
-
-
Constructor Detail
-
TransactionalFcrepoClient
public TransactionalFcrepoClient(URI transactionURI, FcrepoHttpClientBuilder httpClientBuilder, Boolean throwExceptionOnFailure)
- Parameters:
transactionURI- the transaction to append to all requestshttpClientBuilder- the httpclientthrowExceptionOnFailure- whether to throw an exception on any non-2xx or 3xx HTTP responses
-
-
Method Detail
-
getTransactionURI
public URI getTransactionURI()
-
commit
public PutBuilder commit()
Commit a transaction by performing a PUT- Returns:
- the commit RequestBuilder
-
status
public GetBuilder status()
Retrieve the status of a transaction by performing a GET- Returns:
- the status RequestBuilder
-
keepAlive
public PostBuilder keepAlive()
Keep a transaction alive by performing a POST- Returns:
- the keep alive RequestBuilder
-
rollback
public DeleteBuilder rollback()
Rollback a transaction by performing a DELETE- Returns:
- the rollback RequestBuilder
-
get
public GetBuilder get(URI url)
Description copied from class:FcrepoClientMake a GET request to retrieve the content of a resource- Overrides:
getin classFcrepoClient- Parameters:
url- the URL of the resource to which to GET- Returns:
- a get request builder object
-
head
public HeadBuilder head(URI url)
Description copied from class:FcrepoClientMake a HEAD request to retrieve resource headers.- Overrides:
headin classFcrepoClient- Parameters:
url- the URL of the resource to make the HEAD request on.- Returns:
- a HEAD request builder object
-
delete
public DeleteBuilder delete(URI url)
Description copied from class:FcrepoClientMake a DELETE request to delete a resource- Overrides:
deletein classFcrepoClient- Parameters:
url- the URL of the resource to which to DELETE- Returns:
- a delete request builder object
-
options
public OptionsBuilder options(URI url)
Description copied from class:FcrepoClientMake a OPTIONS request to output information about the supported HTTP methods, etc.- Overrides:
optionsin classFcrepoClient- Parameters:
url- the URL of the resource to make the OPTIONS request on.- Returns:
- a OPTIONS request builder object
-
patch
public PatchBuilder patch(URI url)
Description copied from class:FcrepoClientMake a PATCH request to modify the triples associated with a resource with SPARQL-Update.- Overrides:
patchin classFcrepoClient- Parameters:
url- the URL of the resource to which to PATCH- Returns:
- a patch request builder object
-
post
public PostBuilder post(URI url)
Description copied from class:FcrepoClientMake a POST request to create a new resource within an LDP container.- Overrides:
postin classFcrepoClient- Parameters:
url- the URL of the resource to which to POST- Returns:
- a post request builder object
-
put
public PutBuilder put(URI url)
Description copied from class:FcrepoClientMake a PUT request to create a resource with a specified path, or replace the triples associated with a resource with the triples provided in the request body.- Overrides:
putin classFcrepoClient- Parameters:
url- the URL of the resource to which to PUT- Returns:
- a put request builder object
-
-