Package org.fcrepo.http.api
Class Transactions
- java.lang.Object
-
- org.fcrepo.http.commons.AbstractResource
-
- org.fcrepo.http.api.FedoraBaseResource
-
- org.fcrepo.http.api.Transactions
-
@Scope("prototype") @Path("/fcr:tx") public class Transactions extends FedoraBaseResource
The rest interface for transaction management. The interfaces allows for creation, commit and rollback of transactions.- Author:
- awoods, gregjan, mohideen
-
-
Field Summary
-
Fields inherited from class org.fcrepo.http.api.FedoraBaseResource
dbTransactionExecutor, identifierConverter, resourceFactory, resourceHelper, securityContext, servletRequest, txManager
-
Fields inherited from class org.fcrepo.http.commons.AbstractResource
defaultPidMinter, fedoraPropsConfig, headers, pidMinter, uriInfo, versionService
-
-
Constructor Summary
Constructors Constructor Description Transactions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
commit(String txId)
Commit a transaction resourcejavax.ws.rs.core.Response
createTransaction()
Create a new transaction resource and add it to the registryjavax.ws.rs.core.Response
getTransactionStatus(String txId)
Get the status of an existing transactionjavax.ws.rs.core.Response
refreshTransaction(String txId)
Refresh an existing transactionjavax.ws.rs.core.Response
rollback(String txId)
Rollback a transaction-
Methods inherited from class org.fcrepo.http.api.FedoraBaseResource
doesResourceExist, doInDbTx, doInDbTxWithRetry, getFedoraResource, getUserPrincipal, identifierConverter, isGhostNode, transaction
-
-
-
-
Constructor Detail
-
Transactions
public Transactions()
-
-
Method Detail
-
getTransactionStatus
@GET @Path("{transactionId}") public javax.ws.rs.core.Response getTransactionStatus(@PathParam("transactionId") String txId)
Get the status of an existing transaction- Parameters:
txId
- id of the transaction- Returns:
- 204 no content if status retrieved, 410 gone if transaction doesn't exist.
-
refreshTransaction
@POST @Path("{transactionId}") public javax.ws.rs.core.Response refreshTransaction(@PathParam("transactionId") String txId)
Refresh an existing transaction- Parameters:
txId
- id of the transaction- Returns:
- 204 no content if successfully refreshed, 410 gone if transaction doesn't exist.
-
createTransaction
@POST public javax.ws.rs.core.Response createTransaction() throws URISyntaxException
Create a new transaction resource and add it to the registry- Returns:
- 201 with the transaction id and expiration date
- Throws:
URISyntaxException
- if URI syntax exception occurred
-
commit
@PUT @Path("{transactionId}") public javax.ws.rs.core.Response commit(@PathParam("transactionId") String txId)
Commit a transaction resource- Parameters:
txId
- the transaction id- Returns:
- 204
-
-