|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.dbtools.DBRecord<RT> org.opengts.db.AccountRecord<RT> org.opengts.db.DeviceRecord<DeviceMessage> org.opengts.extra.tables.DeviceMessage
public class DeviceMessage
Nested Class Summary | |
---|---|
static class |
DeviceMessage.Key
|
static class |
DeviceMessage.MessageComparator
MessageComparator class for sorting DeviceMessage objects |
static class |
DeviceMessage.MessageType
|
Nested classes/interfaces inherited from class org.opengts.db.DeviceRecord |
---|
DeviceRecord.DeviceKey<RT extends DBRecord> |
Nested classes/interfaces inherited from class org.opengts.db.AccountRecord |
---|
AccountRecord.AccountKey<RT extends DBRecord> |
Nested classes/interfaces inherited from class org.opengts.dbtools.DBRecord |
---|
DBRecord.DBChangeListener |
Field Summary | |
---|---|
static java.lang.String |
_TABLE_NAME
|
static java.lang.String |
CR_NO
|
static java.lang.String |
CR_OK
|
static java.lang.String |
CR_READ
|
static java.lang.String |
CR_TEXT
|
static java.lang.String |
CR_YES
|
static long |
DEFAULT_EXPIRATION_DAYS
|
static java.lang.String |
FLD_ackLatitude
|
static java.lang.String |
FLD_ackLongitude
|
static java.lang.String |
FLD_ackResponse
|
static java.lang.String |
FLD_ackTimestamp
|
static java.lang.String |
FLD_expireTimestamp
|
static java.lang.String |
FLD_message
|
static java.lang.String |
FLD_messageID
|
static java.lang.String |
FLD_messageSender
|
static java.lang.String |
FLD_messageTitle
|
static java.lang.String |
FLD_messageType
|
static java.lang.String |
FLD_priority
|
static java.lang.String |
FLD_queueTimestamp
|
static java.lang.String |
FLD_readTimestamp
|
static java.lang.String |
FLD_sentTimestamp
|
Fields inherited from class org.opengts.db.DeviceRecord |
---|
FLD_deviceID |
Fields inherited from class org.opengts.db.AccountRecord |
---|
FLD_accountID, FLD_displayName, FLD_isActive, FLD_notes |
Fields inherited from class org.opengts.dbtools.DBRecord |
---|
errorDescription, excludedUpdateFields, FLD_creationMillis, FLD_creationTime, FLD_description, FLD_lastUpdateAccount, FLD_lastUpdateTime, FLD_lastUpdateUser, hasError, ID_SIZE, isValidating, lastSQLException, NOTIFY_GROUP, PSEUDO_FIELD_CHAR, tempProps |
Constructor Summary | |
---|---|
DeviceMessage()
|
|
DeviceMessage(DeviceMessage.Key key)
|
Method Summary | |
---|---|
static long |
ackMessage(Device dev,
java.lang.String msgID,
long ackTime,
java.lang.String response,
GeoPoint gp)
Acknowledges the specified message. |
java.lang.String |
formatTimestamp(long timestamp)
Formats the specified timestamp as a string |
double |
getAckLatitude()
Gets the ack latitude |
GeoPoint |
getAckLocation()
Gets the ack GeoPoint |
double |
getAckLongitude()
Gets the ack longitude |
java.lang.String |
getAckResponse()
Gets the acknowledged response |
long |
getAckTimestamp()
Gets the time that the message was acknowledged |
static DeviceMessage |
getDeviceMessage(Device dev,
java.lang.String msgID)
Gets an existing DeviceMessage record. |
static DeviceMessage |
getDeviceMessage(Device dev,
java.lang.String msgID,
boolean create)
Gets/Creates a DeviceMessage Note: does NOT return null (throws exception if not found) |
long |
getExpireTimestamp()
Gets the time that the message expires |
long |
getExpireTimestamp(long dft)
Gets the time that the message expires |
static DBFactory<DeviceMessage> |
getFactory()
|
java.lang.String |
getMessage()
Gets the message |
java.lang.String |
getMessageID()
Gets the MessageID |
static OrderedSet<java.lang.String> |
getMessageIDsForDevice(Device dev,
boolean pendingOnly,
long limit)
Returns a list of MessageIDs owned by the specified Account/Device. |
static OrderedSet<java.lang.String> |
getMessageIDsForDevice(java.lang.String acctId,
java.lang.String devId,
boolean pendingOnly,
long limit)
Returns a list of MessageIDs owned by the specified Account/Device. |
java.lang.String |
getMessageSender()
Gets the message sender |
static DeviceMessage[] |
getMessagesForDevice(Device dev,
long lastUpdTS,
boolean pendingOnly,
boolean nonExpiredOnly,
long limit)
Returns a list of Messages owned by the specified Account/Device. |
java.lang.String |
getMessageTitle()
Gets the message title |
int |
getMessageType()
Gets the enumerated message type |
static DeviceMessage.MessageType |
getMessageType(DeviceMessage dmi)
Returns the defined MessageType for the specified DeviceMessageInterface. |
static DeviceMessage[] |
getPendingMessagesForDevice(Device dev,
long limit)
Returns a list of pending Messages owned by the specified Account/Device. |
int |
getPriority()
Gets the message priority |
long |
getQueueTimestamp()
Gets the time that the message was initially queued |
long |
getReadTimestamp()
Gets the time that the message was initially read |
long |
getSentTimestamp()
Gets the time that the message was initially sent |
static java.lang.String |
getTableDescription(java.util.Locale loc)
|
boolean |
hasAckLocation()
Returns true if ack location has been defined |
static boolean |
hasPendingMessagesForDevice(Device dev)
Returns true if the specified Account/Device has pending messages. |
void |
insert()
Insert this DBRecord in the database. An exception will be throw if the record already exists |
boolean |
isAcknowledged()
Returns true if message has acknowledged by device |
boolean |
isRead()
Returns true if message has read by device |
boolean |
isSent()
Returns true if message has been sent to device |
static void |
main(java.lang.String[] argv)
|
void |
setAckLatitude(double v)
Gets the ack latitude |
void |
setAckLocation(GeoPoint gp)
Sets the ack GeoPoint |
void |
setAckLongitude(double v)
Sets the ack longitude |
void |
setAckResponse(java.lang.String v)
Sets the acknowledged response |
void |
setAckTimestamp(long v)
Sets the time that the message was acknowledged |
void |
setCreationDefaultValues()
Override to set default values |
void |
setExpireTimestamp(long v)
Sets the time that the message expires |
void |
setMessage(java.lang.String v)
Sets the message |
void |
setMessageID(long v)
Sets the MessageID as a long value |
void |
setMessageID(java.lang.String v)
Sets the MessageID |
void |
setMessageSender(java.lang.String v)
Sets the message sender |
void |
setMessageTitle(java.lang.String v)
Sets the message title |
void |
setMessageType(DeviceMessage.MessageType v)
Sets the enumerated message type |
void |
setMessageType(int v)
Sets the enumerated message type |
void |
setPriority(int v)
Sets the message priority |
void |
setQueueTimestamp(long v)
Sets the time that the message was initially queued |
void |
setReadTimestamp(long v)
Sets the time that the message was initially read |
void |
setSent(long sentTime,
boolean update)
Sets this DeviceMessage as sent, and optionally updates the record |
void |
setSentTimestamp(long v)
Sets the time that the message was initially sent |
static java.lang.String |
TABLE_NAME()
|
void |
update(java.util.Set<java.lang.String> updFldSet)
Updates the specified fields in this DBRecord. |
Methods inherited from class org.opengts.db.DeviceRecord |
---|
getDevice, getDeviceDescription, getDeviceID, getDeviceVIN, hasDevice, newField_deviceID, newField_deviceID, newField_deviceID, newField_deviceID, setDevice, setDeviceID |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_EXPIRATION_DAYS
public static final java.lang.String CR_READ
public static final java.lang.String CR_OK
public static final java.lang.String CR_YES
public static final java.lang.String CR_NO
public static final java.lang.String CR_TEXT
public static final java.lang.String _TABLE_NAME
public static final java.lang.String FLD_messageID
public static final java.lang.String FLD_queueTimestamp
public static final java.lang.String FLD_messageSender
public static final java.lang.String FLD_messageTitle
public static final java.lang.String FLD_message
public static final java.lang.String FLD_messageType
public static final java.lang.String FLD_priority
public static final java.lang.String FLD_expireTimestamp
public static final java.lang.String FLD_sentTimestamp
public static final java.lang.String FLD_readTimestamp
public static final java.lang.String FLD_ackTimestamp
public static final java.lang.String FLD_ackLatitude
public static final java.lang.String FLD_ackLongitude
public static final java.lang.String FLD_ackResponse
Constructor Detail |
---|
public DeviceMessage()
public DeviceMessage(DeviceMessage.Key key)
Method Detail |
---|
public static DeviceMessage.MessageType getMessageType(DeviceMessage dmi)
dmi
- The DeviceMessageInterface from which the MessageType will be obtained.
If null, the default MessageType will be returned.
public static java.lang.String TABLE_NAME()
public static DBFactory<DeviceMessage> getFactory()
public static java.lang.String getTableDescription(java.util.Locale loc)
public void update(java.util.Set<java.lang.String> updFldSet) throws DBException
update
in class DBRecord<DeviceMessage>
updFldSet
- A Set of fields to update.
DBException
- if a database error occurs.public void insert() throws DBException
insert
in class DBRecord<DeviceMessage>
DBException
- if a database error occurs.public java.lang.String getMessageID()
public void setMessageID(long v)
public void setMessageID(java.lang.String v)
public long getQueueTimestamp()
public void setQueueTimestamp(long v)
public long getExpireTimestamp()
public void setExpireTimestamp(long v)
public long getExpireTimestamp(long dft)
public long getSentTimestamp()
public void setSentTimestamp(long v)
public boolean isSent()
public void setSent(long sentTime, boolean update) throws DBException
DBException
public long getReadTimestamp()
public void setReadTimestamp(long v)
public boolean isRead()
public java.lang.String getMessageSender()
public void setMessageSender(java.lang.String v)
public java.lang.String getMessageTitle()
public void setMessageTitle(java.lang.String v)
public java.lang.String getMessage()
public void setMessage(java.lang.String v)
public int getMessageType()
public void setMessageType(int v)
public void setMessageType(DeviceMessage.MessageType v)
public int getPriority()
public void setPriority(int v)
public long getAckTimestamp()
public void setAckTimestamp(long v)
public boolean isAcknowledged()
public double getAckLatitude()
public void setAckLatitude(double v)
v
- The ack latitudepublic double getAckLongitude()
public void setAckLongitude(double v)
v
- The ack longitudepublic boolean hasAckLocation()
public GeoPoint getAckLocation()
public void setAckLocation(GeoPoint gp)
public java.lang.String getAckResponse()
public void setAckResponse(java.lang.String v)
public void setCreationDefaultValues()
setCreationDefaultValues
in class DBRecord<DeviceMessage>
public java.lang.String formatTimestamp(long timestamp)
public static DeviceMessage getDeviceMessage(Device dev, java.lang.String msgID) throws DBException
DBException
public static DeviceMessage getDeviceMessage(Device dev, java.lang.String msgID, boolean create) throws DBException
DBException
public static long ackMessage(Device dev, java.lang.String msgID, long ackTime, java.lang.String response, GeoPoint gp) throws DBException
DBException
public static OrderedSet<java.lang.String> getMessageIDsForDevice(Device dev, boolean pendingOnly, long limit) throws DBException
DBException
public static OrderedSet<java.lang.String> getMessageIDsForDevice(java.lang.String acctId, java.lang.String devId, boolean pendingOnly, long limit) throws DBException
DBException
public static boolean hasPendingMessagesForDevice(Device dev) throws DBException
DBException
public static DeviceMessage[] getPendingMessagesForDevice(Device dev, long limit) throws DBException
DBException
public static DeviceMessage[] getMessagesForDevice(Device dev, long lastUpdTS, boolean pendingOnly, boolean nonExpiredOnly, long limit) throws DBException
DBException
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |