public class RemoteRunDelegate extends Object implements TavernaRun
Constructor and Description |
---|
RemoteRunDelegate(Date creationInstant,
Workflow workflow,
RemoteSingleRun rsr,
int defaultLifetime,
RunDBSupport db,
UUID id,
boolean generateProvenance,
FactoryBean factory) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Listener listener)
Add a listener to the run.
|
void |
destroy()
Kill off this run, removing all resources which it consumes.
|
Date |
getCreationTimestamp() |
Set<String> |
getDestroyers() |
Date |
getExpiry() |
Date |
getFinishTimestamp() |
boolean |
getGenerateProvenance() |
String |
getId() |
String |
getInputBaclavaFile() |
List<Input> |
getInputs() |
List<Listener> |
getListeners() |
List<String> |
getListenerTypes()
Get the types of listener supported by this run.
|
String |
getName() |
String |
getOutputBaclavaFile() |
Set<String> |
getReaders() |
TavernaSecurityContext |
getSecurityContext() |
Date |
getStartTimestamp() |
Status |
getStatus() |
Workflow |
getWorkflow() |
Directory |
getWorkingDirectory() |
Set<String> |
getWriters() |
Input |
makeInput(String name)
Create an input assignment.
|
Listener |
makeListener(String type,
String config)
Attach a listener to a workflow run and return its local delegate.
|
void |
ping()
Test if this run is really there.
|
void |
setDestroyers(Set<String> destroyers) |
void |
setExpiry(Date d)
Set when this run will expire.
|
void |
setGenerateProvenance(boolean generateProvenance) |
void |
setInputBaclavaFile(String filename)
Sets the Baclava file to use for all inputs.
|
void |
setName(String name) |
void |
setOutputBaclavaFile(String filename)
Sets where the output of the run is to be written to.
|
void |
setReaders(Set<String> readers) |
void |
setSecurityContext(TavernaSecurityContext tavernaSecurityContext) |
String |
setStatus(Status s)
Set the status of the run, which should cause it to move into the given
state.
|
void |
setWriters(Set<String> writers) |
public RemoteRunDelegate(Date creationInstant, Workflow workflow, RemoteSingleRun rsr, int defaultLifetime, RunDBSupport db, UUID id, boolean generateProvenance, FactoryBean factory)
public List<String> getListenerTypes() throws RemoteException
RemoteException
- If anything goes wrong.public void addListener(Listener listener)
TavernaRun
addListener
in interface TavernaRun
listener
- The listener to add.public String getId()
getId
in interface TavernaRun
public Listener makeListener(String type, String config) throws NoListenerException
type
- The type of listener to create.config
- The configuration of the listener.NoListenerException
- If anything goes wrong.public void destroy()
TavernaRun
destroy
in interface TavernaRun
public Date getExpiry()
getExpiry
in interface TavernaRun
public List<Listener> getListeners()
getListeners
in interface TavernaRun
public TavernaSecurityContext getSecurityContext()
getSecurityContext
in interface TavernaRun
public Status getStatus()
getStatus
in interface TavernaRun
public Workflow getWorkflow()
getWorkflow
in interface TavernaRun
public Directory getWorkingDirectory() throws FilesystemAccessException
getWorkingDirectory
in interface TavernaRun
FilesystemAccessException
public void setExpiry(Date d)
TavernaRun
setExpiry
in interface TavernaRun
d
- Expiry time. Deletion will happen some time after that.public String setStatus(Status s) throws BadStateChangeException
TavernaRun
setStatus
in interface TavernaRun
s
- The state to try to change to.BadStateChangeException
- If the change to the given state is impossible.public String getInputBaclavaFile()
getInputBaclavaFile
in interface TavernaRun
public List<Input> getInputs()
getInputs
in interface TavernaRun
public String getOutputBaclavaFile()
getOutputBaclavaFile
in interface TavernaRun
public Input makeInput(String name) throws BadStateChangeException
TavernaRun
makeInput
in interface TavernaRun
name
- The name of the port that this will be an input for.BadStateChangeException
- If the workflow is not in the Initialized
state.public void setInputBaclavaFile(String filename) throws FilesystemAccessException, BadStateChangeException
TavernaRun
setInputBaclavaFile
in interface TavernaRun
filename
- The filename to use. Must not start with a / or
contain any .. segments. Will be interpreted relative
to the run's working directory.FilesystemAccessException
- If the filename is invalid.BadStateChangeException
- If the workflow is not in the Initialized
state.public void setOutputBaclavaFile(String filename) throws FilesystemAccessException, BadStateChangeException
TavernaRun
setOutputBaclavaFile
in interface TavernaRun
filename
- Where to write the Baclava file (or null to cause the
output to be written to individual files); overwrites any
previous setting of this value.FilesystemAccessException
- If the filename starts with a / or contains a
.. segment.BadStateChangeException
- If the workflow is not in the Initialized
state.public Date getCreationTimestamp()
getCreationTimestamp
in interface TavernaRun
public Date getFinishTimestamp()
getFinishTimestamp
in interface TavernaRun
public Date getStartTimestamp()
getStartTimestamp
in interface TavernaRun
public void setDestroyers(Set<String> destroyers)
destroyers
- the destroyers to setpublic boolean getGenerateProvenance()
getGenerateProvenance
in interface TavernaRun
public void setGenerateProvenance(boolean generateProvenance)
setGenerateProvenance
in interface TavernaRun
generateProvenance
- whether the run generates provenance datapublic void setSecurityContext(TavernaSecurityContext tavernaSecurityContext)
public String getName()
getName
in interface TavernaRun
public void setName(@Nonnull String name)
setName
in interface TavernaRun
name
- The new name of the run. May be truncated.public void ping() throws UnknownRunException
TavernaRun
Implementation note: Used to test communication fabrics, etc. so implementations of this interface that do not delegate to another object should do nothing.
ping
in interface TavernaRun
UnknownRunException
- If things fail.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.