|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.client.Service
com.google.gdata.client.GoogleService
com.google.gdata.client.media.MediaService
com.google.gdata.client.appsforyourdomain.migration.MailItemService
public class MailItemService
The MailItemService class is a MediaService
that can upload mail to
the Google Apps Email Migration API.
The recommended way to perform mail migration is to issue multipart POST requests, where the first part contains an Atom entry specifying the message properties and labels, and the second part contains the complete RFC822 message as UTF-8 text.
Nested Class Summary | |
---|---|
static class |
MailItemService.Versions
|
Nested classes/interfaces inherited from class com.google.gdata.client.GoogleService |
---|
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedException |
Nested classes/interfaces inherited from class com.google.gdata.client.Service |
---|
Service.ClientInputProperties, Service.ClientOutputProperties, Service.ClientStreamProperties, Service.GDataRequest, Service.GDataRequestFactory |
Field Summary | |
---|---|
static java.lang.String |
APPS_APIS_DOMAIN
Domain for sending API requests. |
static Version |
DEFAULT_VERSION
Version 1 is the current default version for MailItemService. |
static java.lang.String |
URL_PREFIX
URL prefix for accessing migration feeds. |
static java.lang.String |
URL_SUFFIX
URL suffix for the mail item batch feed. |
Fields inherited from class com.google.gdata.client.media.MediaService |
---|
DEFAULT_CHUNKED_BUFFER_SIZE, NO_CHUNKED_MEDIA_REQUEST |
Fields inherited from class com.google.gdata.client.Service |
---|
connectTimeout, extProfile, metadataRegistry, requestFactory |
Constructor Summary | |
---|---|
MailItemService(java.lang.String applicationName)
Constructs a MailItemService instance for an application with the
name applicationName . |
|
MailItemService(java.lang.String applicationName,
java.lang.String protocol,
java.lang.String domainName)
Constructs a MailItemService instance connecting to the service
with name serviceName for an application with the name
applicationName . |
Method Summary | |
---|---|
MailItemFeed |
batch(java.lang.String domain,
java.lang.String userName,
MailItemFeed feed)
Inserts one or more MailItem entries in a single batch operation. |
Methods inherited from class com.google.gdata.client.media.MediaService |
---|
getDefaultAltRegistry, getMedia, getMedia, insert, insert, setChunkedMediaUpload, update, updateMedia, updateMedia |
Methods inherited from class com.google.gdata.client.GoogleService |
---|
addCookie, batch, createRequest, createRequest, delete, delete, getAuthToken, getAuthTokenFactory, getCookieManager, getCookies, getEntry, getEntry, getFeed, getFeed, getFeed, getFeed, handleRedirectException, handlesCookies, handleSessionExpiredException, makePostRequest, setAuthSubToken, setAuthSubToken, setAuthTokenFactory, setCookieManager, setHandlesCookies, setOAuthCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserToken, tokenChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Version DEFAULT_VERSION
public static final java.lang.String APPS_APIS_DOMAIN
public static final java.lang.String URL_PREFIX
public static final java.lang.String URL_SUFFIX
Constructor Detail |
---|
public MailItemService(java.lang.String applicationName)
MailItemService
instance for an application with the
name applicationName
.
applicationName
- the name of the client application accessing the
service. Application names should preferably have the format
[company-id]-[app-name]-[app-version]. The name will be used by the
Google servers to monitor the source of authentication.public MailItemService(java.lang.String applicationName, java.lang.String protocol, java.lang.String domainName)
MailItemService
instance connecting to the service
with name serviceName
for an application with the name
applicationName
. The service will authenticate at the provided
domainName
.
applicationName
- the name of the client application accessing the
service. Application names should preferably have the format
[company-id]-[app-name]-[app-version]. The name will be used by the
Google servers to monitor the source of authentication.protocol
- name of protocol to use for authentication ("http"/"https")domainName
- the name of the domain hosting the login handlerMethod Detail |
---|
public MailItemFeed batch(java.lang.String domain, java.lang.String userName, MailItemFeed feed) throws BatchInterruptedException, java.io.IOException, java.net.MalformedURLException, ServiceException
batch
instead of repeated calls to insert
is helpful in
reducing HTTP overhead.
domain
- the domain into which mail is being migratedfeed
- a feed containing one or more MailItemEntry
objects,
each of which has been tagged with
BatchUtils#setBatchId(com.google.gdata.data.BaseEntry,
String)
. The batch operation type of each entry must be
BatchOperationType.INSERT
; however, there should be no
need to call BatchUtils.setBatchOperationType
on each
entry, as this operation is already the default.
MailItemEntry
object.
java.io.IOException
- if an error occurs while communicating with the GData
service.
java.net.MalformedURLException
- if the batch feed URL cannot be constructed.
ServiceException
- if the insert request failed due to system error.
BatchInterruptedException
- if an irrecoverable error was detected
by the server while parsing the request,
like invalid XML data. Some operations
might have succeeded when this exception
is thrown. Check BatchInterruptedException.getFeed()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |