ComplexTable< CTOBJ > class

The ComplexTable class encapsulates the data retrieval for a complex table within an Agentry-based application.

Syntax

public abstract class ComplexTable< CTOBJ > extends AgentryJavaBackEndManagedObject

Members

All members of ComplexTable< CTOBJ >, including inherited members.

Variables
Modifier and Type Variable Description
protected SycloCalendar _clientLastDataUpdateTime Storage for the client's last update time that was passed into the constructor.
protected boolean _rebuilding This member will be set by the Agentry Server to whatever the willRebuildTable() method returns.
protected ComplexTableSession _session Storage for the session that was passed into the constructor.
Methods
Modifier and Type Method Description
public void build() This method is called by the Agentry Server after it calls willRebuildTable(), but before it calls dataIterator() or deleteIterator().
final boolean checkForReload() This method is called by the Agentry Server to indicate whether a reload should be done.
public ComplexTable(ComplexTableSession, GregorianCalendar) Constructs a new ComplexTable object.
public abstract Iterator< CTOBJ > dataIterator() This method should return either a partial or complete list of the records for the complex table, depending on the result of calling willRebuildTable().
public Iterator< CTOBJ > deleteIterator() This method should return a list of the records that have been deleted from the complex table since the client's last update time, which can be retrieved via getClientLastDataUpdateTime()).
public SycloCalendar getClientLastDataUpdateTime() Returns the time when the client last retrieved data for this complex table.
public GregorianCalendar getNewDataUpdateTime() Returns the new "last data update time", as set by a prior call to setNewDataUpdateTime.
public ComplexTableSession getSession() Return the session for this complex table transmission.
public final void initialize() Deprecated. Subclass overrides of this method should be renamed to build(). This method has been renamed to build().
public boolean isRebuilding() This method returns the previously cached result of the Agentry Server's call to the willRebuildTable() method.
final int lastUpdateDate() Returns the day-of-month component of the complex table data's last update time.
final int lastUpdateHours() Returns the hour component of the complex table data's last update time.
final int lastUpdateMinutes() Returns the minute component of the complex table data's last update time.
final int lastUpdateMonth() Returns the month component of the complex table data's last update time.
final int lastUpdateSeconds() Returns the seconds component of the complex table data's last update time.
final int lastUpdateYear() Returns the year component of the complex table data's last update time.
public final boolean reload() Deprecated. Subclass overrides of this method should be renamed to willRebuildTable(). This method has been renamed to willRebuildTable().
public void setNewDataUpdateTime(GregorianCalendar) This method sets the new "last data update time" for the complex table.
public boolean willRebuildTable() This method is called by the Agentry server to determine whether the server should rebuild the client's complex table from scratch.

Usage

When implementing a complex table using a Java Interface system connection, this class will always be extended.

Complex tables in Agentry support both full and incremental updates. It is up to an implementing subclass to determine which mechanism to use, based on whether the underlying data source supports time-stamped data. If it does, an implementation can return a "last update" timestamp along with the complex table data. The next time a client requests an update of the table, it will pass back that timestamp, and this class can then return only the data changes (additions, updates, and deletions) that have occurred since that time.

Data objects are returned from this class to the Agentry server via iterators. The data objects themselves are structured in the same manner as the data objects for a Steplet, in that their data is stored in public member fields that are accessed directly by Agentry, and are mapped to corresponding fields in the Complex Table when the table is defined in the Agentry Editor.

The synchronization process for a complex table involves determining first which records have been deleted from the complex table and retrieving those records' unique identifiers. Then, the records that have been added or updated since the last client update are retrieved. The Agentry Server will call the methods of this class in the following sequence:

  1. Constructor - passes in the client's last update date
  2. willRebuildTable() - tells Agentry whether to expect a full or incremental update
  3. build() - can be used to gather records
  4. dataIterator() - returns new or updated records
  5. lastUpdate* methods - returns the new data timestamp (set via a call to setNewDataUpdateTime)
  6. deleteIterator() - returns keys for deleted records; may not be called if willRebuildTable() returned true
  7. lastUpdate* methods (again - should return the same value as the previous call); may not be called if willRebuildTable() returned true

Note that for each client transmit, a new instance of this class is created by the Agentry server.