public class ProvenanceRecorder extends Attribute implements ExecutionListener, ChangeListener, IOPortEventListener, ActorFiringListener, DebugListener, ValueListener, SshEventListener, Initializable, WorkflowRenameListener, TagEventListener
Recording
implementation.Recording
NamedObj.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
StringParameter |
containerWorkflowLSID
The LSID of the containing workflow.
|
StringParameter |
containerWorkflowName
The name of the containing workflow.
|
static java.lang.String |
DEFAULT_REC_TYPE_IGNORE
String used when disabling provenance recording
|
Parameter |
delayRecordingSpecification
If true, delay recording specification as long as possible.
|
StringParameter |
hostname
Local hostname.
|
StringParameter |
recordingType
Which Recording to use.
|
Parameter |
recordTokens
Record token values.
|
StringParameter |
username
Username.
|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
Constructor and Description |
---|
ProvenanceRecorder()
Construct a provenance recorder in the default workspace using the
TOP Recorder Name specified in the configuration file.
|
ProvenanceRecorder(CompositeEntity container)
Construct a provenance recorder using the specified container.
|
ProvenanceRecorder(CompositeEntity container,
java.lang.String name)
Construct a provenance recorder in the given container with the
given name.
|
ProvenanceRecorder(ConfigurationProperty configProperty)
Construct a provenance recorder in the default workspace using
non-default ConfigurationProperty.
|
ProvenanceRecorder(Workspace workspace)
Construct a provenance recorder in the workspace with an empty name.
|
Modifier and Type | Method and Description |
---|---|
void |
addEnabledListener(ProvenanceEnabledListener listener)
Add a ProvenanceEnabledListener to be notified when provenance
is enabled/disabled.
|
void |
addInitializable(Initializable initializable)
Add the specified object to the list of objects whose
preinitialize(), intialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
void |
addPiggyback(Recording recording)
Add the specified recording to the list of recordings notified
for each provenance event.
|
static void |
addPiggybackForFuture(Recording recording)
Add the specified recording to the list of recordings that receive
provenance events from all ProvenanceRecorders created in the
future.
|
static boolean |
addProvenanceRecorder(CompositeActor container,
ProvenanceEnabledListener listener,
Effigy effigy)
Add the default provenance recorder to a container if it does not
already contain a provenance recorder.
|
void |
addRecordingType(java.lang.String typeName,
java.lang.String typeImpl)
Add a recording type.
|
void |
attributeChanged(Attribute attribute)
React to attribute change (of ProvenanceRecorder only).
|
void |
changeExecuted(ChangeRequest change)
React to a change request has been successfully executed.
|
void |
changeFailed(ChangeRequest change,
java.lang.Exception exception)
React to a change request has resulted in an exception.
|
boolean |
checkForSupportedDirector()
Check if the director is supported.
|
java.lang.Object |
clone(Workspace workspace)
Clone the ProvenanceRecorder into a specified workspace.
|
static boolean |
containsSupportedDirector(CompositeActor composite)
Returns true if the composite actor contains a director supported
by the provenance recorder or no director.
|
void |
disconnect()
Perform cleanup.
|
static void |
disconnectAll()
Perform cleanup for all ProvenanceRecorder instances.
|
void |
event(DebugEvent event)
React to a generic debug event.
|
void |
executionError(Manager manager,
java.lang.Throwable throwable)
Report an execution failure.
|
void |
executionFinished(Manager manager)
Report that the current execution has finished and the wrapup
sequence has completed normally.
|
void |
executionImported(KeplerLSID execLSID)
Report that an execution has been imported
|
void |
firingEvent(FiringEvent event)
React to an actor firing.
|
static ProvenanceRecorder |
getDefaultProvenanceRecorder(NamedObj namedObj)
Get the provenance recorder with for a NamedObj.
|
static Queryable |
getDefaultQueryable(NamedObj namedObj)
Get a queryable from the default provenance recorder for a NamedObj.
|
static java.util.Map<java.lang.String,java.lang.String> |
getDefaultsMap()
Return a Map of the default settings.
|
KeplerLSID |
getExecutionLSID()
Get the execution LSID.
|
static java.util.List<Recording> |
getFuturisticPiggybacks(Recording recording)
Return list of recordings that receive provenance events from all
ProvenanceRecorders created in the future.
|
Recording |
getRecording()
Get the current recording.
|
RecordingParameters |
getRecordingParameters()
Get current RecordingParameters.
|
java.util.Map<java.lang.String,java.lang.String> |
getSettingsMap()
Return a Map of the settings, returns default settings if necessary
|
void |
initialize()
Invoke the initialize methods and check for additional
MultiInstanceComposite actors created after preinitialize().
|
boolean |
isEnabled()
Return true if provenance output is turned on.
|
void |
loadRecordingTypes()
Load the default recording types.
|
void |
loadRecordingTypes(java.io.File file)
Load the recording types from a specific file.
|
void |
managerStateChanged(Manager manager)
Report that the manager has changed state.
|
void |
portEvent(IOPortEvent event)
React to a port read or write.
|
void |
preinitialize()
This function is called when the manager is about to run the model
and allows us to register with the manager before the run happens.
|
void |
removeEnabledListener(ProvenanceEnabledListener listener)
Remove a ProvenanceEnabledListener from the set of listeners.
|
void |
removeInitializable(Initializable initializable)
Remove the specified object from the list of objects whose
preinitialize(), intialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
void |
removePiggyback(Recording recording)
Remove the specified recording from the list of recordings
notified for each provenance event.
|
static void |
removePiggybackForFuture(Recording recording)
Remove the specified recording from the list of recordings that
receive provenance events from all ProvenanceRecorders created
in the future.
|
void |
removeRecordingType(java.lang.String typeName)
Remove a recording type.
|
void |
removeStateSerializer()
Remove the state serializer.
|
void |
renamedWorkflow(NamedObj namedObj,
KeplerLSID oldLSID,
KeplerLSID newLSID,
java.lang.String oldName,
java.lang.String newName)
A workflow was renamed.
|
void |
saveRecordingTypes(java.lang.String file,
java.lang.String header)
Save the recording types to a specific properties file.
|
void |
setContainer(NamedObj container)
Change the container.
|
void |
setDebugWriter(java.io.Writer writer)
Set a writer for debugging output.
|
void |
setPersistentParameters(boolean persistent)
Set the persistence of parameters.
|
void |
setStateSerializer(StateSerializer serializer)
Set the state serializer for recordings.
|
void |
sshEvent(SshEvent event)
React to an ssh event.
|
void |
tagAdded(TagEvent event) |
void |
tagRemoved(TagEvent event) |
void |
valueChanged(Settable settable)
React to a change in parameter value.
|
void |
wrapup()
Perform clean up.
|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
message
public Parameter delayRecordingSpecification
public StringParameter recordingType
public Parameter recordTokens
public StringParameter hostname
public StringParameter username
public static final java.lang.String DEFAULT_REC_TYPE_IGNORE
public StringParameter containerWorkflowLSID
public StringParameter containerWorkflowName
public ProvenanceRecorder() throws IllegalActionException, NameDuplicationException
public ProvenanceRecorder(ConfigurationProperty configProperty) throws IllegalActionException, NameDuplicationException
configProperty
- IllegalActionException
NameDuplicationException
public ProvenanceRecorder(CompositeEntity container) throws IllegalActionException, NameDuplicationException
container
- the container of the provenance recorder.IllegalActionException
NameDuplicationException
public ProvenanceRecorder(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace for this object.IllegalActionException
NameDuplicationException
public ProvenanceRecorder(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the director.name
- Name of this listener.IllegalActionException
- If the listener is not compatible
with the specified container. May be thrown in a derived class.NameDuplicationException
- If the container is not a
CompositeActor and the name collides with an entity in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the function is not recognized.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class Attribute
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown in this base classNamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
setContainer
in class Attribute
container
- The container to attach this attribute to..IllegalActionException
- If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and container are not in the same workspace, or
the proposed container would result in recursive containment.NameDuplicationException
- If the container already has
an attribute with the name of this attribute.Attribute.getContainer()
public void disconnect() throws IllegalActionException
IllegalActionException
public static void disconnectAll() throws IllegalActionException
IllegalActionException
public boolean isEnabled() throws IllegalActionException
IllegalActionException
public void addEnabledListener(ProvenanceEnabledListener listener)
public void removeEnabledListener(ProvenanceEnabledListener listener)
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
IllegalActionException
- If initializing is not permitted.public void initialize() throws IllegalActionException
initialize
in interface Initializable
IllegalActionException
- If one of the added objects
throws it.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
IllegalActionException
- If wrapup is not permitted.public void addInitializable(Initializable initializable)
addInitializable
in interface Initializable
initializable
- The object whose methods should be invoked.removeInitializable(Initializable)
,
CompositeActor.addPiggyback(Executable)
public void removeInitializable(Initializable initializable)
removeInitializable
in interface Initializable
initializable
- The object whose methods should no longer be
invoked.addInitializable(Initializable)
,
CompositeActor.removePiggyback(Executable)
public void changeExecuted(ChangeRequest change)
changeExecuted
in interface ChangeListener
change
- The change that has been executed, or null if
the change was not done via a ChangeRequest.public void changeFailed(ChangeRequest change, java.lang.Exception exception)
changeFailed
in interface ChangeListener
change
- The change that was attempted or null if
the change was not done via a ChangeRequest.exception
- The exception that resulted.public void executionError(Manager manager, java.lang.Throwable throwable)
executionError
in interface ExecutionListener
manager
- The manager controlling the execution.throwable
- The throwable to report.public void executionFinished(Manager manager)
executionFinished
in interface ExecutionListener
manager
- The manager controlling the execution.public void executionImported(KeplerLSID execLSID)
public void managerStateChanged(Manager manager)
managerStateChanged
in interface ExecutionListener
manager
- The manager controlling the execution.Manager.getState()
public void portEvent(IOPortEvent event) throws IllegalActionException
portEvent
in interface IOPortEventListener
event
- The event representing the token(s).IllegalActionException
- If thrown by the implementation.public void firingEvent(FiringEvent event)
firingEvent
in interface ActorFiringListener
event
- The event representing the token(s) sent.public void event(DebugEvent event)
event
in interface DebugListener
event
in class NamedObj
event
- The event.public void addRecordingType(java.lang.String typeName, java.lang.String typeImpl) throws IllegalActionException
IllegalActionException
public void removeRecordingType(java.lang.String typeName) throws IllegalActionException
IllegalActionException
public void loadRecordingTypes() throws IllegalActionException
IllegalActionException
public void loadRecordingTypes(java.io.File file) throws IllegalActionException
IllegalActionException
public void saveRecordingTypes(java.lang.String file, java.lang.String header) throws IllegalActionException
file
- the properties file path.header
- optional header for properties file.IllegalActionException
public void valueChanged(Settable settable)
valueChanged
in interface ValueListener
settable
- The object that has changed value.public void sshEvent(SshEvent event)
sshEvent
in interface SshEventListener
event
- The event to report.public void renamedWorkflow(NamedObj namedObj, KeplerLSID oldLSID, KeplerLSID newLSID, java.lang.String oldName, java.lang.String newName)
renamedWorkflow
in interface WorkflowRenameListener
namedObj
- the workflowoldLSID
- the previous LSIDnewLSID
- the new LSIDoldName
- the previous namenewName
- the new nameWorkflowRenameListener
public void tagAdded(TagEvent event)
tagAdded
in interface TagEventListener
public void tagRemoved(TagEvent event)
tagRemoved
in interface TagEventListener
public void setDebugWriter(java.io.Writer writer)
public static ProvenanceRecorder getDefaultProvenanceRecorder(NamedObj namedObj)
public static Queryable getDefaultQueryable(NamedObj namedObj) throws QueryException, RecordingException
QueryException
RecordingException
public RecordingParameters getRecordingParameters()
public Recording getRecording()
public void setPersistentParameters(boolean persistent)
public void addPiggyback(Recording recording)
recording
- the Recording to be notifiedpublic void removePiggyback(Recording recording)
recording
- the Recording to removeaddPiggyback(org.kepler.provenance.Recording)
public static void addPiggybackForFuture(Recording recording)
recording
- the Recording to be notifiedpublic static void removePiggybackForFuture(Recording recording)
recording
- the Recording to removeaddPiggybackForFuture(org.kepler.provenance.Recording)
public static java.util.List<Recording> getFuturisticPiggybacks(Recording recording)
recording
- public static boolean containsSupportedDirector(CompositeActor composite)
public boolean checkForSupportedDirector() throws IllegalActionException
IllegalActionException
public KeplerLSID getExecutionLSID()
public static boolean addProvenanceRecorder(CompositeActor container, ProvenanceEnabledListener listener, Effigy effigy) throws IllegalActionException, NameDuplicationException
container
- The container in which to add the default provenance
recorder.listener
- Register this object to listen for provenance enabled
events. This parameter can be null.effigy
- The effigy displaying the container. This parameter can
be null.IllegalActionException
NameDuplicationException
public void setStateSerializer(StateSerializer serializer)
public void removeStateSerializer()
public java.util.Map<java.lang.String,java.lang.String> getSettingsMap()
public static java.util.Map<java.lang.String,java.lang.String> getDefaultsMap()