public class RunDatabase extends Object implements RunStore, RunDBSupport
Constructor and Description |
---|
RunDatabase() |
Modifier and Type | Method and Description |
---|---|
void |
checkForFinishNow()
Scan each run to see if it has finished yet and issue registered
notifications if it has.
|
void |
cleanNow()
Remove currently-expired runs from this database.
|
int |
countRuns()
How many runs are stored in the database.
|
void |
flushToDisk(RemoteRunDelegate run)
Ensure that a run gets persisted in the database.
|
FactoryBean |
getFactory() |
TavernaRun |
getRun(String uuid)
Obtain the named workflow run.
|
TavernaRun |
getRun(UsernamePrincipal user,
Policy p,
String uuid)
Obtain the workflow run for a given user and name.
|
List<String> |
listRunNames()
Get a list of all the run names.
|
Map<String,TavernaRun> |
listRuns(UsernamePrincipal user,
Policy p)
List the runs that a particular user may access.
|
RemoteRunDelegate |
pickArbitraryRun()
Select an arbitrary representative run.
|
String |
registerRun(TavernaRun run)
Adds a workflow instance run to the store.
|
void |
setDao(RunDatabaseDAO dao) |
void |
setNotificationEngine(NotificationEngine notificationEngine) |
void |
setNotifier(CompletionNotifier n) |
void |
setTypeNotifiers(List<CompletionNotifier> notifiers) |
void |
unregisterRun(String uuid)
Removes a run from the store.
|
public void setNotifier(CompletionNotifier n)
setNotifier
in interface RunDBSupport
n
- A reference to the bean that creates messages about workflow
run termination.public void setTypeNotifiers(List<CompletionNotifier> notifiers)
public void setNotificationEngine(NotificationEngine notificationEngine)
setNotificationEngine
in interface RunDBSupport
notificationEngine
- A reference to the notification fabric bean.public void setDao(RunDatabaseDAO dao)
public void checkForFinishNow()
RunDBSupport
checkForFinishNow
in interface RunDBSupport
public void cleanNow()
RunDBSupport
cleanNow
in interface RunDBSupport
public int countRuns()
RunDBSupport
countRuns
in interface RunDBSupport
public void flushToDisk(RemoteRunDelegate run)
RunDBSupport
flushToDisk
in interface RunDBSupport
run
- The run to persist.public RemoteRunDelegate pickArbitraryRun() throws Exception
RunDBSupport
pickArbitraryRun
in interface RunDBSupport
Exception
- If anything goes wrong.public List<String> listRunNames()
RunDBSupport
listRunNames
in interface RunDBSupport
public TavernaRun getRun(UsernamePrincipal user, Policy p, String uuid) throws UnknownRunException
RunStore
getRun
in interface RunStore
user
- Who wants to do the lookup.p
- The general policy system context.uuid
- The handle for the run.UnknownRunException
- If the lookup fails (either because it does not exist or
because it is not permitted for the user by the policy).public TavernaRun getRun(String uuid) throws UnknownRunException
RunStore
getRun
in interface RunStore
uuid
- The handle for the run.UnknownRunException
- If the lookup fails (either because it does not exist or
because it is not permitted for the user by the policy).public Map<String,TavernaRun> listRuns(UsernamePrincipal user, Policy p)
RunStore
public String registerRun(TavernaRun run)
RunStore
registerRun
in interface RunStore
run
- The run itself.public void unregisterRun(String uuid)
RunStore
unregisterRun
in interface RunStore
uuid
- The name of the run.public FactoryBean getFactory()
getFactory
in interface RunDBSupport
Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.