ePOST API

rice.email
Class Email

java.lang.Object
  extended by rice.email.Email
All Implemented Interfaces:
java.io.Serializable

public class Email
extends java.lang.Object
implements java.io.Serializable

Represents a notion of a message in the POST system. This class is designed to be a small representation of an Email, with pointers to all of the content.

Version:
$Id: pretty.settings,v 1.2 2003/07/10 03:17:16 amislove Exp $
Author:
Joe Montgomery, Derek Ruths
See Also:
Serialized Form

Field Summary
 EmailMessagePart content
           
 
Constructor Summary
Email(PostUserAddress sender, PostEntityAddress[] recipients, EmailMessagePart content)
          Constructs an Email.
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines equality on this email
 EmailMessagePart getContent()
          Returns the header of this message.
 void getContentHashReferences(java.util.Set set)
          This method returns a list of all the handles stored in this part by adding them to the specified set.
 PostEntityAddress[] getRecipients()
          Returns the recipient users of this message.
 PostUserAddress getSender()
          Returns the sender of this message.
 int hashCode()
          Returns the hashcode
protected  void setStorage(StorageService s)
          Sets the storage service for the email.
protected  void storeData(Continuation command)
          Stores the content of the Email into PAST and saves the references to the content in the email.
 java.lang.String toString()
          Returns a string representing this email
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

content

public EmailMessagePart content
Constructor Detail

Email

public Email(PostUserAddress sender,
             PostEntityAddress[] recipients,
             EmailMessagePart content)
Constructs an Email.

Parameters:
sender - The address of the sender of the mail.
recipients - The recipients for this message
content - The content of this message
Method Detail

getSender

public PostUserAddress getSender()
Returns the sender of this message.

Returns:
The sender of this email.

getRecipients

public PostEntityAddress[] getRecipients()
Returns the recipient users of this message.

Returns:
The recipient users of this email.

getContent

public EmailMessagePart getContent()
Returns the header of this message. Should be text.

Returns:
the content of the email

hashCode

public int hashCode()
Returns the hashcode

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Determines equality on this email

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare to
Returns:
Whether or not this email is equal

toString

public java.lang.String toString()
Returns a string representing this email

Overrides:
toString in class java.lang.Object
Returns:
A string representing this email

setStorage

protected void setStorage(StorageService s)
Sets the storage service for the email. I (JM) added this method so that the EmailService can set the Email's storage whenever the email is sent or received, which lets the EmailClient be effectively ignorant of the storage service (which is good, since this Service is part of the POST layer).

Parameters:
s - the StorageService the email is to use

storeData

protected void storeData(Continuation command)
Stores the content of the Email into PAST and saves the references to the content in the email. Should be called before the Email is sent over the wire.

Parameters:
command - This command is called when the storage is done, with the Boolean value of the success of the operation, or an exception is passed to the command.

getContentHashReferences

public void getContentHashReferences(java.util.Set set)
This method returns a list of all the handles stored in this part by adding them to the specified set.

Parameters:
set - The set to add the PastContentHandles to.

ePOST API

Copyright © 2001-2005 - Rice Pastry.