Class TrelloApiReader

Direct Known Subclasses:
TrelloBoardCardsReader, TrelloBoardListsReader, TrelloBoardsReader, TrelloListCardsReader

public abstract class TrelloApiReader extends IntegrationReader
Superclass for Trello readers supporting pagination.
  • Field Details

    • trelloStub

      protected TrelloStub trelloStub
  • Constructor Details

    • TrelloApiReader

      public TrelloApiReader(String apiKey, String apiToken)
  • Method Details

    • getBatchSize

      public int getBatchSize()
      Returns the page size sent to Trello as limit (always 1000); a smaller page ends the read.
    • getSince

      public Date getSince()
      Returns the date sent to Trello as the since parameter, or null if none (the default).
    • setSince

      public TrelloApiReader setSince(Date since)
      Sets the date sent to Trello as the since parameter; only takes effect if set before open().
    • getBefore

      public Date getBefore()
      Returns the date sent to Trello as the before parameter, or null if none (the default).
    • setBefore

      public TrelloApiReader setBefore(Date before)
      Sets the date sent to Trello as the before parameter; only takes effect if set before open().
    • 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() throws DataException
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class DataEndpoint
      Throws:
      DataException
    • 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
    • readNextBatchImpl

      protected abstract ArrayValue readNextBatchImpl()
      Fetches the next page of items as records using trelloStub; each item needs an id field and a page smaller than getBatchSize() ends the read.
    • 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 DataReader