org.glite.rgma
Interface PrimaryProducer

All Superinterfaces:
Resource

public interface PrimaryProducer
extends Resource

A client uses a PrimaryProducer to publish information into R-GMA.


Method Summary
 void declareTable(java.lang.String tableName, java.lang.String predicate, TimeInterval historyRetentionPeriod, TimeInterval latestRetentionPeriod)
          Declares a table, specifying the retention period for history and latest tuples.
 TimeInterval getHistoryRetentionPeriod(java.lang.String tableName)
          Gets the retention period that is applied to history tuples for the specified table.
 TimeInterval getLatestRetentionPeriod(java.lang.String tableName)
          Gets the retention period that is applied to latest tuples for the specified table.
 void insert(java.lang.String insertStatement)
          Publishes data by inserting a tuple into a table, both specified by the SQL INSERT statement.
 void insert(java.lang.String insertStatement, TimeInterval latestRetentionPeriod)
          Publishes data by inserting a tuple into a table, both specified by the SQL INSERT statement.
 void insertList(StringList insertStatements)
          Publishes using a list of SQL INSERT statements.
 void insertList(StringList insertStatements, TimeInterval latestRetentionPeriod)
          Publishes using a list of SQL INSERT statements.
 
Methods inherited from interface org.glite.rgma.Resource
close, destroy, getResourceEndpoint, getTerminationInterval, setTerminationInterval, showSignOfLife
 

Method Detail

getHistoryRetentionPeriod

public TimeInterval getHistoryRetentionPeriod(java.lang.String tableName)
                                       throws RemoteException,
                                              UnknownResourceException,
                                              RGMAException
Gets the retention period that is applied to history tuples for the specified table.

Parameters:
tableName - Name of the table
Returns:
The retention period for history tuples.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
RGMAException - If the table has not been declared.
See Also:
declareTable(java.lang.String, java.lang.String, org.glite.rgma.TimeInterval, org.glite.rgma.TimeInterval)

getLatestRetentionPeriod

public TimeInterval getLatestRetentionPeriod(java.lang.String tableName)
                                      throws RemoteException,
                                             UnknownResourceException,
                                             RGMAException
Gets the retention period that is applied to latest tuples for the specified table.

Parameters:
tableName - Name of the table
Returns:
The retention period for latest tuples.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the resource could not be found.
RGMAException - If the table has not been declared.
See Also:
declareTable(java.lang.String, java.lang.String, org.glite.rgma.TimeInterval, org.glite.rgma.TimeInterval)

declareTable

public void declareTable(java.lang.String tableName,
                         java.lang.String predicate,
                         TimeInterval historyRetentionPeriod,
                         TimeInterval latestRetentionPeriod)
                  throws RemoteException,
                         UnknownResourceException,
                         RGMAException
Declares a table, specifying the retention period for history and latest tuples. The latest retention period specifies the time for which a latest tuple is valid. After this time, the tuple will no longer be returned to LATEST queries and may be removed from latest storage. Tuples will be removed from history storage when the history retention period expires.

Parameters:
tableName - The name of the table to declare.
predicate - An SQL WHERE clause defining the subset of a table that this Producer will publish. To publish to the whole table, an empty predicate can be used.
historyRetentionPeriod - The retention period for history tuples
latestRetentionPeriod - The retention period for latest tuples
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the producer resource could not be found
RGMAException - If the tableName is unknown. If the predicate is invalid. If either xxxRetentionPeriod is invalid.
See Also:
getLatestRetentionPeriod(java.lang.String), getHistoryRetentionPeriod(java.lang.String)

insert

public void insert(java.lang.String insertStatement)
            throws RemoteException,
                   UnknownResourceException,
                   RGMAException
Publishes data by inserting a tuple into a table, both specified by the SQL INSERT statement.

Parameters:
insertStatement - An SQL INSERT statement providing the data to publish and the table into which to put it.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the producer resource could not be found
RGMAException - If the table in the insert has not been declared. If the inserted tuple does not match its table's declared predicate
See Also:
insertList(org.glite.rgma.StringList), insert(String,TimeInterval)

insert

public void insert(java.lang.String insertStatement,
                   TimeInterval latestRetentionPeriod)
            throws RemoteException,
                   UnknownResourceException,
                   RGMAException
Publishes data by inserting a tuple into a table, both specified by the SQL INSERT statement.

Parameters:
insertStatement - An SQL INSERT statement providing the data to publish and the table into which to put it.
latestRetentionPeriod - Latest retention period for this tuple (overrides LRP defined for table).
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the producer resource could not be found
RGMAException - If the table in the insert has not been declared. If the inserted tuple does not match its table's declared predicate
See Also:
insertList(org.glite.rgma.StringList), insert(String)

insertList

public void insertList(StringList insertStatements)
                throws RemoteException,
                       UnknownResourceException,
                       RGMAException
Publishes using a list of SQL INSERT statements.

Parameters:
insertStatements - A list of SQL INSERT statements.
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the producer resource could not be found
RGMAException - If the table in any insert has not been declared. If any inserted tuple does not match its table's declared predicate
See Also:
insert(java.lang.String)

insertList

public void insertList(StringList insertStatements,
                       TimeInterval latestRetentionPeriod)
                throws RemoteException,
                       UnknownResourceException,
                       RGMAException
Publishes using a list of SQL INSERT statements.

Parameters:
insertStatements - A list of SQL INSERT statements.
latestRetentionPeriod - Latest retention period for this tuple (overrides LRP defined for table).
Throws:
RemoteException - If the service could not be contacted.
UnknownResourceException - If the producer resource could not be found
RGMAException - If the table in any insert has not been declared. If any inserted tuple does not match its table's declared predicate
See Also:
insert(java.lang.String)