de.uplanet.lucy.server.newsagent
Class Message

java.lang.Object
  extended by de.uplanet.lucy.server.newsagent.Message
All Implemented Interfaces:
de.uplanet.lucy.server.newsagent.IMessage, de.uplanet.util.IDumpable

public final class Message
extends java.lang.Object
implements de.uplanet.lucy.server.newsagent.IMessage, de.uplanet.util.IDumpable

Represents a message that is managed by a NewsAgent.

Version:
$Revision: 73213 $

Method Summary
 void addRecipient(java.lang.String p_strRecipientId)
          Add a recipient of this message.
 void addRecipients(java.lang.String[] p_astrRecipientList)
          Add recipients of this message.
 void clearRecipients()
          Remove all recipients from this message.
 java.lang.String dump()
           
 java.lang.Object get(java.lang.String p_strName)
          Get a property of this message.
 java.lang.String getAppGuid()
          Get the message's application GUID.
 java.lang.String getBody()
          Get the body of the message.
 java.sql.Timestamp getCreationDate()
          Get the creation date of the message.
 java.sql.Timestamp getExpirationDate()
          Get the expiration date of the message.
 java.lang.String getId()
          Get the GUID of the message.
 java.lang.String getRecId()
          Get the message's record identifier.
 java.util.Iterator<de.uplanet.lucy.server.newsagent.RecipientStatus> getRecipients()
          Get an (ordered) iterator over the recipients GUID collection.
 java.lang.String getSender()
          Get the GUID of the sender.
 java.lang.String getSubject()
          Get the subject of the message.
 java.lang.String getTargetGuid()
          Get the message's target GUID.
 java.lang.String getUrl()
          The URL that is associated to the message.
 boolean hasRecipient(java.lang.String p_strRecipientId)
          Test if this message has the specified individual recipient.
 boolean hasRecipients()
          Test if this message has the specified individual recipient.
 boolean isComplete()
          Determine if the message is properly initialized.
 boolean isDirty()
          Determine if the message was modified.
 boolean isVisited()
          Determine if the message has been read by the current user.
 void markDeleted()
          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(java.lang.String p_strName, java.lang.Object p_objValue)
          Set a property for this message.
 void setAppGuid(java.lang.String p_strAppGuid)
          Set the message's application GUID.
 void setBody(java.lang.String p_strBody)
          Set the body of the message.
 void setExpirationDate(java.sql.Timestamp p_dtExpire)
          Set the expiration date of the message.
 void setRecId(java.lang.String p_strRecId)
          Set the messages record identifier.
 void setSender(java.lang.String p_strSenderId)
          Set the sender of the message.
 void setSubject(java.lang.String p_strSubject)
          Set the subject of the message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

save

public boolean save()
Save the message to the database.

Specified by:
save in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
true if the message could be saved, false otherwise.

getId

public java.lang.String getId()
Get the GUID of the message.

Specified by:
getId in interface de.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 interface de.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 interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
true if the message was modifier, false otherwise.

getCreationDate

public java.sql.Timestamp getCreationDate()
Get the creation date of the message.

Specified by:
getCreationDate in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The creation date.

setAppGuid

public void setAppGuid(java.lang.String p_strAppGuid)
Set the message's application GUID.

The target identifier is adjusted properly.

Parameters:
p_strAppGuid - The GUID to be set.

getAppGuid

public java.lang.String getAppGuid()
Get the message's application GUID.

Specified by:
getAppGuid in interface de.uplanet.lucy.server.newsagent.IMessage

getTargetGuid

public java.lang.String getTargetGuid()
Get the message's target GUID.

Specified by:
getTargetGuid in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The target GUID.

setRecId

public void setRecId(java.lang.String p_strRecId)
Set the messages record identifier.


getRecId

public java.lang.String getRecId()
Get the message's record identifier.

Specified by:
getRecId in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The record identifier.

setSender

public void setSender(java.lang.String p_strSenderId)
Set the sender of the message.

Parameters:
p_strSenderId - The GUID of the sender.

getSender

public java.lang.String getSender()
Get the GUID of the sender.

Specified by:
getSender in interface de.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 interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
true if the message has recipients, false otherwise.

hasRecipient

public boolean hasRecipient(java.lang.String p_strRecipientId)
Test if this message has the specified individual recipient.

Specified by:
hasRecipient in interface de.uplanet.lucy.server.newsagent.IMessage
Parameters:
p_strRecipientId - The GUID of the individual recipient. return true if the message has the specified individual recipient.

addRecipient

public void addRecipient(java.lang.String p_strRecipientId)
Add a recipient of this message.

Specified by:
addRecipient in interface de.uplanet.lucy.server.newsagent.IMessage
Parameters:
p_strRecipientId - The GUID of the recipient.
To Do:
Insert debug code.

addRecipients

public void addRecipients(java.lang.String[] p_astrRecipientList)
Add recipients of this message.

Specified by:
addRecipients in interface de.uplanet.lucy.server.newsagent.IMessage
Parameters:
p_astrRecipientList - The GUIDs of the recipients of this message.
To Do:
Insert debug code.

getRecipients

public java.util.Iterator<de.uplanet.lucy.server.newsagent.RecipientStatus> getRecipients()
Get an (ordered) iterator over the recipients GUID collection. The elements accessed through the iterator are actually RecipientStatus objects so users must apply the RecipientStatus.toString() method to obtain the string representation.

Specified by:
getRecipients in interface de.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 interface de.uplanet.lucy.server.newsagent.IMessage

setSubject

public void setSubject(java.lang.String p_strSubject)
Set the subject of the message.

Parameters:
p_strSubject - The subject.

getSubject

public java.lang.String getSubject()
Get the subject of the message.

Specified by:
getSubject in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The subject of the message.

setBody

public void setBody(java.lang.String p_strBody)
Set the body of the message.

Parameters:
p_strBody - The body.

getBody

public java.lang.String getBody()
Get the body of the message.

Specified by:
getBody in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The body of the message.

setExpirationDate

public void setExpirationDate(java.sql.Timestamp p_dtExpire)
Set the expiration date of the message.

Parameters:
p_dtExpire - The expiration date.

getExpirationDate

public java.sql.Timestamp getExpirationDate()
Get the expiration date of the message.

Specified by:
getExpirationDate in interface de.uplanet.lucy.server.newsagent.IMessage
Returns:
The expiration date.

getUrl

public java.lang.String getUrl()
The URL that is associated to the message.

Returns:
The associated URL.
To Do:
Implement this method.

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

public void set(java.lang.String p_strName,
                java.lang.Object p_objValue)
Set a property for this message.

Parameters:
p_strName - The name of the property.
p_objValue - The value of the property.
Warning:
This method is not implemented yet.

get

public java.lang.Object get(java.lang.String p_strName)
Get a property of this message.

Parameters:
p_strName - The name of the property.
Returns:
The value of the property.
Warning:
This method is not implemented yet.

markRead

public void markRead()
Mark this message as read if it is currently associated with a certain recipient.

See Also:
m_strRecipientId

markDeleted

public void markDeleted()
Mark this message as deleted if it is currently associated with a certain recipient.

See Also:
m_strRecipientId

dump

public java.lang.String dump()
Specified by:
dump in interface de.uplanet.util.IDumpable


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.