|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBEntry
com.antelmann.net.mail.MessageEntry
public class MessageEntry
A wrapper around a Message object that allows for database storage and serialization.
Note that overriding classes must implement readObject(java.io.ObjectInputStream)
and writeObject(java.io.ObjectOutputStream) in order to support serialization
(without using default read/write - you will have to use reflection to do the entire thing).
serialize(),
unwrap(),
Misc.setValue(Object, String, Object),
AbstractDBEntry.id,
Serialized Form| Field Summary |
|---|
| Fields inherited from interface com.antelmann.calendar.Timed |
|---|
COMPARATOR, DATE_EXTRACTOR |
| Fields inherited from interface com.antelmann.db.DBEntry |
|---|
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR |
| Constructor Summary | |
|---|---|
|
MessageEntry(byte[] data)
|
|
MessageEntry(InputStream in)
|
|
MessageEntry(javax.mail.Message msg)
|
|
MessageEntry(MessageEntry entry)
|
protected |
MessageEntry(Object id,
InputStream in)
used by MessageEntryMapper; calls check() |
|
MessageEntry(Object id,
javax.mail.Message msg)
|
| Method Summary | |
|---|---|
protected void |
check()
checks whether the ID is consistent w/ the message id |
static javax.mail.Message |
createMessage(InputStream in)
|
void |
exportEML(OutputStream out)
|
static String |
extractID(javax.mail.Message msg)
|
static String |
getAddressString(javax.mail.Address[] list)
|
int |
getAttachmentCount()
|
String |
getFromString()
|
String |
getRecipientString(javax.mail.Message.RecipientType rt)
if rt is null, all recipients are used |
long |
getTime()
|
String |
hashContent()
|
void |
serialize()
writes the full message to binary form, so that it is fully available even though an underlying Folder may have been closed. |
javax.mail.Message |
unwrap()
Note that the return value may refer to a different instance after serialize() was called! |
| Methods inherited from class com.antelmann.db.AbstractDBEntry |
|---|
equals, getID, hashCode, hashEntry, sameEntry, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MessageEntry(MessageEntry entry)
public MessageEntry(javax.mail.Message msg)
throws IOException,
javax.mail.MessagingException
IOException
javax.mail.MessagingException
public MessageEntry(byte[] data)
throws javax.mail.MessagingException,
IOException
javax.mail.MessagingException
IOException
public MessageEntry(InputStream in)
throws javax.mail.MessagingException,
IOException
javax.mail.MessagingException
IOException
protected MessageEntry(Object id,
InputStream in)
throws javax.mail.MessagingException,
IOException
MessageEntryMapper; calls check()
javax.mail.MessagingException
IOException
public MessageEntry(Object id,
javax.mail.Message msg)
| Method Detail |
|---|
protected void check()
throws IllegalArgumentException,
javax.mail.MessagingException
IllegalArgumentException
javax.mail.MessagingException
public void serialize()
throws IOException,
javax.mail.MessagingException
Folder before you close the same, so that the full
data is maintained independently.
NOTE: After this method is called, the return value of unwrap() REFERS TO A DIFFERENT
INSTANCE now as a previous call to the same method!
This is because unwrap() will reconstruct a new Message instance from binary data
after serialize() was called.
Also, the original Folder (that gets lost during serialization) is replaced with a
LocalSerializedFolderWrapper, so that some useful information is maintained even after serialization.
IOException
javax.mail.MessagingExceptionpublic javax.mail.Message unwrap()
serialize() was called!
unwrap in interface Wrapped<javax.mail.Message>serialize()public long getTime()
getTime in interface Timed
public String getRecipientString(javax.mail.Message.RecipientType rt)
throws javax.mail.MessagingException
javax.mail.MessagingException
public String getFromString()
throws javax.mail.MessagingException
javax.mail.MessagingException
public String hashContent()
throws IOException,
javax.mail.MessagingException
IOException
javax.mail.MessagingException
public int getAttachmentCount()
throws javax.mail.MessagingException,
IOException
javax.mail.MessagingException
IOException
public void exportEML(OutputStream out)
throws IOException,
javax.mail.MessagingException
IOException
javax.mail.MessagingExceptionpublic static String getAddressString(javax.mail.Address[] list)
public static String extractID(javax.mail.Message msg)
throws javax.mail.MessagingException
javax.mail.MessagingException
public static javax.mail.Message createMessage(InputStream in)
throws javax.mail.MessagingException
javax.mail.MessagingException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||