Package de.uplanet.lucy.server.newsagent
Class Message
java.lang.Object
de.uplanet.lucy.server.newsagent.Message
- All Implemented Interfaces:
de.uplanet.lucy.server.newsagent.IMessage
,de.uplanet.util.IDumpable
public final class Message
extends Object
implements de.uplanet.lucy.server.newsagent.IMessage, de.uplanet.util.IDumpable
Represents a message that is managed by a
NewsAgent
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecipient
(String p_strRecipientId) Add a recipient of this message.void
addRecipients
(String[] p_astrRecipientList) Add recipients of this message.void
Remove all recipients from this message.dump()
Get a property of this message.Get the message's application GUID.getBody()
Get the body of the message.Get the creation date of the message.Get the expiration date of the message.getId()
Get the GUID of the message.getRecId()
Get the message's record identifier.Iterator
<de.uplanet.lucy.server.newsagent.RecipientStatus> Get an (ordered) iterator over the recipients GUID collection.Get the GUID of the sender.Get the subject of the message.Get the message's target GUID.getUrl()
The URL that is associated to the message.boolean
hasRecipient
(String p_strRecipientId) Test if this message has the specified individual recipient.boolean
Test if this message has the specified individual recipient.boolean
Determine if the message is properly initialized.boolean
isDirty()
Determine if the message was modified.boolean
Determine if the message has been read by the current user.void
Mark this message as deleted if it is currently associated with a certain recipient.void
markRead()
Mark this message as read if it is currently associated with a certain recipient.boolean
save()
Save the message to the database.void
Set a property for this message.void
setAppGuid
(String p_strAppGuid) Set the message's application GUID.void
Set the body of the message.void
setExpirationDate
(Timestamp p_dtExpire) Set the expiration date of the message.void
Set the messages record identifier.void
Set the sender of the message.void
setSubject
(String p_strSubject) Set the subject of the message.
-
Method Details
-
save
public boolean save()Save the message to the database.- Specified by:
save
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
true
if the message could be saved,false
otherwise.
-
getId
Get the GUID of the message.- Specified by:
getId
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The GUID of the message.
-
isComplete
public boolean isComplete()Determine if the message is properly initialized.- Specified by:
isComplete
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
true
if the message is properly initialized,false
otherwise.
-
isDirty
public boolean isDirty()Determine if the message was modified.- Specified by:
isDirty
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
true
if the message was modifier,false
otherwise.
-
getCreationDate
Get the creation date of the message.- Specified by:
getCreationDate
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The creation date.
-
setAppGuid
Set the message's application GUID.The target identifier is adjusted properly.
- Parameters:
p_strAppGuid
- The GUID to be set.
-
getAppGuid
Get the message's application GUID.- Specified by:
getAppGuid
in interfacede.uplanet.lucy.server.newsagent.IMessage
-
getTargetGuid
Get the message's target GUID.- Specified by:
getTargetGuid
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The target GUID.
-
setRecId
Set the messages record identifier. -
getRecId
Get the message's record identifier.- Specified by:
getRecId
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The record identifier.
-
setSender
Set the sender of the message.- Parameters:
p_strSenderId
- The GUID of the sender.
-
getSender
Get the GUID of the sender.- Specified by:
getSender
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The GUID of the sender.
-
hasRecipients
public boolean hasRecipients()Test if this message has the specified individual recipient.- Specified by:
hasRecipients
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
true
if the message has recipients,false
otherwise.
-
hasRecipient
Test if this message has the specified individual recipient.- Specified by:
hasRecipient
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Parameters:
p_strRecipientId
- The GUID of the individual recipient. returntrue
if the message has the specified individual recipient.
-
addRecipient
Add a recipient of this message.- Specified by:
addRecipient
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Parameters:
p_strRecipientId
- The GUID of the recipient.
-
addRecipients
Add recipients of this message.- Specified by:
addRecipients
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Parameters:
p_astrRecipientList
- The GUIDs of the recipients of this message.
-
getRecipients
Get an (ordered) iterator over the recipients GUID collection. The elements accessed through the iterator are actuallyRecipientStatus
objects so users must apply theRecipientStatus.toString()
method to obtain the string representation.- Specified by:
getRecipients
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- An ordered iterator over the individual recipients of the message.
-
clearRecipients
public void clearRecipients()Remove all recipients from this message.- Specified by:
clearRecipients
in interfacede.uplanet.lucy.server.newsagent.IMessage
-
setSubject
Set the subject of the message.- Parameters:
p_strSubject
- The subject.
-
getSubject
Get the subject of the message.- Specified by:
getSubject
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The subject of the message.
-
setBody
Set the body of the message.- Parameters:
p_strBody
- The body.
-
getBody
Get the body of the message.- Specified by:
getBody
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The body of the message.
-
setExpirationDate
Set the expiration date of the message.- Parameters:
p_dtExpire
- The expiration date.
-
getExpirationDate
Get the expiration date of the message.- Specified by:
getExpirationDate
in interfacede.uplanet.lucy.server.newsagent.IMessage
- Returns:
- The expiration date.
-
getUrl
The URL that is associated to the message.- Returns:
- The associated URL.
-
isVisited
public boolean isVisited()Determine if the message has been read by the current user.- Returns:
true
if the message has been read by the current user,false
if this is not the case or if the visited-status can not be determined.
-
set
Set a property for this message.- Parameters:
p_strName
- The name of the property.p_objValue
- The value of the property.
-
get
Get a property of this message.- Parameters:
p_strName
- The name of the property.- Returns:
- The value of the property.
-
markRead
public void markRead()Mark this message as read if it is currently associated with a certain recipient.- See Also:
-
markDeleted
public void markDeleted()Mark this message as deleted if it is currently associated with a certain recipient.- See Also:
-
dump
- Specified by:
dump
in interfacede.uplanet.util.IDumpable
-