com.ibm.sensorevent.model
Class IBMSensorEvent

java.lang.Object
  extended by com.ibm.sensorevent.model.generic.GenericEvent
      extended by com.ibm.sensorevent.model.IBMSensorEvent
All Implemented Interfaces:
IGenericEvent, ISensorEvent, java.io.Serializable

public class IBMSensorEvent
extends GenericEvent
implements ISensorEvent

IBMSensorEvent represents the event type processed by Data Capture and Premises Server within the IBM sensor event model. Each IBMSensorEvent has an IHeader, an IPayloadMetaData, and an IPayload.

The interface associated with this class is ISensorEvent.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
protected  IHeader header
          The event's header
protected  IPayload payload
          The event's payload
protected  IPayloadMetaData payloadMetaData
          The event's payload metadata
protected  java.lang.String version
          The event's version
 
Fields inherited from class com.ibm.sensorevent.model.generic.GenericEvent
groups, name
 
Constructor Summary
protected IBMSensorEvent()
          Constructs a new IBMSensorEvent
protected IBMSensorEvent(IPayload payload)
          Constructs a new IBMSensorEvent with the specified IPayload
 
Method Summary
static ISensorEvent getAggregatedTagReadInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with a PassiveRFIDAggregatedTagReadPayload payload
static ISensorEvent getAlertDebugInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an AlertDebugPayload
static ISensorEvent getAlertErrorInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an AlertErrorPayload
static ISensorEvent getAlertInfoInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an AlertInfoPayload
static ISensorEvent getAlertWarningInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an AlertWarningPayload
static ISensorEvent getApplicationPingInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an ApplicationPingPayload
static ISensorEvent getApplicationPongInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an ApplicationPongPayload
 IHeader getHeader()
          Returns the event's header
static ISensorEvent getHeartbeatInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an HeartbeatPayload
static ISensorEvent getIBMSensorEventInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an IBMSensorEventPayload
static ISensorEvent getInstance()
          Factory method to create an ISensorEvent with a default payload
static ISensorEvent getInstance(java.lang.String eventType, IPayload payload)
          Factory method to create an ISensorEvent with the specified event type and IPayload
static ISensorEvent getInstance(java.lang.String eventType, java.util.Map payloadMap)
          Factory method to create an ISensorEvent with the specified event type and IBMSensorEventPayload.
 IPayload getPayload()
          Returns the event's payload.
 IPayloadMetaData getPayloadMetaData()
          Returns the event's payload metadata
static ISensorEvent getPortalCommandInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an PortalCommandPayload
static ISensorEvent getPortalReportInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an PortalReportPayload
static ISensorEvent getReloadInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an ReloadPayload
static ISensorEvent getRestartInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an RestartPayload
static ISensorEvent getTagReadFeedbackInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an TagReadFeedbackPayload
static ISensorEvent getTagReadInstance(java.lang.String eventType)
          Factory method to create an ISensorEvent with the specified event type and with an PassiveRFIDTagReadPayload
static ISensorEvent getTypedInstance(java.lang.String eventType, java.util.Map payloadMap)
          Factory method to create an ISensorEvent with the specified event type and IBMSensorEventPayload.
 java.lang.String getVersion()
          Returns the event's version
 void setHeader(IHeader header)
          Sets the event's header
 void setPayload(IPayload payload)
          Sets the event's payload
 void setPayloadMetaData(IPayloadMetaData payloadMetaData)
          Sets the event's payload metadata
 void setVersion(java.lang.String v)
          Sets the event's version
 java.util.Map toMap()
          Converts the event to a java.util.Map
 java.lang.String toString()
          Returns a string representation of the event (for debug purposes)
 void updateEventType(java.lang.String newEventType)
          Updates the header's eventType and the payload's eventGroup name to the given new eventType.
 
Methods inherited from class com.ibm.sensorevent.model.generic.GenericEvent
addGroup, getGroup, getGroups, getInstance, getName, removeGroups, setGroups, setName, traverseGroupPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.sensorevent.model.generic.IGenericEvent
addGroup, getGroup, getGroups, getName, removeGroups, setGroups, setName, traverseGroupPath
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

version

protected volatile java.lang.String version
The event's version


header

protected volatile IHeader header
The event's header


payloadMetaData

protected volatile IPayloadMetaData payloadMetaData
The event's payload metadata


payload

protected volatile IPayload payload
The event's payload

Constructor Detail

IBMSensorEvent

protected IBMSensorEvent()
                  throws SensorEventException
Constructs a new IBMSensorEvent

Throws:
SensorEventException

IBMSensorEvent

protected IBMSensorEvent(IPayload payload)
                  throws SensorEventException
Constructs a new IBMSensorEvent with the specified IPayload

Parameters:
payload - the payload to save in the event
Throws:
SensorEventException
Method Detail

getInstance

public static ISensorEvent getInstance()
                                throws SensorEventException
Factory method to create an ISensorEvent with a default payload

Throws:
SensorEventException

getInstance

public static ISensorEvent getInstance(java.lang.String eventType,
                                       IPayload payload)
                                throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and IPayload

Parameters:
eventType - the event type
payload - the payload
Throws:
SensorEventException

getInstance

public static ISensorEvent getInstance(java.lang.String eventType,
                                       java.util.Map payloadMap)
                                throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and IBMSensorEventPayload. The payload is created from a map of strings.

Parameters:
eventType - the event type
payloadMap - the map containing payload data (all keys/values must be of type String)
Throws:
SensorEventException

getTypedInstance

public static ISensorEvent getTypedInstance(java.lang.String eventType,
                                            java.util.Map payloadMap)
                                     throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and IBMSensorEventPayload. The payload is created from a map of objects.

Parameters:
eventType - the event type
payloadMap - the map containing payload data (values may be of any type)
Throws:
SensorEventException

getAggregatedTagReadInstance

public static ISensorEvent getAggregatedTagReadInstance(java.lang.String eventType)
                                                 throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with a PassiveRFIDAggregatedTagReadPayload payload

Parameters:
eventType -
Throws:
SensorEventException

getAlertDebugInstance

public static ISensorEvent getAlertDebugInstance(java.lang.String eventType)
                                          throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an AlertDebugPayload

Parameters:
eventType -
Throws:
SensorEventException

getAlertInfoInstance

public static ISensorEvent getAlertInfoInstance(java.lang.String eventType)
                                         throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an AlertInfoPayload

Parameters:
eventType -
Throws:
SensorEventException

getAlertWarningInstance

public static ISensorEvent getAlertWarningInstance(java.lang.String eventType)
                                            throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an AlertWarningPayload

Parameters:
eventType -
Throws:
SensorEventException

getAlertErrorInstance

public static ISensorEvent getAlertErrorInstance(java.lang.String eventType)
                                          throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an AlertErrorPayload

Parameters:
eventType -
Throws:
SensorEventException

getApplicationPingInstance

public static ISensorEvent getApplicationPingInstance(java.lang.String eventType)
                                               throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an ApplicationPingPayload

Parameters:
eventType -
Throws:
SensorEventException

getApplicationPongInstance

public static ISensorEvent getApplicationPongInstance(java.lang.String eventType)
                                               throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an ApplicationPongPayload

Parameters:
eventType -
Throws:
SensorEventException

getHeartbeatInstance

public static ISensorEvent getHeartbeatInstance(java.lang.String eventType)
                                         throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an HeartbeatPayload

Parameters:
eventType -
Throws:
SensorEventException

getPortalCommandInstance

public static ISensorEvent getPortalCommandInstance(java.lang.String eventType)
                                             throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an PortalCommandPayload

Parameters:
eventType -
Throws:
SensorEventException

getPortalReportInstance

public static ISensorEvent getPortalReportInstance(java.lang.String eventType)
                                            throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an PortalReportPayload

Parameters:
eventType -
Throws:
SensorEventException

getReloadInstance

public static ISensorEvent getReloadInstance(java.lang.String eventType)
                                      throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an ReloadPayload

Parameters:
eventType -
Throws:
SensorEventException

getRestartInstance

public static ISensorEvent getRestartInstance(java.lang.String eventType)
                                       throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an RestartPayload

Parameters:
eventType -
Throws:
SensorEventException

getTagReadFeedbackInstance

public static ISensorEvent getTagReadFeedbackInstance(java.lang.String eventType)
                                               throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an TagReadFeedbackPayload

Parameters:
eventType -
Throws:
SensorEventException

getTagReadInstance

public static ISensorEvent getTagReadInstance(java.lang.String eventType)
                                       throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an PassiveRFIDTagReadPayload

Parameters:
eventType -
Throws:
SensorEventException

getIBMSensorEventInstance

public static ISensorEvent getIBMSensorEventInstance(java.lang.String eventType)
                                              throws SensorEventException
Factory method to create an ISensorEvent with the specified event type and with an IBMSensorEventPayload

Parameters:
eventType -
Throws:
SensorEventException

getVersion

public java.lang.String getVersion()
                            throws SensorEventException
Returns the event's version

Specified by:
getVersion in interface ISensorEvent
Throws:
SensorEventException

setVersion

public void setVersion(java.lang.String v)
                throws SensorEventException
Sets the event's version

Specified by:
setVersion in interface ISensorEvent
Throws:
SensorEventException

getHeader

public IHeader getHeader()
                  throws SensorEventException
Returns the event's header

Specified by:
getHeader in interface ISensorEvent
Throws:
SensorEventException

setHeader

public void setHeader(IHeader header)
               throws SensorEventException
Sets the event's header

Specified by:
setHeader in interface ISensorEvent
Throws:
SensorEventException

getPayloadMetaData

public IPayloadMetaData getPayloadMetaData()
                                    throws SensorEventException
Returns the event's payload metadata

Specified by:
getPayloadMetaData in interface ISensorEvent
Throws:
SensorEventException

setPayloadMetaData

public void setPayloadMetaData(IPayloadMetaData payloadMetaData)
                        throws SensorEventException
Sets the event's payload metadata

Specified by:
setPayloadMetaData in interface ISensorEvent
Throws:
SensorEventException

getPayload

public IPayload getPayload()
                    throws SensorEventException
Returns the event's payload. The payload type is defined by the class name saved in the payload, which is a subtype of IPayload. If the payload class name cannot be loaded, the type returned is IPayload.

Specified by:
getPayload in interface ISensorEvent
Throws:
SensorEventException

setPayload

public void setPayload(IPayload payload)
                throws SensorEventException
Sets the event's payload

Specified by:
setPayload in interface ISensorEvent
Throws:
SensorEventException

toMap

public java.util.Map toMap()
                    throws SensorEventException
Converts the event to a java.util.Map

Specified by:
toMap in interface ISensorEvent
Throws:
SensorEventException

updateEventType

public void updateEventType(java.lang.String newEventType)
                     throws SensorEventException
Updates the header's eventType and the payload's eventGroup name to the given new eventType. The eventGroup name is updated only if the payload is an IBMSensorEventPayload.

Specified by:
updateEventType in interface ISensorEvent
Parameters:
newEventType - the new eventType name
Throws:
SensorEventException

toString

public java.lang.String toString()
Returns a string representation of the event (for debug purposes)

Overrides:
toString in class GenericEvent


Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.