com.ibm.di.api.tm
Class TombstoneManager

java.lang.Object
  extended by com.ibm.di.api.tm.TombstoneManager

public class TombstoneManager
extends Object

This class is used to manage Tombstone objects. It contains methods to retrieve and delete tombstone objects on a specific criteria.


Field Summary
static int COMPONENT_TYPE_ASSEMBLY_LINE
           
static int COMPONENT_TYPE_CONFIG_INSTANCE
           
static int COMPONENT_TYPE_EVENT_HANDLER
           
static String PROP_AUTODEL_AGE
           
static String PROP_AUTODEL_RECORDS_MAX
           
static String PROP_AUTODEL_RECORDS_TRIGGER
           
static String PROP_CREATE_ALL
           
static String PROP_CREATE_TABLE
           
static String PROP_FIELD_COMPONENT_NAME
           
static String PROP_FIELD_COMPONENT_TYPE_ID
           
static String PROP_FIELD_CONFIGURATION
           
static String PROP_FIELD_CREATED_ON
           
static String PROP_FIELD_ERROR_DESCR
           
static String PROP_FIELD_EVENT_TYPE_ID
           
static String PROP_FIELD_EXIT_CODE
           
static String PROP_FIELD_GUID
           
static String PROP_FIELD_ID
           
static String PROP_FIELD_START_TIME
           
static String PROP_FIELD_STATS
           
static String PROP_FIELD_USER_MESSAGE
           
static String TABLE_NAME
           
 
Constructor Summary
TombstoneManager()
           
 
Method Summary
 int deleteALTombstones(String aAssemblyLineName, String aConfigID)
          Deletes all Tombstone objects created for the specified AssemblyLine.
 int deleteALTombstones(String aAssemblyLineName, String aConfigID, int aDays)
          Deletes all Tombstone objects for a specified AssemblyLine that are older than the specified number of days.
 int deleteCITombstones(String aConfigID)
          Deletes all tombstones for a specified Config Instance.
 int deleteCITombstones(String aConfigID, int aDays)
          Deletes all Tombstone objects for a specified Config Instance that are older than the specified number of days.
 int deleteEHTombstones(String aEventHandlerName, String aConfigID)
          Deletes all Tombstone objects for a specified EventHandler.
 int deleteEHTombstones(String aEventHandlerName, String aConfigID, int aDays)
          Deletes all Tombstone objects for a specified EventHandler that are older than the specified number of days.
 boolean deleteTombstone(String aGUID)
          Deletes a tombstone.
 int deleteTombstones(int aDaysCount)
          Deletes all Tombstone objects that are older than the specified number of days.
protected  void doInsert(int aComponentTypeID, int aEventTypeID, long aStartTime, long aCreatedOn, String aComponentName, String aConfiguration, int aExitCode, String aErrorDescr, String aGUID, byte[] aStats, String aUserMessage)
           
 Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName, String aConfigID)
          Get all available tombstones for a specified AssemblyLine.
 Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName, String aConfigID, Date aStartTime, Date aEndTime)
          Get all available tombstones for a specified AssemblyLine with timestamps in the interval specified by aStartTime and aEndTime.
 Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName, String aConfigID, int aRecentNumberOfTombstones)
          Gets the recent n number of tombsones for a specified AssemblyLine
 Tombstone[] getConfigInstanceTombstones(String aConfigID)
          Get all available tombstones for a specified Configuration Instance.
 Tombstone[] getConfigInstanceTombstones(String aConfigID, Date aStartTime, Date aEndTime)
          Get all available tombstones for a specified ConfigInstance with timestamps in the interval specified by aStartTime and aEndTime.
 Connection getConnection()
           
 Tombstone[] getEventHandlerTombstones(String aEventHandlerName, String aConfigID)
          Get all available tombstones for a specified EventHandler.
 Tombstone[] getEventHandlerTombstones(String aEventHandlerName, String aConfigID, Date aStartTime, Date aEndTime)
          Get all available tombstones for a specified EventHandler with timestamps in the interval specified by aStartTime and aEndTime.
 Tombstone getTombstone(String aGUID)
          Get single tombstone object, uniquely identified by the specified GUID
 Tombstone[] getTombstones(Date aStartTime, Date aEndTime)
          Get all available tombstones with timestamps in the interval specified by aStartTime and aEndTime.
 int getTombstonesCount()
           
 int keepMostRecentALTombstones(String aAssemblyLineName, String aConfigID, int aRecentTombstonesToKeep)
          Deletes all tombstones for a specified AssemblyLine except a specified number of most recently created ones.
 int keepMostRecentCITombstones(String aConfigID, int aRecentTombstonesToKeep)
          Deletes all tombstones for a Config Instance except a specified number of recently created ones.
 int keepMostRecentEHTombstones(String aEventHandlerName, String aConfigID, int aRecentTombstonesToKeep)
          Deletes all tombstones for a specified EventHandelr except a specified number of most recently created ones.
 int keepMostRecentTombstones(int aRecentTombstonesToKeep)
          Deletes all tombstone object records except a specified number of most recently created ones.
 void setConnection(Connection aConnection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_AUTODEL_AGE

public static final String PROP_AUTODEL_AGE
See Also:
Constant Field Values

PROP_AUTODEL_RECORDS_TRIGGER

public static final String PROP_AUTODEL_RECORDS_TRIGGER
See Also:
Constant Field Values

PROP_AUTODEL_RECORDS_MAX

public static final String PROP_AUTODEL_RECORDS_MAX
See Also:
Constant Field Values

PROP_CREATE_ALL

public static final String PROP_CREATE_ALL
See Also:
Constant Field Values

PROP_CREATE_TABLE

public static final String PROP_CREATE_TABLE
See Also:
Constant Field Values

COMPONENT_TYPE_CONFIG_INSTANCE

public static final int COMPONENT_TYPE_CONFIG_INSTANCE
See Also:
Constant Field Values

COMPONENT_TYPE_ASSEMBLY_LINE

public static final int COMPONENT_TYPE_ASSEMBLY_LINE
See Also:
Constant Field Values

COMPONENT_TYPE_EVENT_HANDLER

public static final int COMPONENT_TYPE_EVENT_HANDLER
See Also:
Constant Field Values

TABLE_NAME

public static final String TABLE_NAME
See Also:
Constant Field Values

PROP_FIELD_ID

public static final String PROP_FIELD_ID
See Also:
Constant Field Values

PROP_FIELD_COMPONENT_TYPE_ID

public static final String PROP_FIELD_COMPONENT_TYPE_ID
See Also:
Constant Field Values

PROP_FIELD_EVENT_TYPE_ID

public static final String PROP_FIELD_EVENT_TYPE_ID
See Also:
Constant Field Values

PROP_FIELD_START_TIME

public static final String PROP_FIELD_START_TIME
See Also:
Constant Field Values

PROP_FIELD_CREATED_ON

public static final String PROP_FIELD_CREATED_ON
See Also:
Constant Field Values

PROP_FIELD_COMPONENT_NAME

public static final String PROP_FIELD_COMPONENT_NAME
See Also:
Constant Field Values

PROP_FIELD_CONFIGURATION

public static final String PROP_FIELD_CONFIGURATION
See Also:
Constant Field Values

PROP_FIELD_EXIT_CODE

public static final String PROP_FIELD_EXIT_CODE
See Also:
Constant Field Values

PROP_FIELD_ERROR_DESCR

public static final String PROP_FIELD_ERROR_DESCR
See Also:
Constant Field Values

PROP_FIELD_GUID

public static final String PROP_FIELD_GUID
See Also:
Constant Field Values

PROP_FIELD_STATS

public static final String PROP_FIELD_STATS
See Also:
Constant Field Values

PROP_FIELD_USER_MESSAGE

public static final String PROP_FIELD_USER_MESSAGE
See Also:
Constant Field Values
Constructor Detail

TombstoneManager

public TombstoneManager()
                 throws DIException
Throws:
DIException
Method Detail

getTombstone

public Tombstone getTombstone(String aGUID)
                       throws DIException
Get single tombstone object, uniquely identified by the specified GUID

Parameters:
aGUID - The GUID of the requested tombstone
Returns:
Tombstone object
Throws:
DIException

getAssemblyLineTombstones

public Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName,
                                             String aConfigID,
                                             int aRecentNumberOfTombstones)
                                      throws DIException
Gets the recent n number of tombsones for a specified AssemblyLine

Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aConfigID - The name of the AssmeblyLine's configuration.
aRecentNumberOfTombstones - The recent n number of tombsones to be returned.
Returns:
an array of Tombstone objects.
Throws:
DIException
Since:
6.1.1

getAssemblyLineTombstones

public Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName,
                                             String aConfigID)
                                      throws DIException
Get all available tombstones for a specified AssemblyLine.

Parameters:
aAssemblyLineName - The name of the AssemblyLine whose tombstones will be extracted.
aConfigID - The AssemblyLine's configuration.
Returns:
An array of Tombstone objects for the specified AssemblyLine.
Throws:
DIException

getAssemblyLineTombstones

public Tombstone[] getAssemblyLineTombstones(String aAssemblyLineName,
                                             String aConfigID,
                                             Date aStartTime,
                                             Date aEndTime)
                                      throws DIException
Get all available tombstones for a specified AssemblyLine with timestamps in the interval specified by aStartTime and aEndTime.

Parameters:
aAssemblyLineName - The name of the AssemblyLine whose tombstones will be extracted.
aConfigID - The AssemblyLine's configuration.
aStartTime - The start time of the period for which tombstones are retrieved.
aEndTime - The end time of the period for which tombstones are retrieved.
Returns:
An array of Tombstone objects for the specified AssemblyLine.
Throws:
DIException

getEventHandlerTombstones

public Tombstone[] getEventHandlerTombstones(String aEventHandlerName,
                                             String aConfigID)
                                      throws DIException
Get all available tombstones for a specified EventHandler.

Parameters:
aEventHandlerName - The name of the EventHandler whose tombstones will be extracted.
aConfigID - The EventHandler's configuration.
Returns:
An array of EventHandler Tombstone objects.
Throws:
DIException

getEventHandlerTombstones

public Tombstone[] getEventHandlerTombstones(String aEventHandlerName,
                                             String aConfigID,
                                             Date aStartTime,
                                             Date aEndTime)
                                      throws DIException
Get all available tombstones for a specified EventHandler with timestamps in the interval specified by aStartTime and aEndTime.

Parameters:
aEventHandlerName - The name of the EventHandler whose tombstone records will be retrieved.
aConfigID - The Eventhandler's configuration.
aStartTime - The start time of the period for which tombstone records are retrieved.
aEndTime - The end time of the period for which tombstone records are retrieved.
Returns:
An array of Eventhandler Tombstone objects.
Throws:
DIException

getConfigInstanceTombstones

public Tombstone[] getConfigInstanceTombstones(String aConfigID)
                                        throws DIException
Get all available tombstones for a specified Configuration Instance.

Parameters:
aConfigID - The configuration ID.
Returns:
An array of Config Instance Tombstone objects.
Throws:
DIException

getConfigInstanceTombstones

public Tombstone[] getConfigInstanceTombstones(String aConfigID,
                                               Date aStartTime,
                                               Date aEndTime)
                                        throws DIException
Get all available tombstones for a specified ConfigInstance with timestamps in the interval specified by aStartTime and aEndTime.

Parameters:
aConfigID - The configuration ID.
aStartTime - The start time of the period for which tombstone records are retrieved.
aEndTime - The end time of the period for which tombstone records are retrieved.
Returns:
An array of Config Instance Tombstone objects.
Throws:
DIException

getTombstones

public Tombstone[] getTombstones(Date aStartTime,
                                 Date aEndTime)
                          throws DIException
Get all available tombstones with timestamps in the interval specified by aStartTime and aEndTime.

Parameters:
aStartTime - The start time of the period for which tombstone records are retrieved.
aEndTime - The end time of the period for which tombstone records are retrieved.
Returns:
An array of Tombstone objects.
Throws:
DIException

deleteTombstones

public int deleteTombstones(int aDaysCount)
                     throws DIException
Deletes all Tombstone objects that are older than the specified number of days.

Parameters:
aDaysCount - Nubmer of days.
Returns:
The number of deleted tombstone records.
Throws:
DIException

keepMostRecentTombstones

public int keepMostRecentTombstones(int aRecentTombstonesToKeep)
                             throws DIException
Deletes all tombstone object records except a specified number of most recently created ones.

Parameters:
aRecentTombstonesToKeep - number of recent tombstones to keep.
Returns:
The number of deleted tombstone records.
Throws:
DIException

deleteALTombstones

public int deleteALTombstones(String aAssemblyLineName,
                              String aConfigID)
                       throws DIException
Deletes all Tombstone objects created for the specified AssemblyLine.

Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aConfigID - The AssmeblyLine configuration.
Returns:
The number of deleted records.
Throws:
DIException

deleteALTombstones

public int deleteALTombstones(String aAssemblyLineName,
                              String aConfigID,
                              int aDays)
                       throws DIException
Deletes all Tombstone objects for a specified AssemblyLine that are older than the specified number of days.

Parameters:
aAssemblyLineName - The name of the AssemblyLine.
aConfigID - The AssemblyLine configuration.
aDays - Number of days.
Returns:
The number of deleted tombstone records.
Throws:
DIException

keepMostRecentALTombstones

public int keepMostRecentALTombstones(String aAssemblyLineName,
                                      String aConfigID,
                                      int aRecentTombstonesToKeep)
                               throws DIException
Deletes all tombstones for a specified AssemblyLine except a specified number of most recently created ones.

Parameters:
aAssemblyLineName - The name of the AssemblyLine whose tombstone records will be deleted.
aConfigID - The AssemblyLine configuration.
aRecentTombstonesToKeep - Number of recent tombstones to keep.
Returns:
The number of deleted records.
Throws:
DIException

deleteEHTombstones

public int deleteEHTombstones(String aEventHandlerName,
                              String aConfigID)
                       throws DIException
Deletes all Tombstone objects for a specified EventHandler.

Parameters:
aEventHandlerName - The name of the EventHandler whose tombstone records will be deleted.
aConfigID - The EventHandler configuration.
Returns:
The number of deleted tombstone records.
Throws:
DIException

deleteEHTombstones

public int deleteEHTombstones(String aEventHandlerName,
                              String aConfigID,
                              int aDays)
                       throws DIException
Deletes all Tombstone objects for a specified EventHandler that are older than the specified number of days.

Parameters:
aEventHandlerName - The name of the EventHandler whose tombstones will be deleted.
aConfigID - The EventHandler configuration.
aDays - Nubmer of days.
Returns:
The number of deleted tombstone records.
Throws:
DIException

keepMostRecentEHTombstones

public int keepMostRecentEHTombstones(String aEventHandlerName,
                                      String aConfigID,
                                      int aRecentTombstonesToKeep)
                               throws DIException
Deletes all tombstones for a specified EventHandelr except a specified number of most recently created ones.

Parameters:
aEventHandlerName - The name of the EventHandler whose tombstone records will be deleted.
aConfigID - The EventHandler configuration.
aRecentTombstonesToKeep - Number of most recent tombstones to keep.
Returns:
The number of deleted records.
Throws:
DIException

deleteCITombstones

public int deleteCITombstones(String aConfigID)
                       throws DIException
Deletes all tombstones for a specified Config Instance.

Parameters:
aConfigID - The configuration ID.
Returns:
The number of deleted tombstone records.
Throws:
DIException

deleteCITombstones

public int deleteCITombstones(String aConfigID,
                              int aDays)
                       throws DIException
Deletes all Tombstone objects for a specified Config Instance that are older than the specified number of days.

Parameters:
aConfigID - The configuration ID.
aDays - Nubmer of days.
Returns:
The number of deleted tombstone records.
Throws:
DIException

keepMostRecentCITombstones

public int keepMostRecentCITombstones(String aConfigID,
                                      int aRecentTombstonesToKeep)
                               throws DIException
Deletes all tombstones for a Config Instance except a specified number of recently created ones.

Parameters:
aConfigID - The configuration ID.
aRecentTombstonesToKeep - The number of most recent tombstones to keep.
Returns:
The number of deleted records.
Throws:
DIException

deleteTombstone

public boolean deleteTombstone(String aGUID)
                        throws DIException
Deletes a tombstone.

Parameters:
aGUID - The GUID of the tombstone to delete.
Returns:
true only when the tombstone with the specified GUID is found and deleted.
Throws:
DIException

setConnection

public void setConnection(Connection aConnection)

getConnection

public Connection getConnection()

getTombstonesCount

public int getTombstonesCount()
                       throws DIException
Throws:
DIException

doInsert

protected void doInsert(int aComponentTypeID,
                        int aEventTypeID,
                        long aStartTime,
                        long aCreatedOn,
                        String aComponentName,
                        String aConfiguration,
                        int aExitCode,
                        String aErrorDescr,
                        String aGUID,
                        byte[] aStats,
                        String aUserMessage)
                 throws DIException
Throws:
DIException