# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client.appsforyourdomain
Class AppsForYourDomainService

    java.lang.Object
      com.google.gdata.client.Service
          com.google.gdata.client.GoogleService
              com.google.gdata.client.appsforyourdomain.AppsForYourDomainService

All Implemented Interfaces:
  AuthTokenFactory.TokenListener

Direct Known Subclasses:
  AppsPropertyService, EmailListRecipientService, EmailListService, GmailFilterService, NicknameService, UserService

    public abstract class AppsForYourDomainService

extends GoogleService

The AppsForYourDomainService class extends the basic `GoogleService` abstraction to define a service that is preconfigured for access to the Google Apps for Your Domain GData API.

Nested Class Summary

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, Service.Versions`

Field Summary
`static java.lang.String` `APPS_SERVICE` The abbreviated name of Apps for Your Domain recognized by Google.
`static java.lang.String` `DOMAIN_NAME` The domain which hosts the the authentication.
`static java.lang.String` `HTTPS_PROTOCOL` The protocol used to obtain authentication tokens.

Fields inherited from class com.google.gdata.client.Service
`connectTimeout, extProfile, metadataRegistry, requestFactory`

Constructor Summary
`AppsForYourDomainService(java.lang.String applicationName)` Constructs a AppsForYourDomainService instance for an application with the name `applicationName`.
`AppsForYourDomainService(java.lang.String applicationName, java.lang.String protocol, java.lang.String domainName)` Constructs a GoogleService instance connecting to the service with name `serviceName` for an application with the name `applicationName`.

Method Summary
`void` `delete(java.net.URL entryUrl)` Deletes an existing entry (and associated media content, if any) using the specified edit URL.

`protected

`<E extends IEntry,F extends IFeed> java.util.List<E>`

`

`getAllPages(java.net.URL feedUrl, java.lang.Class<F> feedClass)`
Executes a GData query against the target service and returns a List containing all the `IEntry` that match the query result.

`

`<E extends IEntry> E`

`

`getEntry(java.net.URL entryUrl, java.lang.Class<E> entryClass)`
The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

`

`<E extends IEntry> E`

`

`getEntry(java.net.URL entryUrl, java.lang.Class<E> entryClass, DateTime ifModifiedSince)`
Returns an Atom entry instance, given the URL of the entry and an if-modified-since date.

`

`<F extends IFeed> F`

`

`getFeed(java.net.URL feedUrl, java.lang.Class<F> feedClass)`
The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

`

`<F extends IFeed> F`

`

`getFeed(java.net.URL feedUrl, java.lang.Class<F> feedClass, DateTime ifModifiedSince)`
Executes a GData query against the target service and returns the `IFeed` containing entries that match the query result, if it's been modified since the specified date.

`

`<E extends IEntry> E`

`

`insert(java.net.URL feedUrl, E entry)`
Inserts a new `IEntry` into a feed associated with the target service.

`

`<F extends IFeed> F`

`

`query(Query query, java.lang.Class<F> feedClass)`
The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

`

`<E extends IEntry> E`

`

`update(java.net.URL entryUrl, E entry)`
Updates an existing `IEntry` by writing it to the specified entry edit URL.

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, getStrictValidation, getVersion, initServiceVersion, introspect, parseResponseData, parseResponseData, patch, patch, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setStrictValidation, setTimeouts, startVersionScope, update, useSsl, writeRequestData, writeRequestData`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DOMAIN_NAME

    public static final java.lang.String DOMAIN_NAME

  The domain which hosts the the authentication.

  See Also:
    Constant Field Values

### HTTPS_PROTOCOL

    public static final java.lang.String HTTPS_PROTOCOL

  The protocol used to obtain authentication tokens.

  See Also:
    Constant Field Values

### APPS_SERVICE

    public static final java.lang.String APPS_SERVICE

  The abbreviated name of Apps for Your Domain recognized by Google. The service name is used while requesting an authentication token.

  See Also:
    Constant Field Values

Constructor Detail

### AppsForYourDomainService

    public AppsForYourDomainService(java.lang.String applicationName)

  Constructs a AppsForYourDomainService 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.

### AppsForYourDomainService

    public AppsForYourDomainService(java.lang.String applicationName,
                                    java.lang.String protocol,
                                    java.lang.String domainName)

  Constructs a GoogleService instance connecting to the service with name `serviceName` for an application with the name `applicationName`. The service will authenticate at the provided `domainName`.

  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.
    `protocol` - name of protocol to use for authentication ("http"/"https")
    `domainName` - the name of the domain hosting the login handler

Method Detail

### insert

    public <E extends IEntry> E insert(java.net.URL feedUrl,
                                       E entry)
                            throws java.io.IOException,
                                   ServiceException,
                                   AppsForYourDomainException

  Description copied from class: `Service`
  Inserts a new `IEntry` into a feed associated with the target service. It will return the inserted entry, including any additional attributes or extensions set by the GData server.

  Overrides:
    `insert` in class `GoogleService`
  Parameters:
    `feedUrl` - the POST URI associated with the target feed.
    `entry` - the new entry to insert into the feed.
  Returns:
    the newly inserted Entry returned by the service.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error communicating with the GData service.
    `ParseException` - error parsing the return entry data.
    `ServiceForbiddenException` - the inserted Entry has associated media content and can only be inserted using a media service.
    `ServiceException` - insert request failed due to system error.
  See Also:
    `IFeed.getEntryPostLink()`

### getEntry

    public <E extends IEntry> E getEntry(java.net.URL entryUrl,
                                         java.lang.Class<E> entryClass)
                              throws java.io.IOException,
                                     ServiceException,
                                     AppsForYourDomainException

  The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

  Overrides:
    `getEntry` in class `Service`
  Parameters:
    `entryUrl` - resource URL for the entry.
    `entryClass` - class used to represent service entries, not `null`.
  Returns:
    the entry referenced by the URL parameter.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error communicating with the GData service.
    `ParseException` - error parsing the returned entry.
    `ResourceNotFoundException` - if the entry URL is not valid.
    `ServiceForbiddenException` - if the GData service cannot get the entry resource due to access constraints.
    `ServiceException` - if a system error occurred when retrieving the entry.

### getFeed

    public <F extends IFeed> F getFeed(java.net.URL feedUrl,
                                       java.lang.Class<F> feedClass)
                            throws java.io.IOException,
                                   ServiceException,
                                   AppsForYourDomainException

  The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

  Overrides:
    `getFeed` in class `Service`
  Parameters:
    `feedUrl` - the URL associated with a feed. This URL can include GData query parameters.
    `feedClass` - the class used to represent a service Feed.
  Returns:
    Feed resource referenced by the input URL.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error sending request or reading the feed.
    `ParseException` - error parsing the returned feed data.
    `ResourceNotFoundException` - invalid feed URL.
    `ServiceException` - system error retrieving feed.

### query

    public <F extends IFeed> F query(Query query,
                                     java.lang.Class<F> feedClass)
                          throws java.io.IOException,
                                 ServiceException,
                                 AppsForYourDomainException

  The call to super.getEntry should fall through to Service and the behaviour is unknown if this method is overloaded in GoogleService.

  Overrides:
    `query` in class `Service`
  Parameters:
    `query` - Query instance defining target feed and query parameters.
    `feedClass` - the Class used to represent a service Feed, not `null`.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error communicating with the GData service.
    `ServiceForbiddenException` - feed does not support the query.
    `ParseException` - error parsing the returned feed data.
    `ServiceException` - query request failed.

### update

    public <E extends IEntry> E update(java.net.URL entryUrl,
                                       E entry)
                            throws java.io.IOException,
                                   ServiceException,
                                   AppsForYourDomainException

  Description copied from class: `Service`
  Updates an existing `IEntry` by writing it to the specified entry edit URL. The resulting Entry (after update) will be returned.

  Overrides:
    `update` in class `GoogleService`
  Parameters:
    `entryUrl` - the edit URL associated with the entry.
    `entry` - the modified Entry to be written to the server.
  Returns:
    the updated Entry returned by the service.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error communicating with the GData service.
    `ParseException` - error parsing the updated entry data.
    `ServiceException` - update request failed due to system error.
  See Also:
    `IEntry.getEditLink()`

### delete

    public void delete(java.net.URL entryUrl)
                throws java.io.IOException,
                       ServiceException,
                       AppsForYourDomainException

  Description copied from class: `Service`
  Deletes an existing entry (and associated media content, if any) using the specified edit URL.

  Overrides:
    `delete` in class `GoogleService`
  Parameters:
    `entryUrl` - the edit or medit edit url associated with the resource.
  Throws:
    `AppsForYourDomainException` - If an Apps for Your Domain API error occurred.
    `java.io.IOException` - error communicating with the GData service.
    `ResourceNotFoundException` - invalid entry URL.
    `ServiceException` - delete request failed due to system error.

### getEntry

    public <E extends IEntry> E getEntry(java.net.URL entryUrl,
                                         java.lang.Class<E> entryClass,
                                         DateTime ifModifiedSince)
                              throws java.io.IOException,
                                     ServiceException

  Returns an Atom entry instance, given the URL of the entry and an if-modified-since date. Note that this method is overriden to prevent the usage of a non-null if-modified-since value. The Google Apps for Your Domain Provisioning API does not support the use of the if-modified-since value.

  Overrides:
    `getEntry` in class `GoogleService`
  Parameters:
    `entryUrl` - resource URL for the entry.
    `entryClass` - class used to represent service entries.
    `ifModifiedSince` - used to set a precondition date that indicates the entry should be returned only if it has been modified after the specified date. A value of `null` indicates no precondition.
  Returns:
    the entry referenced by the URL parameter.
  Throws:
    `java.io.IOException` - error communicating with the GData service.
    `NotModifiedException` - if the entry resource has not been modified after the specified precondition date.
    `ParseException` - error parsing the returned entry.
    `ResourceNotFoundException` - if the entry URL is not valid.
    `ServiceForbiddenException` - if the GData service cannot get the entry resource due to access constraints.
    `ServiceException` - if a system error occurred when retrieving the entry.

### getFeed

    public <F extends IFeed> F getFeed(java.net.URL feedUrl,
                                       java.lang.Class<F> feedClass,
                                       DateTime ifModifiedSince)
                            throws java.io.IOException,
                                   ServiceException

  Executes a GData query against the target service and returns the `IFeed` containing entries that match the query result, if it's been modified since the specified date. Note that this method is overridden to prevent the usage of a non-null if-modified-since value. The Google Apps for Your Domain Provisioning API does not support the use of the if-modified-since value.

  Overrides:
    `getFeed` in class `GoogleService`
  Parameters:
    `feedClass` - the Class used to represent a service Feed.
    `ifModifiedSince` - used to set a precondition date that indicates the query result feed should be returned only if contains entries that have been modified after the specified date. A value of `null` indicates no precondition.
    `feedUrl` - the URL associated with a feed. This URL can include GData query parameters.
  Returns:
    Feed resource referenced by the input URL.
  Throws:
    `java.io.IOException` - error communicating with the GData service.
    `NotModifiedException` - if the query resource does not contain entries modified since the specified precondition date.
    `ServiceForbiddenException` - feed does not support the query.
    `ParseException` - error parsing the returned feed data.
    `ServiceException` - query request failed.

### getAllPages

    protected <E extends IEntry,F extends IFeed> java.util.List<E> getAllPages(java.net.URL feedUrl,
                                                                               java.lang.Class<F> feedClass)
                                                    throws java.io.IOException,
                                                           ServiceException

  Executes a GData query against the target service and returns a List containing all the `IEntry` that match the query result. This method will page through the feed and return all matching records to the client. Should be only used by services that have paged resultsets.

  Please note that this method may take a very long time to execute for feeds with thousands of entries.

  Parameters:
    `feedUrl` - resource URL of the feed
    `feedClass` - class used to represent service entries
  Returns:
    List of `IEntry`
  Throws:
    `java.io.IOException` - error communicating with the GData service
    `ServiceForbiddenException` - feed does not support the query.
    `ParseException` - error parsing the returned feed data.
    `ServiceException` - query request failed.