|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<Notification>
org.starhope.appius.user.notifications.Notification
public class Notification
Notification class. Used to notify users of events asynchronously. Notifications can be generated for offline users as well.
Field Summary | |
---|---|
private int |
id
The ID of the notification |
private String |
messageLabel
The message catalog label for the notification message |
private Map<String,String> |
messageParams
set of parameters to be substituted into the message obtained from LibMisc#getText messageLabel for %s parameters |
private long |
readTime
Time at which the notification was read/dispatched |
private AbstractUser |
recipient
The user to whom this notification was directed |
private AbstractUser |
sender
The ID of the User that initiated this notification |
private long |
sentTime
time at which the notification was sent |
private static long |
serialVersionUID
Java Serialisation unique ID |
protected NotificationReplyVerbSet |
verbs
verbs that can be used to respond to this notification |
Fields inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
myLoader, timeLastChanged, timeLastSaved |
Constructor Summary | |
---|---|
Notification(AbstractUser newSender,
String label,
AbstractUser newRecipient)
Instantiate a new Notification |
Method Summary | |
---|---|
void |
addMessageParam(String key,
String param)
add a message parameter to the notification. |
void |
addMessageParams(Map<String,String> params)
add a series of message parameters to the notification. |
int |
getCacheableID()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
String |
getCacheableIdent()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
long |
getID()
|
String |
getMessageLabel()
|
Map<String,String> |
getMessageParams()
|
long |
getReadTime()
|
AbstractUser |
getRecipient()
|
NotificationReplyVerbSet |
getReplyVerbs()
get available response verbs, if any. |
AbstractUser |
getSender()
|
long |
getSentTime()
|
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
boolean |
isRead()
|
boolean |
isSent()
|
void |
markAsRead()
Used when the notification is handled. |
void |
send()
Send a notification |
void |
setMessageLabel(String newLabel)
|
void |
setRecipient(AbstractUser newRecipient)
|
void |
setSender(AbstractUser newSender)
|
org.json.JSONObject |
toJSON()
return a JSON version of this notification |
String |
toString()
|
Methods inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
changed, checkStale, compareTo, equals, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, hashCode, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private final int id
private String messageLabel
private final Map<String,String> messageParams
private long readTime
private AbstractUser recipient
private AbstractUser sender
private long sentTime
protected NotificationReplyVerbSet verbs
Constructor Detail |
---|
public Notification(AbstractUser newSender, String label, AbstractUser newRecipient)
newSender
- The sender of the notificationlabel
- The verb/labelnewRecipient
- The recipientMethod Detail |
---|
public void addMessageParam(String key, String param)
key
- the parameter IDparam
- the new message parameterpublic void addMessageParams(Map<String,String> params)
params
- the new message parameterspublic int getCacheableID() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableID
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent()
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableIdent
in interface DataRecord
DataRecord.getCacheableIdent()
public long getID()
public String getMessageLabel()
public Map<String,String> getMessageParams()
public long getReadTime()
public AbstractUser getRecipient()
public NotificationReplyVerbSet getReplyVerbs()
public AbstractUser getSender()
public long getSentTime()
public String getSubversionRevision()
HasSubversionRevision
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
As an example,the Subversion revision string for this file is "$Rev: 1968 $"
@Override public String getSubversionRevision () { return "$Rev: "; }
getSubversionRevision
in interface HasSubversionRevision
HasSubversionRevision.getSubversionRevision()
public boolean isRead()
public boolean isSent()
public void markAsRead()
public void send()
public void setMessageLabel(String newLabel)
newLabel
- the messageLabel to setpublic void setRecipient(AbstractUser newRecipient)
newRecipient
- the recipient to setpublic void setSender(AbstractUser newSender)
newSender
- the senderID to setpublic org.json.JSONObject toJSON()
toJSON
in interface CastsToJSON
public String toString()
toString
in class SimpleDataRecord<Notification>
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |