public abstract class

AppsForYourDomainService

extends GoogleService
java.lang.Object
   ↳ com.google.gdata.client.Service
     ↳ com.google.gdata.client.GoogleService
       ↳ com.google.gdata.client.appsforyourdomain.AppsForYourDomainService
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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.

Summary

Constants
String APPS_SERVICE The abbreviated name of Apps for Your Domain recognized by Google.
String DOMAIN_NAME The domain which hosts the the authentication.
String HTTPS_PROTOCOL The protocol used to obtain authentication tokens.
[Expand]
Inherited Fields
From class com.google.gdata.client.GoogleService
From class com.google.gdata.client.Service
Public Constructors
AppsForYourDomainService(String applicationName)
Constructs a AppsForYourDomainService instance for an application with the name applicationName.
AppsForYourDomainService(String applicationName, String protocol, String domainName)
Constructs a GoogleService instance connecting to the service with name serviceName for an application with the name applicationName.
Public Methods
void delete(URL entryUrl)
Deletes an existing entry (and associated media content, if any) using the specified edit URL.
<E extends IEntry> E getEntry(URL entryUrl, Class<E> entryClass, DateTime ifModifiedSince)
Returns an Atom entry instance, given the URL of the entry and an if-modified-since date.
<E extends IEntry> E getEntry(URL entryUrl, 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.
<F extends IFeed> F getFeed(URL feedUrl, 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.
<F extends IFeed> F getFeed(URL feedUrl, 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 insert(URL feedUrl, E entry)
Inserts a new IEntry into a feed associated with the target service.
<F extends IFeed> F query(Query query, 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(URL entryUrl, E entry)
Updates an existing IEntry by writing it to the specified entry edit URL.
Protected Methods
<E extends IEntry, F extends IFeed> List<E> getAllPages(URL feedUrl, Class<F> feedClass)
Executes a GData query against the target service and returns a List containing all the IEntry that match the query result.
[Expand]
Inherited Methods
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_SERVICE

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

Constant Value: "apps"

public static final String DOMAIN_NAME

The domain which hosts the the authentication.

Constant Value: "www.google.com"

public static final String HTTPS_PROTOCOL

The protocol used to obtain authentication tokens.

Constant Value: "https"

Public Constructors

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

public AppsForYourDomainService (String applicationName, String protocol, 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

Public Methods

public void delete (URL entryUrl)

Deletes an existing entry (and associated media content, if any) using the specified edit URL.

Parameters
entryUrl The edit or medit edit url associated with the resource.
Throws
AppsForYourDomainException If an Apps for Your Domain API error occurred.
IOException
ServiceException

public E getEntry (URL entryUrl, Class<E> entryClass, DateTime ifModifiedSince)

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.

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
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.

public E getEntry (URL entryUrl, 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.

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.
IOException
ServiceException

public F getFeed (URL feedUrl, 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. 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.

Parameters
feedUrl The URL associated with a feed. This URL can include GData query 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.
Returns
  • Feed resource referenced by the input URL.
Throws
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.

public F getFeed (URL feedUrl, 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.

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.
IOException
ServiceException

public E insert (URL feedUrl, E entry)

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.

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.
IOException
ServiceException

public F query (Query query, 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.

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.
IOException
ServiceException

public E update (URL entryUrl, E entry)

Updates an existing IEntry by writing it to the specified entry edit URL. The resulting Entry (after update) will be returned.

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.
IOException
ServiceException

Protected Methods

protected List<E> getAllPages (URL feedUrl, Class<F> feedClass)

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
Throws
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.