com.google.gdata.data.appsforyourdomain.migration
Class MailItemEntry

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.BaseEntry<E>
              extended by com.google.gdata.data.media.MediaEntry<MailItemEntry>
                  extended by com.google.gdata.data.appsforyourdomain.migration.MailItemEntry
All Implemented Interfaces:
Extension, IAtom, IEntry, Kind.Adaptable, Kind.Adaptor, IMediaEntry

public class MailItemEntry
extends MediaEntry<MailItemEntry>

Used by a MailItemFeedProvider to represent a single MailItemEntry in a list of MailItems. MailItems are representations of email messages from a domain's legacy systems destined for Google.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.BaseEntry
BaseEntry.AtomHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Field Summary
static Category MAILITEM_CATEGORY
          Kind category used to label feeds or entries that have MailItem extension data.
static java.lang.String MAILITEM_KIND
          Kind term value for MailItem category labels.
 
Constructor Summary
MailItemEntry()
          Constructs a new MailItemEntry instance
MailItemEntry(BaseEntry<MailItemEntry> sourceEntry)
          Constructs a new MailItemEntry instance by doing a shallow copy of data from an existing BaseEntry instance.
 
Method Summary
 void addLabel(Label label)
          Adds a label to this MailItem
 void addMailProperty(MailItemProperty mailProperty)
          Sets mail settings (read status, starred status, etc.) for this message.
 void addRecipient(Email recipient)
          Adds a recipient email to the Mail Item.
 void declareExtensions(ExtensionProfile extProfile)
          Initializes an ExtensionProfile based upon the extensions expected by a MailItemEntry.
 java.util.List<Label> getLabels()
           
 java.util.List<MailItemProperty> getMailProperties()
           
 java.util.List<Email> getRecipients()
          This is relevant only for multi recipient feed.
 Rfc822Msg getRfc822Msg()
           
 void setRfc822Msg(Rfc822Msg rfc822Msg)
          Sets the rfc822Msg for this MailItem
 
Methods inherited from class com.google.gdata.data.media.MediaEntry
getMediaEditLink, getMediaSource, setMediaSource, setService, updateMedia
 
Methods inherited from class com.google.gdata.data.BaseEntry
addAdaptor, addHtmlLink, addLink, addLink, delete, generate, generateAtom, generateRss, getAdaptedEntry, getAdaptor, getAdaptors, getAuthors, getCanEdit, getCategories, getContent, getContributors, getEdited, getEditLink, getEtag, getHandler, getHtmlLink, getId, getKind, getLink, getLinks, getLinks, getPlainTextContent, getPubControl, getPublished, getResumableEditMediaLink, getRights, getSelectedFields, getSelf, getSelfLink, getService, getSource, getSummary, getTextContent, getTitle, getUpdated, getVersionId, isDraft, parseAtom, parseAtom, parseAtom, readEntry, readEntry, removeLinks, removeLinks, setCanEdit, setContent, setContent, setDraft, setEdited, setEtag, setId, setKind, setPubControl, setPublished, setRights, setSelectedFields, setSource, setSummary, setTitle, setUpdated, setVersionId, update
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addRepeatingExtension, generateCumulativeXmlBlob, getExtension, getExtensions, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit
 
Methods inherited from class com.google.gdata.data.AbstractExtension
disableStrictValidation, enableStrictValidation, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, setImmutable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.IEntry
getCanEdit, getContent, getEdited, getEditLink, getPublished, getResumableEditMediaLink, getSelectedFields, getSummary, setCanEdit, setEdited, setPublished, setSelectedFields
 
Methods inherited from interface com.google.gdata.data.IAtom
addLink, getAuthors, getCategories, getEtag, getId, getKind, getLink, getLinks, getSelfLink, getTitle, getUpdated, getVersionId, removeLinks, removeLinks, setEtag, setId, setKind, setUpdated, setVersionId
 

Field Detail

MAILITEM_KIND

public static final java.lang.String MAILITEM_KIND
Kind term value for MailItem category labels.

See Also:
Constant Field Values

MAILITEM_CATEGORY

public static final Category MAILITEM_CATEGORY
Kind category used to label feeds or entries that have MailItem extension data.

Constructor Detail

MailItemEntry

public MailItemEntry()
Constructs a new MailItemEntry instance


MailItemEntry

public MailItemEntry(BaseEntry<MailItemEntry> sourceEntry)
Constructs a new MailItemEntry instance by doing a shallow copy of data from an existing BaseEntry instance.

Parameters:
sourceEntry - the BaseEntry object to copy from
Method Detail

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Initializes an ExtensionProfile based upon the extensions expected by a MailItemEntry.

Specified by:
declareExtensions in interface Kind.Adaptor
Overrides:
declareExtensions in class ExtensionPoint
Parameters:
extProfile - the ExtensionProfile to initialize.
See Also:
ExtensionProfile.addDeclarations(Kind.Adaptor)

getRfc822Msg

public Rfc822Msg getRfc822Msg()
Returns:
the rfc822 compliant encoding of the mail message

setRfc822Msg

public void setRfc822Msg(Rfc822Msg rfc822Msg)
Sets the rfc822Msg for this MailItem


getMailProperties

public java.util.List<MailItemProperty> getMailProperties()
Returns:
the mail settings (read status, starred status, etc.) of the mail message

addMailProperty

public void addMailProperty(MailItemProperty mailProperty)
Sets mail settings (read status, starred status, etc.) for this message.


getLabels

public java.util.List<Label> getLabels()
Returns:
a list of Labels to be applied to this message upon insertion in GMail

addLabel

public void addLabel(Label label)
Adds a label to this MailItem

Parameters:
label - the label to add to the message when it is imported into GMail

getRecipients

public java.util.List<Email> getRecipients()
This is relevant only for multi recipient feed. The single recipient case will not contain the email address of recipient.

Returns:
a list of recipients' email addresses for this mail item

addRecipient

public void addRecipient(Email recipient)
Adds a recipient email to the Mail Item.

Parameters:
recipient - the recipient email to be attached with the message