Package net.sf.eBusx.io
Class EFileNotification
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject
-
- net.sf.eBus.messages.EMessage
-
- net.sf.eBus.messages.ENotificationMessage
-
- net.sf.eBusx.io.EFileNotification
-
- All Implemented Interfaces:
java.io.Serializable
@ELocalOnly public final class EFileNotification extends ENotificationMessage implements java.io.Serializable
Used to transmit a JavaWatchEvent
asynchronously to all interested listeners. The message subject is the file or directory path. The message contains the how the file changed (created, modified, or deleted), the file modification timestamp (in Java millisecond epoch time), and the file length in byte.- Author:
- Charles Rapp
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EFileNotification.Builder
static class
EFileNotification.EventType
The watched file was either created, modified, or deleted.-
Nested classes/interfaces inherited from class net.sf.eBus.messages.EMessage
EMessage.MessageType
-
-
Field Summary
Fields Modifier and Type Field Description EFileNotification.EventType
eventType
This notification signifies that either the file or directory was created, modified, or deleted.java.io.File
file
The notification applies to this file instance.long
lastModified
The date and time when thefile
was last modified.long
length
file
length in bytes.-
Fields inherited from class net.sf.eBus.messages.ENotificationMessage
NO_PUB_ID, position, publisherId
-
Fields inherited from class net.sf.eBus.messages.EMessage
MAX_SUBJECT_LENGTH, subject, timestamp
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EFileNotification.Builder
builder()
Returns anEFileNotification
message builder.java.lang.String
toString()
Returns notification message publisher ID and position as a string.-
Methods inherited from class net.sf.eBus.messages.ENotificationMessage
equals, hashCode
-
Methods inherited from class net.sf.eBus.messages.EMessage
isApplicationMessage, isSystemMessage, key, messageType, timestampAsInstant
-
-
-
-
Field Detail
-
file
public final java.io.File file
The notification applies to this file instance.
-
eventType
public final EFileNotification.EventType eventType
This notification signifies that either the file or directory was created, modified, or deleted.
-
lastModified
public final long lastModified
The date and time when thefile
was last modified. Will be zero ifeventType
isEFileNotification.EventType.DELETE
.
-
length
public final long length
-
-
Method Detail
-
toString
public java.lang.String toString()
Description copied from class:ENotificationMessage
Returns notification message publisher ID and position as a string.- Overrides:
toString
in classENotificationMessage
- Returns:
- notification message publisher ID and position as a string.
-
builder
public static EFileNotification.Builder builder()
Returns anEFileNotification
message builder.- Returns:
- message builder.
-
-