Class GoogleContactsReader


public class GoogleContactsReader extends GoogleApiReader
Reads a Google account's contacts through the People API, one record per person with their names, email addresses, phone numbers, addresses and other details.
  • Constructor Details

    • GoogleContactsReader

      public GoogleContactsReader(Credential credential, HttpTransport httpTransport)
      Creates a reader that uses the caller's transport, which is not shut down on close.
  • Method Details

    • getPersonFields

      public String getPersonFields()
      Returns the comma-separated person fields requested for each contact.
    • setPersonFields

      public GoogleContactsReader setPersonFields(String personFields)
      Sets the comma-separated person fields requested for each contact.
    • getResource

      public String getResource()
      Returns the resource name whose connections are read (defaults to "people/me").
    • setResource

      public GoogleContactsReader setResource(String resource)
      Sets the resource name whose connections are read (defaults to "people/me").
    • getBatchSize

      public int getBatchSize()
      Returns the number of contacts requested per page (defaults to 50).
    • setBatchSize

      public GoogleContactsReader setBatchSize(int batchSize)
      Sets the number of contacts requested per page, from 1 to 100 (defaults to 50).
    • getException

      public DataException getException()
      Returns the pending error recorded by this reader (such as a failed batch request) or null; the next read throws it.
    • open

      public void open() throws DataException
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class IntegrationReader
      Throws:
      DataException
    • close

      public void close()
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class GoogleApiReader
    • readImpl

      protected Record readImpl() throws Throwable
      Description copied from class: DataReader
      Overridden by subclasses to read the next record from this DataReader. The default implementation of DataReader.read() now insures that this method will not be called again after it returns a null.

      If no record is available, null will be returned.

      Contract for subclasses (see also docs/authoring/DataReader.md):

      Specified by:
      readImpl in class DataReader
      Throws:
      Throwable
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Endpoint
      Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class GoogleApiReader