public final class FileEvent extends com.streamscape.sdo.event.AbstractMutableEvent implements EventDatagram
Title: Structured Data Objects: File Event
Description: An object that represents a File State Object Event.
This event holds information corresponding to a specific file, it state and possible actions.
It contains file properties and information corresponding to fields of the FileMetaInfo
object.
The file event is used by fiel triggers
and the Event File System Daemon
service to convey state changes in file tracking.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
SEMANTIC_TYPE_NAME
DEFAULT_SERIAL_VERSION_ID
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(java.lang.String propertyName,
java.lang.String sdrPath)
Annotates (exports the value) of a specified data field in the class denoted by the
Semantic Type . |
boolean |
equals(java.lang.Object other) |
java.lang.String |
getAbsoluteFileName()
Returns the absolute file name.
|
FileEventType |
getEventType()
Returns a type of file event.
|
byte[] |
getFileData()
Returns the binary data of the file.
|
java.lang.String |
getFileExtension()
Returns the extension of the file name.
|
java.lang.String |
getFileType()
Returns the type of the file.
|
long |
getLastModifiedTime()
Returns the time of the last modification.
|
FileState |
getLastState()
Returns the last known status of the file.
|
java.lang.String |
getName()
Returns the name of the file.
|
java.lang.String |
getPath()
Returns the absolute path to the file.
|
java.lang.String |
getRelativeFileName()
Returns the relative name.
|
long |
getSize()
Returns the size of the file.
|
long |
getSizeDelta()
Returns the size of the file delta.
|
void |
init(java.io.File file,
FileState state)
Initializes the event object.
|
void |
init(FileMetaInfo fileState)
Initializes the event object.
|
void |
setFileData(byte[] fileData)
Sets the data of the file.
|
void |
setFileType(java.lang.String type)
Sets the type of the file.
|
void |
setLastModifiedTime(java.util.Date ts)
Sets the last modified time.
|
void |
setLastState(FileState state)
Sets the last known file state.
|
void |
setRelativeFileName(java.lang.String fileName)
Sets the file name as a relative name.
|
void |
setSize(long size)
Sets the file size.
|
void |
setSizeDelta(long delta)
Sets the delta size of the file.
|
clearEventProperties, protect, removeAnnotation, removeEventProperty, resetReplyTo, setCorrelationId, setCorrelationIdAsBytes, setDurable, setEventBigDecimalProperty, setEventBigDecimalProperty, setEventBooleanProperty, setEventByteProperty, setEventDoubleProperty, setEventExpiration, setEventFloatProperty, setEventGroupId, setEventIntProperty, setEventKey, setEventLongProperty, setEventObjectProperty, setEventShortProperty, setEventStringProperty, setFinal, setForwardTo, setReplyTo, setSecurityAssertionToken, setSecurityAssertionTokenAsBytes, unprotect
canConvertEventProperty, clone, existsEventProperty, getAnnotatedProperties, getAnnotation, getCorrelationId, getCorrelationIdAsBytes, getDurable, getEventBigDecimalProperty, getEventBooleanProperty, getEventByteProperty, getEventDoubleProperty, getEventExpiration, getEventFloatProperty, getEventGroupId, getEventId, getEventIntProperty, getEventKey, getEventLongProperty, getEventObjectProperty, getEventPropertyNames, getEventPropertyType, getEventShortProperty, getEventSource, getEventStringProperty, getForwardTo, getPermissions, getReadAccess, getReplyTo, getSecurityAssertionToken, getSecurityAssertionTokenAsBytes, getTimestamp, getTransmitAccess, getWriteAccess, hasAnnotatedProperties, hasSuitableAnnotationType, isProtected
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canConvertEventProperty, clearEventProperties, existsEventProperty, getAnnotatedProperties, getAnnotation, getCorrelationId, getCorrelationIdAsBytes, getEventBigDecimalProperty, getEventBooleanProperty, getEventByteProperty, getEventDoubleProperty, getEventExpiration, getEventFloatProperty, getEventIntProperty, getEventLongProperty, getEventObjectProperty, getEventPropertyNames, getEventPropertyType, getEventShortProperty, getEventStringProperty, getForwardTo, getPermissions, getReadAccess, getReplyTo, getSecurityAssertionToken, getSecurityAssertionTokenAsBytes, getTransmitAccess, getWriteAccess, hasAnnotatedProperties, isProtected, protect, removeAnnotation, removeEventProperty, resetReplyTo, setCorrelationId, setCorrelationIdAsBytes, setDurable, setEventBigDecimalProperty, setEventBigDecimalProperty, setEventBooleanProperty, setEventByteProperty, setEventDoubleProperty, setEventExpiration, setEventFloatProperty, setEventGroupId, setEventIntProperty, setEventKey, setEventLongProperty, setEventObjectProperty, setEventShortProperty, setEventStringProperty, setFinal, setForwardTo, setReplyTo, setSecurityAssertionToken, setSecurityAssertionTokenAsBytes, unprotect
clone, getDurable, getEventGroupId, getEventId, getEventKey, getEventSource, getTimestamp
getSerialVersionUID
public java.lang.String getPath() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public java.lang.String getName() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public java.lang.String getRelativeFileName() throws SecurityViolationException
FileMetaInfo
.SecurityViolationException
- if the event is protected from read access.public void setRelativeFileName(java.lang.String fileName) throws SecurityViolationException
FileMetaInfo
.fileName
- the relative name to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public long getLastModifiedTime() throws SecurityViolationException
FileMetaInfo
.SecurityViolationException
- if the event is protected from read access.public void setLastModifiedTime(java.util.Date ts) throws SecurityViolationException
FileMetaInfo
.ts
- the last modified time to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public long getSize() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public void setSize(long size) throws SecurityViolationException
FileMetaInfo
.size
- the size to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public FileState getLastState() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public void setLastState(FileState state) throws SecurityViolationException
FileMetaInfo
.state
- last state to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public java.lang.String getAbsoluteFileName() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public FileEventType getEventType() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public long getSizeDelta() throws SecurityViolationException
FileMetaInfo
.SecurityViolationException
- if the event is protected from read access.public void setSizeDelta(long delta) throws SecurityViolationException
FileMetaInfo
.delta
- the size of the file delta to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public java.lang.String getFileType() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public java.lang.String getFileExtension() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public void setFileType(java.lang.String type) throws SecurityViolationException
type
- the file type to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public byte[] getFileData() throws SecurityViolationException
SecurityViolationException
- if the event is protected from read access.public void setFileData(byte[] fileData) throws SecurityViolationException
fileData
- the file data to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void init(FileMetaInfo fileState) throws SecurityViolationException
fileState
- the file state to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.public void init(java.io.File file, FileState state) throws SecurityViolationException, SDOException
file
- the file to be set.state
- the file state to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SecurityViolationException
- if the event is protected from write access.SDOException
- if initialization failed.public void addAnnotation(java.lang.String propertyName, java.lang.String sdrPath) throws SecurityViolationException, SDOException
EventDatagram
Semantic Type
. In EventGram parlance an annotated datagram is an object
that contains additional information in it's header that refers (or is a subset of) the
datagram's payload. It is expected that the payload object referenced by Semantic Type
is part of the object's data structure prior to invocation of this method.
Annotated properties are populated with values derived from field elements of the data class.
The event source factory uses Java reflection to inspect the class and extract the specified
field elements prior to transmitting the event. This allows EventGrams to produce
secured content and still route and filter the datagrams by annotated content. The annotated
classes must be part of the Structured Data Object
definition.
If this event datagram has been created from a prototype (by method DatagramFactory.createEvent(String)
),
adding of new properties is not allowed. An exception will be thrown if the specified property does not exist.
Adding of new properties is allowed for uninitialized event datagram intended for a prototype creation
(such datagram can be created by methods like DatagramFactory.newEventInstance(String)
or
DatagramFactory.newEventInstanceFrom(String)
).
Event models supporting annotations are the following:
AuditEvent
//data
or //severity
.DataEvent
//data
or //data/<data_fields>
.
DeltaEvent
//beforeImage
or //beforeImage/<image_fields>
or
//afterImage
or //afterImage/<image_fields>
.
ExceptionEvent
//errorMessage
or //errorCode
or //severity
.
MapEvent
//map[<index>]
or //map[key='<key>']
or
//map[value='<value>']
.
String
value and
so the type of annotated property will always be String
.
RowArrayEvent
//row[<primary_key_value>]/<column_name>
or
//row[<primary_key_value>]/column[<column_index>]
.
<primary_key_value>;
is the value of the primary key column in the desired
row for annotation.
RowChangeEvent
//rowBefore/<column_name>
or //rowBefore/column[<column_index>]
or //rowAfter/<column_name>
or //rowAfter/column[<column_index>]
.
RowEvent
//row/<column_name>
or //row/column[<column_index>]
.
RowSetEvent
//row[<row_index>]/<column_name>
or
//row[<row_index>]/column[<column_index>]
.
StreamStateEvent
//streamState
or //stateMessage
or //streamPosition
.
TextEvent
//data/text
.
XMLEvent
<test attr="val"> <inside>Test1</inside> <inside>Test2</inside> </test>An annotation with path
//test/inside[2]
makes an event property with String
value equal to Test2
.
//test
makes an event property with String
value equal to
<inside>Test1</inside><inside>Test2</inside>
.
XMPPEvent
//body
.
addAnnotation
in interface EventDatagram
addAnnotation
in class com.streamscape.sdo.event.AbstractMutableEvent
propertyName
- the name of the property to be added.sdrPath
- the path to the data field to be annotated.SecurityViolationException
- if the event is write-protected.SDOException
- if the event does not support annotation or
if the specified property does not exist and this event has been created from a prototype or
if some internal error occurs.public boolean equals(java.lang.Object other)
equals
in class com.streamscape.sdo.IAbstractDataEvent
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.