public class

GmailFilterService

extends AppsForYourDomainService
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

Class Overview

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.

Summary

Constants
String APPS_APIS_DOMAIN Domain for sending API requests.
String BATCH_URL_SUFFIX URL suffix for the Gmail filter batch feed.
String URL_PREFIX URL prefix for accessing Gmail setting feeds.
String URL_SUFFIX URL suffix for the single Gmail filter feed.
[Expand]
Inherited Constants
From class com.google.gdata.client.appsforyourdomain.AppsForYourDomainService
[Expand]
Inherited Fields
From class com.google.gdata.client.GoogleService
From class com.google.gdata.client.Service
Public Constructors
GmailFilterService(String applicationName)
Constructs a GmailFilterService instance for an application with the name applicationName.
Public Methods
GenericFeed batch(String domain, GenericFeed feed)
Inserts one or more Gmail filter entries in a single batch operation.
GenericEntry insert(String domain, GenericEntry entry)
Inserts one Gmail filter entry.
[Expand]
Inherited Methods
From class com.google.gdata.client.appsforyourdomain.AppsForYourDomainService
From class com.google.gdata.client.GoogleService
From class com.google.gdata.client.Service
From class java.lang.Object
From interface com.google.gdata.client.AuthTokenFactory.TokenListener

Constants

public static final String APPS_APIS_DOMAIN

Domain for sending API requests.

Constant Value: "apps-apis.google.com"

public static final String BATCH_URL_SUFFIX

URL suffix for the Gmail filter batch feed.

Constant Value: "/email/settings/filter/batch"

public static final String URL_PREFIX

URL prefix for accessing Gmail setting feeds.

Constant Value: "/a/feeds/2.0"

public static final String URL_SUFFIX

URL suffix for the single Gmail filter feed.

Constant Value: "/email/settings/filter"

Public Constructors

public GmailFilterService (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.

Public Methods

public GenericFeed batch (String domain, GenericFeed feed)

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 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
IOException if an error occurs while communicating with the GData service.
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 getFeed().

public GenericEntry insert (String domain, GenericEntry entry)

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
IOException if an error occurs while communicating with the GData service.
MalformedURLException if the batch feed URL cannot be constructed.
ServiceException if the insert request failed due to system error.