org.edg.info
Class ArchiverInstance

java.lang.Object
  extended byorg.edg.info.InstanceBase
      extended byorg.edg.info.ArchiverInstance

public class ArchiverInstance
extends InstanceBase

Class is used to provide an Archiving service. This operates by periodically sucking in tuples using a Consumer and then re-publishing the data to a Producer. The producer is either a LatestProducer or DataBaseProducer (the type is user defined). Note: The ArchiverInstance can't extend Declarable as the Archiver is not registered and so the supertype's close() method will not work as expected.


Nested Class Summary
 class ArchiverInstance.ArchiverThread
          Gets tuples from the Consumer and inserts them into the Insertable.
 
Field Summary
 
Fields inherited from class org.edg.info.InstanceBase
DEFAULT_TERMINATION_INTERVAL_MS, s_maxTerminationInterval, s_minTerminationInterval
 
Constructor Summary
ArchiverInstance(int connectionId, int insertableConnectionId, java.net.URL insertableServletURL, long terminationInterval, java.net.URL schemaServletLocation)
          Creates a new ArchiverInstance using a defined Insertable Object to archive tuples.
 
Method Summary
 void declareTable(java.lang.String tableName, java.lang.String predicate, int hrpSec)
          Attempts to declare the table using the Insertable Object.
 java.util.Hashtable getArchiverThreads()
           
 int getHistoryRetentionPeriod(java.lang.String tableName)
           
 int getPrimaryProducerId()
           
 java.lang.String getPrimaryProducerURL()
           
 void setTerminationInterval(long terminationInterval)
          Deprecated.  
 void showSignOfLife()
          Updates the last contact time for all the Consumer Objects and for the Producer.
 
Methods inherited from class org.edg.info.InstanceBase
canDestroy, disconnect, getLastRegistryUpdateTimeMillis, getRegistryUpdateIntervalMillis, getResourceId, getStatus, getTerminationInterval, getTerminationIntervalMillis, getUserLastContactTimeMillis, isDestroyed, isTupleCheckingEnabled, notifyRegistrationThread, reconnect, setCloseCalled, setDestroyed, setRegistrationThread, updateLastContactTime, updateRegistry, wasCloseCalled
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiverInstance

public ArchiverInstance(int connectionId,
                        int insertableConnectionId,
                        java.net.URL insertableServletURL,
                        long terminationInterval,
                        java.net.URL schemaServletLocation)
                 throws org.glite.rgma.system.RGMAInternalException,
                        org.glite.rgma.system.RGMAUserException
Creates a new ArchiverInstance using a defined Insertable Object to archive tuples.

Parameters:
connectionId -
insertableConnectionId -
insertableServletURL -
terminationInterval -
Throws:
org.glite.rgma.system.RGMAException
org.glite.rgma.system.RGMAInternalException
org.glite.rgma.system.RGMAUserException
Method Detail

setTerminationInterval

public final void setTerminationInterval(long terminationInterval)
                                  throws org.glite.rgma.system.RGMAInternalException,
                                         org.glite.rgma.system.RGMAUserException
Deprecated.  

Sets the period of inactivity before the Producer and Consumers used by this Archiver are unregistered.

Overrides:
setTerminationInterval in class InstanceBase
Parameters:
terminationInterval - the termination interval to be set.
Throws:
org.glite.rgma.system.RGMAInternalException - If the Producer cannot be contacted
org.glite.rgma.system.RGMAUserException - If the terminationInterval is <= 0.

declareTable

public final void declareTable(java.lang.String tableName,
                               java.lang.String predicate,
                               int hrpSec)
                        throws org.glite.rgma.system.RGMAUserException,
                               org.glite.rgma.system.RGMAInternalException
Attempts to declare the table using the Insertable Object. Note, the table declaration should occur before an ArchiverThread is created. This is important if the Archiver declares a new table which doesn't exist within the Schema.

Throws:
org.glite.rgma.system.RGMAUserException
org.glite.rgma.system.RGMAInternalException

showSignOfLife

public final void showSignOfLife()
                          throws org.glite.rgma.system.RGMAException
Updates the last contact time for all the Consumer Objects and for the Producer. If any of these API Objects cannot contact their Servlet a short error message will be printed to log4j. Nothing unpleasant should result (i.e. its fail safe).

Overrides:
showSignOfLife in class InstanceBase
Throws:
org.glite.rgma.system.RGMAException - DOCUMENT ME!

getHistoryRetentionPeriod

public final int getHistoryRetentionPeriod(java.lang.String tableName)
                                    throws org.glite.rgma.system.RGMAUserException,
                                           org.glite.rgma.system.RGMAInternalException
Parameters:
tableName -
Returns:
Throws:
org.glite.rgma.system.RGMAException
org.glite.rgma.system.RGMAUserException
org.glite.rgma.system.RGMAInternalException

getPrimaryProducerId

public int getPrimaryProducerId()
Returns:
Returns the insertableId.

getPrimaryProducerURL

public java.lang.String getPrimaryProducerURL()
Returns:
Returns the insertableURL.

getArchiverThreads

public java.util.Hashtable getArchiverThreads()
Returns:
Returns a copy of the hashtable holding all the current archiver threads.