Class LockFileEventImpl
- java.lang.Object
-
- de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
-
- de.aristaflow.adept2.core.eventmanager.fileevents.FileEventImpl
-
- de.aristaflow.adept2.core.eventmanager.fileevents.LockFileEventImpl
-
- All Implemented Interfaces:
Event
,FileEvent
,LockFileEvent
public class LockFileEventImpl extends FileEventImpl implements LockFileEvent
An event for files and their lock files, that is, an event is produced and sent as soon as a file (or a directory) is created or stored in a specific folder.
This event source terminates as soon as an event has been handled. However, since it polls, one has to ensure that a handled file is deleted or moved to another folder. Otherwise the source will create another event for the file.- Author:
- Ulrich Kreher, Marco Waimer
-
-
Field Summary
Fields Modifier and Type Field Description protected BasicFileAttributes
lockAttributes
The file attributes of the path of the lock file.protected Path
lockPath
The path of the lock file for which the event has been created.-
Fields inherited from class de.aristaflow.adept2.core.eventmanager.fileevents.FileEventImpl
attributes, path
-
Fields inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
creationTime, eventType, id, ID_COUNT, managerURI, sourceID, sourceType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasicFileAttributes
getLockFileAttributes()
Gets the basic file attributes of the lock file of this event.Path
getLockPath()
Gets the path of the lock file of this event.-
Methods inherited from class de.aristaflow.adept2.core.eventmanager.fileevents.FileEventImpl
getFileAttributes, getPath, getUdtValue
-
Methods inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.aristaflow.adept2.model.events.Event
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceType
-
Methods inherited from interface de.aristaflow.adept2.model.events.FileEvent
getFileAttributes, getPath
-
-
-
-
Field Detail
-
lockPath
protected final Path lockPath
The path of the lock file for which the event has been created.
-
lockAttributes
protected final BasicFileAttributes lockAttributes
The file attributes of the path of the lock file.
-
-
Constructor Detail
-
LockFileEventImpl
public LockFileEventImpl(URI[] managerURI, String eventType, String sourceType, String sourceID, Path path, Path lockPath) throws IOException
Creates a new event for the designated file.- Parameters:
managerURI
- The URIs of the service (event manager) creating the event.eventType
- The type of the event.sourceType
- The type of the source of this event.sourceID
- The ID of the source of this event.path
- The path for which the event has been created.lockPath
- The path of the lock file for which the event has been created.- Throws:
IOException
- If retrieving the basic file attributes of the designated path fails, anIOException
will be thrown.
-
-
Method Detail
-
getLockPath
public Path getLockPath()
Description copied from interface:LockFileEvent
Gets the path of the lock file of this event.- Specified by:
getLockPath
in interfaceLockFileEvent
- Returns:
- The path of the lock file of this event.
-
getLockFileAttributes
public BasicFileAttributes getLockFileAttributes()
Description copied from interface:LockFileEvent
Gets the basic file attributes of the lock file of this event.- Specified by:
getLockFileAttributes
in interfaceLockFileEvent
- Returns:
- The basic file attributes of the path of the lock file of this event.
-
-