ePOST API

rice.email
Class EmailContentPart

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

public abstract class EmailContentPart
extends java.lang.Object
implements java.io.Serializable

Represents the content of an email

Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  int size
          The size of this part, in bytes
protected  StorageService storage
          The local storage service
 
Constructor Summary
EmailContentPart(int size)
          Constructor which takes in an EmailData
 
Method Summary
abstract  boolean equals(java.lang.Object o)
          Overridden to enforce subclasses have a valid equals
abstract  void getContent(Continuation command)
          Method which retrieves and returns this content's EmailData
abstract  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.
 int getSize()
          Returns the size of this part, in bytes
abstract  int hashCode()
          Overridden to enforce hashCode();
protected  void setSize(int size)
          Sets the size of this part, in bytes
 void setStorage(StorageService storage)
          Method which sets this part's storage service
abstract  void storeData(Continuation command)
          Method which writes this part's content out to disk and retrieves a reference to it.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
The size of this part, in bytes


storage

protected transient StorageService storage
The local storage service

Constructor Detail

EmailContentPart

public EmailContentPart(int size)
Constructor which takes in an EmailData

Method Detail

setSize

protected void setSize(int size)
Sets the size of this part, in bytes

Parameters:
size - The size of this part

getSize

public int getSize()
Returns the size of this part, in bytes

Returns:
The size of this part

setStorage

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

Parameters:
storage - The local storage service

storeData

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

Parameters:
command - The command to run once the data has been stored, and is returned the success or failure of this command

getContent

public abstract void getContent(Continuation command)
Method which retrieves and returns this content's EmailData

Parameters:
command - The command to run once the data is available

equals

public abstract boolean equals(java.lang.Object o)
Overridden to enforce subclasses have a valid equals

Overrides:
equals in class java.lang.Object

hashCode

public abstract int hashCode()
Overridden to enforce hashCode();

Overrides:
hashCode in class java.lang.Object

getContentHashReferences

public abstract 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.