org.benow.web.message
Class MessageImpl

java.lang.Object
  extended by org.benow.security.SecureObject
      extended by org.benow.repository.util.PersistentObjectImpl
          extended by org.benow.repository.mapping.JSQLObject
              extended by org.benow.web.message.MessageImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, org.benow.repository.util.PersistentObject, Message
Direct Known Subclasses:
MessageReceivedMessage

public class MessageImpl
extends org.benow.repository.mapping.JSQLObject
implements Message

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.benow.repository.mapping.JSQLObject
org.benow.repository.mapping.JSQLObject.XSQLVersionDesc, org.benow.repository.mapping.JSQLObject.XSQLVersioned
 
Nested classes/interfaces inherited from interface org.benow.web.message.Message
Message.Priority
 
Field Summary
 
Fields inherited from class org.benow.repository.util.PersistentObjectImpl
conn, recycled
 
Fields inherited from class org.benow.security.SecureObject
admin
 
Fields inherited from interface org.benow.repository.util.PersistentObject
FIELD_NAME_KEY
 
Constructor Summary
MessageImpl(org.benow.security.group.Group sender, java.lang.String subject)
           
MessageImpl(java.util.List<Recipient> recipients, java.lang.String subject)
           
MessageImpl(Recipient sender, java.lang.String subject)
           
MessageImpl(org.benow.security.user.User sender, java.lang.String subject)
           
 
Method Summary
 java.util.Date created()
           
 java.lang.String getBody()
           
 org.benow.java.mime.MimeType getBodyMimeType()
           
 java.net.URL getConfirmURL()
           
 java.net.URL getDenyURL()
           
 Message.Priority getPriority()
           
 java.util.List<Recipient> getRecipients()
           
 org.benow.security.user.User getSender()
          The sender of the message.
 java.lang.String getSubject()
           
 java.util.Date lastSent()
           
 void onSend(Message msg)
           
 boolean received()
           
 boolean sendAsEmail()
           
 boolean sent()
           
 void setFromSystem()
           
 void setReceived(Message msg)
           
 
Methods inherited from class org.benow.repository.mapping.JSQLObject
fetchExpectedField, fetchField, fetchFieldQuiet, forgetField, isFetched, isLocked, lock, refetchFieldQuiet, setFetched
 
Methods inherited from class org.benow.repository.util.PersistentObjectImpl
compareTo, doIsTransient, equals, getKey, isTransient, recycle, remove, remove, repositoryAfterLoad, repositoryAfterPersist, repositoryAfterTransient, repositoryBeforePersist, repositoryBeforeTransient, setKey, toString, update, update
 
Methods inherited from class org.benow.security.SecureObject
assertOnePermission, assertPermission, assertPermission, declarePermission, declareViewPermission, declareViewPermission
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageImpl

public MessageImpl(java.util.List<Recipient> recipients,
                   java.lang.String subject)

MessageImpl

public MessageImpl(Recipient sender,
                   java.lang.String subject)

MessageImpl

public MessageImpl(org.benow.security.user.User sender,
                   java.lang.String subject)

MessageImpl

public MessageImpl(org.benow.security.group.Group sender,
                   java.lang.String subject)
Method Detail

setFromSystem

public void setFromSystem()

created

public java.util.Date created()
Specified by:
created in interface Message

getBody

public java.lang.String getBody()
Specified by:
getBody in interface Message

getBodyMimeType

public org.benow.java.mime.MimeType getBodyMimeType()
Specified by:
getBodyMimeType in interface Message

getConfirmURL

public java.net.URL getConfirmURL()
Specified by:
getConfirmURL in interface Message
Returns:
the url to confirm the operation indicated in the message, if any. Can also refer to the primary url for handling the message

getDenyURL

public java.net.URL getDenyURL()
Specified by:
getDenyURL in interface Message
Returns:
the url to deny the operation indicated in the message.

getPriority

public Message.Priority getPriority()
Specified by:
getPriority in interface Message

getRecipients

public java.util.List<Recipient> getRecipients()
Specified by:
getRecipients in interface Message

getSender

public org.benow.security.user.User getSender()
Description copied from interface: Message
The sender of the message. If the sender is null, the message was sent by the system.

Specified by:
getSender in interface Message
Returns:

getSubject

public java.lang.String getSubject()
Specified by:
getSubject in interface Message

lastSent

public java.util.Date lastSent()
Specified by:
lastSent in interface Message

received

public boolean received()
Specified by:
received in interface Message

sendAsEmail

public boolean sendAsEmail()
Specified by:
sendAsEmail in interface Message

sent

public boolean sent()
Specified by:
sent in interface Message

onSend

public void onSend(Message msg)

setReceived

public void setReceived(Message msg)