Oracle Application Server Wireless Java API Reference
B14043-01


oracle.edge.common
Class Event

java.lang.Object
  extended byoracle.edge.common.Event


public class Event
extends java.lang.Object

This class represents an generic sensor event. <p/>


Field Summary
static int CONTAINER
Event subtype here refers to how event is generated from a moving tag.
static java.lang.String DEVICE_EVENTRECEIVING_FAILURE
Event type here refers to error occurance during the process of receiving any raw event.
static java.lang.String DEVICE_INIT_FAILURE
Event data here refers to error occurance during the process of initializing device.
static java.lang.String DEVICE_OPERATION
Event subtype here refers to error occurance during the process of initializing device.
static java.lang.String DEVICE_START_FAILURE
Event type here refers to error occurance during the process of starting device.
static java.lang.String DEVICE_STOP_FAILURE
Event type here refers to error occurance during the process of receiving any raw event.
static int DISPATCHER_FAILED
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online.
static int DISPATCHER_ONLINE
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher comes online.
static java.lang.String DISPATCHER_START
Event subtype here refers to error occurance during the process of initializing device.
static int EDGE_SERVER_SHUTDOWN
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online.
static int EDGE_SERVER_STARTUP
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online.
static int ERROR_CONFIRMATION
Event subtype here refers to an event to report a error confirmation.
static int ERROR_REPORT
Event subtype here refers to an event to report an error.
static java.lang.String FILTER_CHECKTAG_FAILURE
Event subtype here refers to the event generated within a check tag filter that fails to identify the specified tag.
static java.lang.String FILTER_MONITOR_EVENT_DIFF_COUNT
Event subtype here refers to the event generated within a check tag filter that fails to identify the specified tag.
static int FUNC_NOT_SUPPORT
Event subtype here refers to an event to report an unsupported function being called.
static int HUMIDITY
Event type here refers to humidity event.
static int INFIELD
Event subtype here refers to how event is generated from a moving tag.
static int INSTRUCTION
Event type for instructions
static int MESSAGE_EVENT
Event type here refers to observation event.
static int MULTIPLE_INFIELD
Event subtype here refers to how event is generated from a moving tag.
static int MULTIPLE_OUTOFFIELD
Event subtype here refers to how event is generated from a moving tag.
static int MULTIPLE_PASS
Event subtype here refers to how event is generated from a moving tag.
static int NOTIFICATION
Event subtype here refers to an event to notify some normal message.
static int OBSERVATION
Event type here refers to observation event.
static int OUTOFFIELD
Event subtype here refers to how event is generated from a moving tag.
static int PASS
Event subtype here refers to how event is generated from a moving tag.
static int PHYSICAL_CONTACT
Event type here refers to real time location event.
static int RTLS
Event type here refers to real time location event.
static int START
Event subtype for checking device status
static int START_DISPATCH
Event subtype here refers to an event to start a dispatch at edge server side.
static int STATUSCHECK
Event subtype for checking device status
static int STOP
Event subtype for checking device status
static int STOP_DISPATCH
Event subtype here refers to an event to stop a dispatch at edge server side.
static int SUCCESS_CONFIRMATION
Event subtype here refers to an event to report a error confirmation.
static int tcSize
Window size for each type category
static int TEMPERATURE
Event type here refers to temperature event.
static int tiInstruction
Type id for RFID observations
static int tiRFID
Type id for RFID observations
static int UNKNOWN
Event subtype here refers to how event is generated.
static int WEIGHT
Event type here refers to weight event.

Constructor Summary
Event()
Default constructor.
Event(EdgeEvent ev)
Used for conversion of EdgeEvent ADT type to an event.
Event(java.io.RandomAccessFile raf)
Used by the disk FIFO for queuing events.

Method Summary
boolean equals(Event ev)
This will do a field by field comparison between two events to see if they are equal.
java.lang.String[] getAssociatedData()
Get associated data.
java.lang.String[] getAssociatedTagIds()
Get associated tag ids.
int getBytesRead()
Returns the number of bytes read from the File to load this event.
java.lang.String getCorrelationId()
Get correlation id to support two-way communication between edge server and client through event object.
java.lang.String getData()
Get event data.
java.lang.String getDeviceName()
Get device name.
java.lang.String getSerialzedDataStr()
Get id string in serialized form.
java.lang.String getSerialzedIdStr()
Get id string in serialized form.
java.lang.String getSiteName()
Get site name.
java.lang.String getSourceName()
Get event name.
int getSubtype()
Get event type.
java.lang.String getTagId()
Get tag id.
java.util.Date getTime()
Get event time.
int getType()
Get event type.
static void main(java.lang.String[] args)
void output(java.io.PrintStream PW)
Outputs a human-readable form of this Event to a PrintStream.
static java.lang.String padString(java.lang.String topad)
static int pickle(Event ev, java.io.RandomAccessFile os)
Pickles (serializes) an Event to the given RandomAccessFile at the files current position
static int readInt(byte[] b, int offset)
Reads an int from a byte array, used during de-pickling
static long readLong(byte[] b, int offset)
Reads an long from a byte array, used during de-pickling
void removeAssociatedData(int Index)
Remove an associated data.
void removeAssociatedTagId(int Index)
Remove an associated tag id.
void setAssociatedData(java.lang.String[] Data)
Set associated data.
void setAssociatedTagIds(java.lang.String[] TagIds)
Set associated tag ids.
void setCorrelationId(java.lang.String correlationId)
Set correlation id to support two-way communication between edge server and client through event object.
void setData(java.lang.String Data)
Set event data.
void setDeviceName(java.lang.String DeviceName)
Set device name.
void setSiteName(java.lang.String SiteName)
Set site name.
void setSourceName(java.lang.String name)
Set event name.
void setSubtype(int EventSubtype)
Set event subtype.
void setTagId(java.lang.String TagId)
Set tag id.
void setTime(java.util.Date EventTime)
Set event time.
void setType(int EventType)
Set event type.
java.lang.String toString()
static int unpickle(Event ev, java.io.RandomAccessFile is)
Unpickles (deserializes) an Event object from a RandomAccessFile starting from the current position of the file
static void writeInt(byte[] b, int offset, int i)
Writes a int to a byte array at the given offset
static void writeLong(byte[] b, int offset, long l)
Writes a long to a byte array at the given offset
static void writeString(byte[] b, byte[] s, int offset)
Writes a string to a byte array at the given offset

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

CONTAINER

public static final int CONTAINER
Event subtype here refers to how event is generated from a moving tag. <br/> This is container event. <p/>
See Also:
Constant Field Values

DEVICE_EVENTRECEIVING_FAILURE

public static final java.lang.String DEVICE_EVENTRECEIVING_FAILURE
Event type here refers to error occurance during the process of receiving any raw event. <br/> <p/>
See Also:
Constant Field Values

DEVICE_INIT_FAILURE

public static final java.lang.String DEVICE_INIT_FAILURE
Event data here refers to error occurance during the process of initializing device. <br/> <p/>
See Also:
Constant Field Values

DEVICE_OPERATION

public static final java.lang.String DEVICE_OPERATION
Event subtype here refers to error occurance during the process of initializing device. <br/> <p/>
See Also:
Constant Field Values

DEVICE_START_FAILURE

public static final java.lang.String DEVICE_START_FAILURE
Event type here refers to error occurance during the process of starting device. <br/> <p/>
See Also:
Constant Field Values

DEVICE_STOP_FAILURE

public static final java.lang.String DEVICE_STOP_FAILURE
Event type here refers to error occurance during the process of receiving any raw event. <br/> <p/>
See Also:
Constant Field Values

DISPATCHER_FAILED

public static final int DISPATCHER_FAILED
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online. <p/>
See Also:
Constant Field Values

DISPATCHER_ONLINE

public static final int DISPATCHER_ONLINE
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher comes online. <p/>
See Also:
Constant Field Values

DISPATCHER_START

public static final java.lang.String DISPATCHER_START
Event subtype here refers to error occurance during the process of initializing device. <br/> <p/>
See Also:
Constant Field Values

EDGE_SERVER_SHUTDOWN

public static final int EDGE_SERVER_SHUTDOWN
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online. <p/>
See Also:
Constant Field Values

EDGE_SERVER_STARTUP

public static final int EDGE_SERVER_STARTUP
Event subtype here refers to an event pushed only by the EventDispatcher when a dispatcher fails after being online. <p/>
See Also:
Constant Field Values

ERROR_CONFIRMATION

public static final int ERROR_CONFIRMATION
Event subtype here refers to an event to report a error confirmation. <p/>
See Also:
Constant Field Values

ERROR_REPORT

public static final int ERROR_REPORT
Event subtype here refers to an event to report an error. <p/>
See Also:
Constant Field Values

FILTER_CHECKTAG_FAILURE

public static final java.lang.String FILTER_CHECKTAG_FAILURE
Event subtype here refers to the event generated within a check tag filter that fails to identify the specified tag. <br/> <p/>
See Also:
Constant Field Values

FILTER_MONITOR_EVENT_DIFF_COUNT

public static final java.lang.String FILTER_MONITOR_EVENT_DIFF_COUNT
Event subtype here refers to the event generated within a check tag filter that fails to identify the specified tag. <br/> <p/>
See Also:
Constant Field Values

FUNC_NOT_SUPPORT

public static final int FUNC_NOT_SUPPORT
Event subtype here refers to an event to report an unsupported function being called. <p/>
See Also:
Constant Field Values

HUMIDITY

public static final int HUMIDITY
Event type here refers to humidity event.
See Also:
Constant Field Values

INFIELD

public static final int INFIELD
Event subtype here refers to how event is generated from a moving tag. <br/> Tag appears and stays inside RF detection field. <p/>
See Also:
Constant Field Values

INSTRUCTION

public static final int INSTRUCTION
Event type for instructions
See Also:
Constant Field Values

MESSAGE_EVENT

public static final int MESSAGE_EVENT
Event type here refers to observation event.
See Also:
Constant Field Values

MULTIPLE_INFIELD

public static final int MULTIPLE_INFIELD
Event subtype here refers to how event is generated from a moving tag. <br/> Multiple associated tags that all appear and stay inside RF detection field. <p/>
See Also:
Constant Field Values

MULTIPLE_OUTOFFIELD

public static final int MULTIPLE_OUTOFFIELD
Event subtype here refers to how event is generated from a moving tag. <br/> Multiple associated tags that all leave away from RF detection field. <p/>
See Also:
Constant Field Values

MULTIPLE_PASS

public static final int MULTIPLE_PASS
Event subtype here refers to how event is generated from a moving tag. <br/> Multiple associated tags that all pass away from RF detection field. <p/>
See Also:
Constant Field Values

NOTIFICATION

public static final int NOTIFICATION
Event subtype here refers to an event to notify some normal message. <p/>
See Also:
Constant Field Values

OBSERVATION

public static final int OBSERVATION
Event type here refers to observation event.
See Also:
Constant Field Values

OUTOFFIELD

public static final int OUTOFFIELD
Event subtype here refers to how event is generated from a moving tag. <br/> Tag leaves away from RF detection field. <p/>
See Also:
Constant Field Values

PASS

public static final int PASS
Event subtype here refers to how event is generated from a moving tag. <br/> Tag passes through RF detection field. <p/>
See Also:
Constant Field Values

PHYSICAL_CONTACT

public static final int PHYSICAL_CONTACT
Event type here refers to real time location event.
See Also:
Constant Field Values

RTLS

public static final int RTLS
Event type here refers to real time location event.
See Also:
Constant Field Values

START

public static final int START
Event subtype for checking device status
See Also:
Constant Field Values

START_DISPATCH

public static final int START_DISPATCH
Event subtype here refers to an event to start a dispatch at edge server side. <p/>
See Also:
Constant Field Values

STATUSCHECK

public static final int STATUSCHECK
Event subtype for checking device status
See Also:
Constant Field Values

STOP

public static final int STOP
Event subtype for checking device status
See Also:
Constant Field Values

STOP_DISPATCH

public static final int STOP_DISPATCH
Event subtype here refers to an event to stop a dispatch at edge server side. <p/>
See Also:
Constant Field Values

SUCCESS_CONFIRMATION

public static final int SUCCESS_CONFIRMATION
Event subtype here refers to an event to report a error confirmation. <p/>
See Also:
Constant Field Values

tcSize

public static final int tcSize
Window size for each type category
See Also:
Constant Field Values

TEMPERATURE

public static final int TEMPERATURE
Event type here refers to temperature event.
See Also:
Constant Field Values

tiInstruction

public static final int tiInstruction
Type id for RFID observations
See Also:
Constant Field Values

tiRFID

public static final int tiRFID
Type id for RFID observations
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Event subtype here refers to how event is generated. <br/> Undetermined event type. <p/>
See Also:
Constant Field Values

WEIGHT

public static final int WEIGHT
Event type here refers to weight event.
See Also:
Constant Field Values

Constructor Detail

Event

public Event()
Default constructor. The date is automatically set to creation time.

Event

public Event(EdgeEvent ev)
      throws java.sql.SQLException
Used for conversion of EdgeEvent ADT type to an event.

Event

public Event(java.io.RandomAccessFile raf)
      throws java.io.IOException
Used by the disk FIFO for queuing events.
Parameters:
raf - The RandomAccessFile that contains the queue positioned at the front of the event
Throws:
java.io.IOException

Method Detail

equals

public boolean equals(Event ev)
This will do a field by field comparison between two events to see if they are equal.
Parameters:
ev - The Event object to compare this event against
Returns:
true if the events are equal, false otherwise

getAssociatedData

public java.lang.String[] getAssociatedData()
Get associated data. <p/>
Returns:
associated data

getAssociatedTagIds

public java.lang.String[] getAssociatedTagIds()
Get associated tag ids. <p/>
Returns:
associated tag ids

getBytesRead

public int getBytesRead()
Returns the number of bytes read from the File to load this event. <p/>
Returns:
Number of bytes read.

getCorrelationId

public java.lang.String getCorrelationId()
Get correlation id to support two-way communication between edge server and client through event object. <p/>
Returns:
correlation id

getData

public java.lang.String getData()
Get event data. <p/>
Returns:
event data

getDeviceName

public java.lang.String getDeviceName()
Get device name. <p/>
Returns:
device name

getSerialzedDataStr

public java.lang.String getSerialzedDataStr()
Get id string in serialized form.
Returns:
serialized id string

getSerialzedIdStr

public java.lang.String getSerialzedIdStr()
Get id string in serialized form.
Returns:
serialized id string

getSiteName

public java.lang.String getSiteName()
Get site name. <p/>
Returns:
site name

getSourceName

public java.lang.String getSourceName()
Get event name. <p/>
Returns:
event name

getSubtype

public int getSubtype()
Get event type. <p/>
Returns:
event type

getTagId

public java.lang.String getTagId()
Get tag id. <p/>
Returns:
tag id

getTime

public java.util.Date getTime()
Get event time. <p/>
Returns:
event time

getType

public int getType()
Get event type. <p/>
Returns:
event type

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

output

public void output(java.io.PrintStream PW)
Outputs a human-readable form of this Event to a PrintStream. <p/>
Parameters:
PW - The PrintStream to write to.

padString

public static java.lang.String padString(java.lang.String topad)

pickle

public static int pickle(Event ev,
                         java.io.RandomAccessFile os)
                  throws java.io.IOException
Pickles (serializes) an Event to the given RandomAccessFile at the files current position
Parameters:
ev - The Event object to pickle
os - The file to write to
Returns:
the number of bytes written to the file for this Event
Throws:
java.io.IOException

readInt

public static int readInt(byte[] b,
                          int offset)
Reads an int from a byte array, used during de-pickling
Parameters:
b - the byte array containing the int to read
offset - the offset from the beginning of the array from which to read the int
Returns:
the int read from the byte array

readLong

public static final long readLong(byte[] b,
                                  int offset)
Reads an long from a byte array, used during de-pickling
Parameters:
b - the byte array containing the long to read
offset - the offset from the beginning of the array from which to read the long
Returns:
the long read from the byte array

removeAssociatedData

public void removeAssociatedData(int Index)
Remove an associated data. <p/>
Parameters:
Index - associated data index

removeAssociatedTagId

public void removeAssociatedTagId(int Index)
Remove an associated tag id. <p/>
Parameters:
Index - associated tag id index

setAssociatedData

public void setAssociatedData(java.lang.String[] Data)
Set associated data. <p/>
Parameters:
Data - associated data

setAssociatedTagIds

public void setAssociatedTagIds(java.lang.String[] TagIds)
Set associated tag ids. <p/>
Parameters:
TagIds - associated tag ids

setCorrelationId

public void setCorrelationId(java.lang.String correlationId)
Set correlation id to support two-way communication between edge server and client through event object. <p/>
Parameters:
correlationId - correlation id

setData

public void setData(java.lang.String Data)
Set event data. <p/>
Parameters:
Data - event data

setDeviceName

public void setDeviceName(java.lang.String DeviceName)
Set device name. <p/>
Parameters:
DeviceName - device name

setSiteName

public void setSiteName(java.lang.String SiteName)
Set site name. <p/>
Parameters:
SiteName - site name

setSourceName

public void setSourceName(java.lang.String name)
Set event name. <p/>
Parameters:
name - event name

setSubtype

public void setSubtype(int EventSubtype)
Set event subtype. <p/>
Parameters:
EventSubtype - event subtype

setTagId

public void setTagId(java.lang.String TagId)
Set tag id. <p/>
Parameters:
TagId - tag id

setTime

public void setTime(java.util.Date EventTime)
Set event time. <p/>
Parameters:
EventTime - event time

setType

public void setType(int EventType)
Set event type. <p/>
Parameters:
EventType - event type

toString

public java.lang.String toString()

unpickle

public static int unpickle(Event ev,
                           java.io.RandomAccessFile is)
                    throws java.io.IOException
Unpickles (deserializes) an Event object from a RandomAccessFile starting from the current position of the file
Parameters:
ev - The Event object to populate with the values read from the file.
is - File to read from
Returns:
the number of bytes read from the file to unpickle this Event
Throws:
java.io.IOException

writeInt

public static void writeInt(byte[] b,
                            int offset,
                            int i)
Writes a int to a byte array at the given offset
Parameters:
b - The byte array to write to
offset - The offset at which to write the int
i - The int to write

writeLong

public static void writeLong(byte[] b,
                             int offset,
                             long l)
Writes a long to a byte array at the given offset
Parameters:
b - The byte array to write to
offset - The offset at which to write the long
l - The long to write

writeString

public static void writeString(byte[] b,
                               byte[] s,
                               int offset)
Writes a string to a byte array at the given offset
Parameters:
b - The byte array to write to
offset - The offset at which to write the string
s - The bytes of the string to write to write

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.