public class DeviceEventWithAsset extends java.lang.Object implements IDeviceEventWithAsset
Modifier and Type | Field and Description |
---|---|
protected IAsset |
asset
Associated asset
|
static java.lang.String |
UNASSOCIATED_ASSET_NAME
Text shown when an asset is not assigned
|
protected IDeviceEvent |
wrapped
Wrapped event
|
Constructor and Description |
---|
DeviceEventWithAsset(IDeviceEvent wrapped,
IAssetModuleManager assets) |
Modifier and Type | Method and Description |
---|---|
void |
addOrReplaceMetadata(java.lang.String name,
java.lang.String value)
Add or replace a metadata field.
|
void |
clearMetadata()
Clear existing metadata.
|
int |
compareTo(IDeviceEvent o) |
java.lang.String |
getAssetId()
Get id of asset if associated.
|
java.lang.String |
getAssetModuleId()
Get id of asset module.
|
java.lang.String |
getAssetName()
Get human-readable asset name.
|
DeviceAssignmentType |
getAssignmentType()
Get assignment type.
|
java.lang.String |
getDeviceAssignmentToken()
Get the device assignment the event pertains to.
|
java.util.Date |
getEventDate()
Get the date the event occurred.
|
DeviceEventType |
getEventType()
Get event type indicator.
|
java.lang.String |
getId()
Get a string that uniquely identifies the event.
|
java.util.Map<java.lang.String,java.lang.String> |
getMetadata()
Get a map of all metadata.
|
java.lang.String |
getMetadata(java.lang.String name)
Get value of metadata field.
|
java.util.Date |
getReceivedDate()
Get the date this event was received.
|
java.lang.String |
getSiteToken()
Get token for site the event pertains to.
|
protected IDeviceEvent |
getWrapped() |
java.lang.String |
removeMetadata(java.lang.String name)
Remove a metadata field.
|
public static final java.lang.String UNASSOCIATED_ASSET_NAME
protected IDeviceEvent wrapped
protected IAsset asset
public DeviceEventWithAsset(IDeviceEvent wrapped, IAssetModuleManager assets) throws SiteWhereException
SiteWhereException
public java.lang.String getAssetName()
IDeviceEventWithAsset
getAssetName
in interface IDeviceEventWithAsset
public void addOrReplaceMetadata(java.lang.String name, java.lang.String value) throws SiteWhereException
IMetadataProvider
addOrReplaceMetadata
in interface IMetadataProvider
SiteWhereException
public java.lang.String removeMetadata(java.lang.String name)
IMetadataProvider
removeMetadata
in interface IMetadataProvider
public java.lang.String getMetadata(java.lang.String name)
IMetadataProvider
getMetadata
in interface IMetadataProvider
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
IMetadataProvider
getMetadata
in interface IMetadataProvider
public void clearMetadata()
IMetadataProvider
clearMetadata
in interface IMetadataProvider
public int compareTo(IDeviceEvent o)
compareTo
in interface java.lang.Comparable<IDeviceEvent>
public java.lang.String getId()
IDeviceEvent
getId
in interface IDeviceEvent
public DeviceEventType getEventType()
IDeviceEvent
getEventType
in interface IDeviceEvent
public java.lang.String getSiteToken()
IDeviceEvent
getSiteToken
in interface IDeviceEvent
public java.lang.String getDeviceAssignmentToken()
IDeviceEvent
getDeviceAssignmentToken
in interface IDeviceEvent
public DeviceAssignmentType getAssignmentType()
IDeviceEvent
getAssignmentType
in interface IDeviceEvent
public java.lang.String getAssetModuleId()
IDeviceEvent
getAssetModuleId
in interface IDeviceEvent
public java.lang.String getAssetId()
IDeviceEvent
getAssetId
in interface IDeviceEvent
public java.util.Date getEventDate()
IDeviceEvent
getEventDate
in interface IDeviceEvent
public java.util.Date getReceivedDate()
IDeviceEvent
getReceivedDate
in interface IDeviceEvent
protected IDeviceEvent getWrapped()