public class SshDirectoryList extends TypedAtomicActor
Obsolete actor. Use SshDirectoryList-v1.1 instead.
Actor for directory listing.
This actor uses org.kepler.io.DirectoryListing class to get file listing
The initial input should be:
The actor takes the target and directory arguments only once! After that it works with that setting at each fire. The mask can be reset to something else for each firing but in such a case, the previous listings are deleted (as if starting fresh).
Depending on the boolean parameter 'newFilesOnly' there are two different
behavior:
If 'newFilesOnly' is set (default), for each trigger, the file list is
updated, and the array of 'new' files will be the output. 'New' means the
difference between the current and the previous listings.
If 'newFilesOnly' is not set, for each trigger, the whole list is returned.
This can be used for watching a specific file and look for changes in size or
access time of the file.
Depending on the boolean parameter 'checkSizeAndDate' the meaning 'new' is
handled as following:
If 'checkSizeAndDate' is set, modified files are also listed besides brand
new files. I.e., a new file is that is not found in previous listing OR the
size or date of the file has changed between the previous and current
listings.
If 'checkSizeAndDate' is not set (default), only brand new files are listed.
I.e. only the file names are checked, and file modifications have no effect.
The files are listed in the following format: Each element in the array will be a RecordToken: {name=String, size=long, date=long}, where the size is given in bytes, the date is given in UTC seconds. The resolution depends on the 'ls -l' output, i.e. at most a minute, and for old files a day. In the local case, it depends on the resolution of Java and the local OS, usually less than a millisecond.
On error, an empty string is returned.
Note: even if you pass a token to the mask port parameter, you must pass a token to the trigger port as well anyway.
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
checkSizeAndDate
Specifying whether the output should contain modified files as well, or
only brand new files.
|
PortParameter |
dir
The path to the directory to be read on the target machines.
|
PortParameter |
mask
The file mask for listing only such files.
|
TypedIOPort |
newFiles
The output: array of new files since the previous read.
|
Parameter |
newFilesOnly
Specifying whether the output should contain only new files or all.
|
PortParameter |
target
The machine to be used at job submission.
|
TypedIOPort |
trigger
The trigger port to do the reading.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
SshDirectoryList(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
void |
fire()
fire
|
void |
initialize()
initialize() runs once before first exec
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public PortParameter target
public PortParameter dir
public PortParameter mask
public TypedIOPort trigger
public Parameter newFilesOnly
public Parameter checkSizeAndDate
public TypedIOPort newFiles
public SshDirectoryList(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained by the proposed
container.NameDuplicationException
- If the container already has an actor with this name.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the parent class throws it.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException