public class MpnInfo
extends java.lang.Object
implements java.lang.Cloneable
tableInfo
,
other parameters are optional and may be left to nil.
Common GCM service restrictions apply, such as maximum total length of 4 Kbytes.
SimpleTableInfo
corresponding to the MPN subscription.
LSClient
on calls like LSClient.activateMpn(MpnInfo,boolean)
,
but may also be returned as part of an MpnSubscription
by calls like LSClient.inquireMpn(MpnKey)
.
In this case some of their properties may not be restored to the value they had when the MpnInfo objects have been originally submitted.
In particular field references may have all been transformed in positional format (e.g. "$[2]" instead of "${last_price}").
Constructor and Description |
---|
MpnInfo(SimpleTableInfo tableInfo,
java.util.Map<java.lang.String,java.lang.String> data)
Creates an MpnInfo object with the specified parameters.
|
MpnInfo(SimpleTableInfo tableInfo,
java.lang.String collapseKey)
Creates an MpnInfo object with the specified parameters.
|
MpnInfo(SimpleTableInfo tableInfo,
java.lang.String collapseKey,
java.util.Map<java.lang.String,java.lang.String> data)
Creates an MpnInfo object with the specified parameters.
|
MpnInfo(SimpleTableInfo tableInfo,
java.lang.String collapseKey,
java.util.Map<java.lang.String,java.lang.String> data,
java.lang.String delayWhileIdle,
java.lang.String timeToLive)
Creates an MpnInfo object with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
java.lang.String |
getCollapseKey()
The collapse key to be used with the mobile push notification.
|
java.util.Map<java.lang.String,java.lang.String> |
getData()
The data to be used with the mobile push notification.
|
java.lang.String |
getDelayWhileIdle()
The delay while idle flag to be used with the mobile push notification.
|
SimpleTableInfo |
getTableInfo()
The specification of the table to be subscribed.
|
java.lang.String |
getTimeToLive()
The time to live to be used with the mobile push notification.
|
java.lang.String |
getTriggerExpression()
Specifies a boolean expression that, when set, will be evaluated against each table update and will
act as a trigger to deliver the mobile push notification.
|
void |
setCollapseKey(java.lang.String collapseKey)
Specifies the collapse key to be used with the mobile push notification.
|
void |
setData(java.util.Map<java.lang.String,java.lang.String> data)
Specifies the data to be used with the mobile push notification.
|
void |
setDelayWhileIdle(java.lang.String delayWhileIdle)
Specifies the delay while idle flag to be used with the mobile push notification.
|
void |
setTableInfo(SimpleTableInfo tableInfo)
Sets the specification of the table to be subscribed.
|
void |
setTimeToLive(java.lang.String timeToLive)
Specifies the time to live to be used with the mobile push notification.
|
void |
setTriggerExpression(java.lang.String triggerExpression)
Specifies a boolean expression that, when set, will be evaluated against each table update and will
act as a trigger to deliver the mobile push notification.
|
java.lang.String |
toString() |
public MpnInfo(SimpleTableInfo tableInfo, java.lang.String collapseKey)
tableInfo
- contains the specification of the table to be subscribed. A copy of the object is stored internally.collapseKey
- specifies the collapse key to be used with the mobile push notification.public MpnInfo(SimpleTableInfo tableInfo, java.util.Map<java.lang.String,java.lang.String> data)
tableInfo
- contains the specification of the table to be subscribed. A copy of the object is stored internally.data
- specifies the data to be used with the mobile push notification.public MpnInfo(SimpleTableInfo tableInfo, java.lang.String collapseKey, java.util.Map<java.lang.String,java.lang.String> data)
tableInfo
- contains the specification of the table to be subscribed. A copy of the object is stored internally.collapseKey
- specifies the collapse key to be used with the mobile push notification.data
- specifies the data to be used with the mobile push notification.public MpnInfo(SimpleTableInfo tableInfo, java.lang.String collapseKey, java.util.Map<java.lang.String,java.lang.String> data, java.lang.String delayWhileIdle, java.lang.String timeToLive)
tableInfo
- contains the specification of the table to be subscribed. A copy of the object is stored internally.collapseKey
- specifies the collapse key to be used with the mobile push notification.data
- specifies the data to be used with the mobile push notification.delayWhileIdle
- specifies the delay while idle flag to be used with the mobile push notification.timeToLive
- specifies the time to live to be used with the mobile push notification.public SimpleTableInfo getTableInfo()
SimpleTableInfo
or an ExtendedTableInfo
.public void setTableInfo(SimpleTableInfo tableInfo)
SimpleTableInfo
or an ExtendedTableInfo
.
A copy of the object is stored internally.
tableInfo
- the specification of a table.public java.lang.String getCollapseKey()
public void setCollapseKey(java.lang.String collapseKey)
collapseKey
- a string to be used as a collapse key.public java.util.Map<java.lang.String,java.lang.String> getData()
public void setData(java.util.Map<java.lang.String,java.lang.String> data)
data
- a String map to be used as the notification data.public java.lang.String getDelayWhileIdle()
public void setDelayWhileIdle(java.lang.String delayWhileIdle)
delayWhileIdle
- a string that must evaluate to "true" or "false" to be considered valid.public java.lang.String getTimeToLive()
public void setTimeToLive(java.lang.String timeToLive)
timeToLive
- a string that must evaluate to an integer to be considered valid.public java.lang.String getTriggerExpression()
public void setTriggerExpression(java.lang.String triggerExpression)
String
variables, and as such
appropriate type conversion must be considered (e.g. "Double.parseDouble(${last_price}) > 500.0").
The names of these variables are composed by the prefix "LS_MPN_field" followed by an index. Thus, variable names like "LS_MPN_field1"
should be considered reserved and their use avoided in the expression.
true
and no other successive push notifications will be sent.
triggerExpression
- a trigger expression in Java syntax.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object