at.spardat.xma.datasource
Interface ITableProvider

All Known Implementing Classes:
RessourceBundleProviderServer, XMATabularDataSourceServer

public interface ITableProvider

Is implemented by XMATabularDataSourceServer and must be implemented by an XMA project that provides an additional (custom) datasource.

The classes implementing this interface must be thread safe, i.e., explicitely care about synchronization.


Method Summary
 int getExpireDurationClientSecs(java.lang.String type)
          Defines the number of seconds a table of a particular type may be cached at the XMA client without calling the XMA-server for an uptodate check.
 int getExpireDurationServerSecs(java.lang.String type)
          Defines the number of seconds a table of a particular type may be cached at the server without calling provideTable again.
 ProviderResultServer provideTable(XMASession session, TableSpec spec, long lastModified)
          This method is requested to provide a table in the form of a ITabularData.
 

Method Detail

provideTable

public ProviderResultServer provideTable(XMASession session,
                                         TableSpec spec,
                                         long lastModified)
This method is requested to provide a table in the form of a ITabularData. If lastModified is not specified (if it is ITabularDataSource.UNKNOWN_TIMESTAMP), the callee must return the table. If lastModified is defined, the callee must provide a table if and only if the modification time changed. If the time of the last modification is still lastModified, the returned table in the result data may be null. The latter form has the semantics of an HTTP conditional get where the ressource is unchanged.

This method is intended to be overwritten (extended) by XMA projects that must handle their own types of data sources.

Parameters:
session - the active XMASession
spec - a table specification as defined in ITabularDataSource. The following properties are always contained in spec:
  • type indicates the table type.
  • _loc indicates the Locale of the XMA context.
  • _man indicates the mandant of the XMA context.
  • _env indicates the environment of the XMA context.
The attributes with leading underscore are drawn from XMAContext and are included because they are needed as keys in any cache.
lastModified - may be either UNKNOWN_TIMESTAMP to unconditionally request the data or a timestamp which indicates a lastModified timestamp which has been delivered (presumably some time ago) and the callee is requested to provide the table if it has changed since that time. The units are number of milliseconds since 1.1.1970 UTC.
Returns:
a newly created value object or null. Also see the javadoc of the getter methods there. If the lastModified parameter was XMATabularDataSourceServer.UNKNOWN_TIMESTAMP, the returned object must not be null. Otherwise null may be returned which indicates that the table did not change with respect to lastModified. If the callee returns a table, the value objects last modified timestamp may be set or not, depending on whether the callee is able to compute a last modified timestamp.

getExpireDurationClientSecs

public int getExpireDurationClientSecs(java.lang.String type)
Defines the number of seconds a table of a particular type may be cached at the XMA client without calling the XMA-server for an uptodate check.

This method is intended to be overwritten (extended) by XMA projects that must handle their own types of data sources.

Since the returned information is not cached, this method may be called quite frequently and therefore should consume almost no cpu.

Returns:
number of seconds a table remains valid in the XMA clients cache without contacting the server for an uptodate check. The implementor must provide a number greater than 60. The maximum of the returned value and 60 will be used.

getExpireDurationServerSecs

public int getExpireDurationServerSecs(java.lang.String type)
Defines the number of seconds a table of a particular type may be cached at the server without calling provideTable again. This method is intended to be overwritten (extended) by XMA projects that must handle their own types of data sources. Since the returned information is not cached, this method may be called quite frequently and therefore should consume almost no cpu.