Google Data APIs Client Library (1.41.1)
com.google.gdata.client.appsforyourdomain.gmailsettings
Class GmailFilterService
java.lang.Object
com.google.gdata.client.Service
com.google.gdata.client.GoogleService
com.google.gdata.client.appsforyourdomain.AppsForYourDomainService
com.google.gdata.client.appsforyourdomain.gmailsettings.GmailFilterService
- All Implemented Interfaces:
- AuthTokenFactory.TokenListener
public class GmailFilterService
- extends AppsForYourDomainService
The GmailFilterService class extends the basic AppsForYourDomainService
abstraction to define a service that is preconfigured for access to the
the Google Apps Gmail Settings API.
Field Summary |
static java.lang.String |
APPS_APIS_DOMAIN
Domain for sending API requests. |
static java.lang.String |
BATCH_URL_SUFFIX
URL suffix for the Gmail filter batch feed. |
static java.lang.String |
URL_PREFIX
URL prefix for accessing Gmail setting feeds. |
static java.lang.String |
URL_SUFFIX
URL suffix for the single Gmail filter feed. |
Constructor Summary |
GmailFilterService(java.lang.String applicationName)
Constructs a GmailFilterService instance for an application with
the name applicationName . |
Methods inherited from class com.google.gdata.client.GoogleService |
addCookie, batch, createRequest, createRequest, delete, getAuthToken, getAuthTokenFactory, getCookieManager, getCookies, getEntry, getFeed, getFeed, getFeed, handleRedirectException, handlesCookies, handleSessionExpiredException, makePostRequest, setAuthSubToken, setAuthSubToken, setAuthTokenFactory, setCookieManager, setHandlesCookies, setOAuthCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserToken, tokenChanged |
Methods inherited from class com.google.gdata.client.Service |
classOf, createBatchRequest, createDeleteRequest, createEntryRequest, createFeedRequest, createFeedRequest, createInsertRequest, createLinkQueryRequest, createPatchRequest, createUpdateRequest, delete, delete, endVersionScope, getAltRegistry, getContentType, getDefaultAltRegistry, getExtensionProfile, getFeed, getMetadataRegistry, getProtocolVersion, getRequestFactory, getSchema, getServiceVersion, getStreamFromLink, getVersion, initServiceVersion, introspect, parseResponseData, parseResponseData, patch, patch, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setTimeouts, startVersionScope, update, useSsl, writeRequestData, writeRequestData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
APPS_APIS_DOMAIN
public static final java.lang.String APPS_APIS_DOMAIN
- Domain for sending API requests.
- See Also:
- Constant Field Values
URL_PREFIX
public static final java.lang.String URL_PREFIX
- URL prefix for accessing Gmail setting feeds.
- See Also:
- Constant Field Values
URL_SUFFIX
public static final java.lang.String URL_SUFFIX
- URL suffix for the single Gmail filter feed.
- See Also:
- Constant Field Values
BATCH_URL_SUFFIX
public static final java.lang.String BATCH_URL_SUFFIX
- URL suffix for the Gmail filter batch feed.
- See Also:
- Constant Field Values
GmailFilterService
public GmailFilterService(java.lang.String applicationName)
- Constructs a GmailFilterService instance for an application with
the name
applicationName
.
- Parameters:
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.
insert
public GenericEntry insert(java.lang.String domain,
GenericEntry entry)
throws java.io.IOException,
java.net.MalformedURLException,
ServiceException
- Inserts one Gmail filter entry.
- Parameters:
domain
- the domain into which the filter is being created.entry
- an GenericEntry
object containing all the properties
of a Gmail filter.
- Returns:
- an entry with the result of the operation.
- Throws:
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.
batch
public GenericFeed batch(java.lang.String domain,
GenericFeed feed)
throws BatchInterruptedException,
java.io.IOException,
java.net.MalformedURLException,
ServiceException
- Inserts one or more Gmail filter entries in a single batch operation. Using
batch
instead of repeated calls to #insert
is helpful in
reducing HTTP overhead.
- Parameters:
domain
- the domain into which filters are being created.feed
- a feed containing one or more GenericEntry
objects
containing all the properties of Gmail filters,
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(
com.google.gdata.data.BaseEntry, BatchOperationType)
on each
entry, as this operation is already the default.
- Returns:
- a feed with the result of each operation in a separate
GenericEntry
object.
- Throws:
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()
.