ePOST API

rice.email
Class EmailHeadersPart

java.lang.Object
  extended by rice.email.EmailContentPart
      extended by rice.email.EmailHeadersPart
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EmailMessagePart

public class EmailHeadersPart
extends EmailContentPart

Abstract class which represents a part of an email with headers

Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
 EmailContentPart content
          The content of this part
protected  java.lang.ref.SoftReference headers
          The data representing the haeders (transient as it is stored).
 EmailDataReference headersReference
          A reference to the headers of this email part
protected  EmailData unstoredHeaders
          A reference to the headers which is non-soft
 
Fields inherited from class rice.email.EmailContentPart
size, storage
 
Constructor Summary
EmailHeadersPart(EmailData headers, EmailContentPart content)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns whether or not this emailHeadersPart is equal to the given object
 void getContent(Continuation command)
          Returns the content of this part
 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.
 void getHeaders(Continuation command)
          Returns the headers of this EmailPart to the continuation
 int hashCode()
          Returns the hashCode
 void setStorage(StorageService storage)
          Method which sets this part's storage service
 void storeData(Continuation command)
          Method which writes this part's headers out to disk and retrieves a reference to it.
 
Methods inherited from class rice.email.EmailContentPart
getSize, setSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headers

protected transient java.lang.ref.SoftReference headers
The data representing the haeders (transient as it is stored).


headersReference

public EmailDataReference headersReference
A reference to the headers of this email part


content

public EmailContentPart content
The content of this part


unstoredHeaders

protected transient EmailData unstoredHeaders
A reference to the headers which is non-soft

Constructor Detail

EmailHeadersPart

public EmailHeadersPart(EmailData headers,
                        EmailContentPart content)
Constructor. Takes in a emailData representing the headers and a EmailContentPart representing the content

Parameters:
headers - The headers of this part
content - The content of this part
Method Detail

setStorage

public void setStorage(StorageService storage)
Method which sets this part's storage service

Overrides:
setStorage in class EmailContentPart
Parameters:
storage - The local storage service

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.

Specified by:
getContentHashReferences in class EmailContentPart
Parameters:
set - The set to add the PastContentHandles to.

getHeaders

public void getHeaders(Continuation command)
Returns the headers of this EmailPart to the continuation

Parameters:
commmand - The command to run once the result has been obtained

getContent

public void getContent(Continuation command)
Returns the content of this part

Specified by:
getContent in class EmailContentPart
Parameters:
command - The command to run once the data is available

storeData

public void storeData(Continuation command)
Method which writes this part's headers out to disk and retrieves a reference to it.

Specified by:
storeData in class EmailContentPart
Parameters:
command - The command to run once the data has been stored, and is returned the success or failure of this command

hashCode

public int hashCode()
Returns the hashCode

Specified by:
hashCode in class EmailContentPart

equals

public boolean equals(java.lang.Object o)
Returns whether or not this emailHeadersPart is equal to the given object

Specified by:
equals in class EmailContentPart
Parameters:
o - The object to compare to
Returns:
Whether or not this is equal to o

ePOST API

Copyright © 2001-2005 - Rice Pastry.