@Component public class BatchServiceImpl extends AbstractService implements BatchService
FedoraSession
service which is able to
create/commit/rollback FedoraSession
objects. A Scheduled
annotation is used for removing timed out operationsModifier and Type | Field and Description |
---|---|
static long |
REAP_INTERVAL |
Constructor and Description |
---|
BatchServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
abort(String sessionId,
String username)
Roll back any uncommited changes during a
FedoraSession |
void |
begin(FedoraSession session,
String username)
Create a new batch operation with a FedoraSession and add it to the currently open ones
|
void |
commit(String sessionId,
String username)
Commit any changes during a
FedoraSession with the given id and username |
boolean |
exists(String sessionId,
String username)
Check if a FedoraSession exists for a particular user
|
FedoraSession |
getSession(String sessionId,
String username)
Retrieve an open
FedoraSession for a given user |
void |
refresh(String sessionId,
String username)
Refresh an existing session using an implementation-defined default
|
void |
removeExpired()
Every REAP_INTERVAL milliseconds, check for expired sessions.
|
exists, findNode, findOrCreateNode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, begin, commit, exists, getSession
public static final long REAP_INTERVAL
public BatchServiceImpl()
@Scheduled(fixedRate=1000L) public void removeExpired()
removeExpired
in interface BatchService
public void begin(FedoraSession session, String username)
BatchService
begin
in interface BatchService
session
- The session to use for this batch operationusername
- the name of the Principal
public FedoraSession getSession(String sessionId, String username)
BatchService
FedoraSession
for a given usergetSession
in interface BatchService
sessionId
- the Id of the FedoraSession
username
- the name of the Principal
FedoraSession
with this userpublic boolean exists(String sessionId, String username)
BatchService
exists
in interface BatchService
sessionId
- the Id of the FedoraSession
username
- the name of the Principal
FedoraSession
object for the defined userpublic void commit(String sessionId, String username)
BatchService
FedoraSession
with the given id and usernamecommit
in interface BatchService
sessionId
- the id of the FedoraSession
username
- the name of the Principal
public void refresh(String sessionId, String username)
BatchService
refresh
in interface BatchService
sessionId
- the Id of the FedoraSession
username
- the name of the Principal
public void abort(String sessionId, String username)
BatchService
FedoraSession
abort
in interface BatchService
sessionId
- the id of the FedoraSession
username
- the name of the Principal
Copyright © 2013–2018 DuraSpace, Inc.. All rights reserved.