|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.api.tm.TombstoneManager
public class TombstoneManager
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
This constant could be used as value for the Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID property. |
static int |
COMPONENT_TYPE_CONFIG_INSTANCE
This constant could be used as value for the Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID property. |
static int |
COMPONENT_TYPE_EVENT_HANDLER
This constant could be used as value for the Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID property. |
static java.lang.String |
PROP_AUTODEL_AGE
When this property is present and contains an integer value greater than 0 the Tombstone Manager will automatically delete all tombstone records that are older than the specified number of days. |
static java.lang.String |
PROP_AUTODEL_RECORDS_MAX
This property specifies the number of tombstone records to keep when the logic for leveling is triggered as per the PROP_AUTODEL_RECORDS_TRIGGER property. |
static java.lang.String |
PROP_AUTODEL_RECORDS_TRIGGER
This property specifies the total number of tombstone records that will trigger the logic for leveling the number of tombstone records to a certain number. The default value for this property is "10000". |
static java.lang.String |
PROP_CREATE_ALL
When this property is set to "true" the Tombstone Manager will create tombstones for every AssemblyLine and Config Instance regardless of the values specified in the configurations. |
static java.lang.String |
PROP_CREATE_TABLE
This property is used to override the default "CREATE TABLE..." SQL statement. |
static java.lang.String |
PROP_FIELD_COMPONENT_NAME
A constant for the column "COMPONENT_NAME" |
static java.lang.String |
PROP_FIELD_COMPONENT_TYPE_ID
A constant for the column "COMPONENT_TYPE_ID" |
static java.lang.String |
PROP_FIELD_CONFIGURATION
A constant for the column "CONFIGURATION" |
static java.lang.String |
PROP_FIELD_CREATED_ON
A constant for the column "CREATED_ON" |
static java.lang.String |
PROP_FIELD_ERROR_DESCR
A constant for the column "ERROR_DESCR" |
static java.lang.String |
PROP_FIELD_EVENT_TYPE_ID
A constant for the column "EVENT_TYPE_ID" |
static java.lang.String |
PROP_FIELD_EXIT_CODE
A constant for the column "EXIT_CODE" |
static java.lang.String |
PROP_FIELD_GUID
A constant for the column "GUID" |
static java.lang.String |
PROP_FIELD_ID
A constant for the column - ID |
static java.lang.String |
PROP_FIELD_START_TIME
A constant for the column "START_TIME" |
static java.lang.String |
PROP_FIELD_STATS
A constant for the column "STATS" |
static java.lang.String |
PROP_FIELD_USER_MESSAGE
A constant for the column "USER_MESSAGE" |
static java.lang.String |
TABLE_NAME
This constant has the name of the table that will be created/queried. |
Constructor Summary | |
---|---|
TombstoneManager()
Default constructor for this object. |
Method Summary | |
---|---|
int |
deleteALTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID)
Deletes all Tombstone objects created for the specified AssemblyLine. |
int |
deleteALTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
java.util.Date olderThanDate)
Deletes all Tombstone objects for a specified AssemblyLine that are older than the specified date. |
int |
deleteALTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
java.util.Date startDate,
java.util.Date endDate)
Deletes all Tombstone objects for a specified AssemblyLine that are in the specified Date range. |
int |
deleteALTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
int aDays)
Deletes all Tombstone objects for a specified AssemblyLine that are older than the specified number of days. |
int |
deleteCITombstones(java.lang.String aConfigID)
Deletes all tombstones for a specified Config Instance. |
int |
deleteCITombstones(java.lang.String aConfigID,
int aDays)
Deletes all Tombstone objects for a specified Config Instance that are older than the specified number of days. |
boolean |
deleteTombstone(java.lang.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,
java.lang.String aComponentName,
java.lang.String aConfiguration,
int aExitCode,
java.lang.String aErrorDescr,
java.lang.String aGUID,
byte[] aStats,
java.lang.String aUserMessage)
Inserts a tombstone record in the back-end database. |
protected void |
finalize()
Close the prepared statement. |
Tombstone[] |
getAssemblyLineTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID)
Get all available tombstones for a specified AssemblyLine. |
Tombstone[] |
getAssemblyLineTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
java.util.Date aStartTime,
java.util.Date aEndTime)
Get all available tombstones for a specified AssemblyLine with timestamps in the interval specified by aStartTime and aEndTime. |
Tombstone[] |
getAssemblyLineTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
int aRecentNumberOfTombstones)
Gets the recent n number of tombstones for a specified AssemblyLine |
Tombstone[] |
getConfigInstanceTombstones(java.lang.String aConfigID)
Get all available tombstones for a specified Configuration Instance. |
Tombstone[] |
getConfigInstanceTombstones(java.lang.String aConfigID,
java.util.Date aStartTime,
java.util.Date aEndTime)
Get all available tombstones for a specified ConfigInstance with timestamps in the interval specified by aStartTime and aEndTime. |
java.sql.Connection |
getConnection()
Gets the JDBC connection. |
Tombstone |
getTombstone(java.lang.String aGUID)
Get single tombstone object, uniquely identified by the specified GUID |
Tombstone[] |
getTombstones(java.util.Date aStartTime,
java.util.Date aEndTime)
Get all available tombstones with timestamps in the interval specified by aStartTime and aEndTime. |
int |
getTombstonesCount()
|
int |
keepMostRecentALTombstones(java.lang.String aAssemblyLineName,
java.lang.String aConfigID,
int aRecentTombstonesToKeep)
Deletes all tombstones for a specified AssemblyLine except a specified number of most recently created ones. |
int |
keepMostRecentCITombstones(java.lang.String aConfigID,
int aRecentTombstonesToKeep)
Deletes all tombstones for a Config Instance except a specified number of recently created ones. |
int |
keepMostRecentTombstones(int aRecentTombstonesToKeep)
Deletes all tombstone object records except a specified number of most recently created ones. |
void |
setConnection(java.sql.Connection aConnection)
Sets the JDBC connection. |
void |
startAutoCleaner()
Starts a new thread for the TombstoneAutoCleaner |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_AUTODEL_AGE
public static final java.lang.String PROP_AUTODEL_RECORDS_TRIGGER
public static final java.lang.String PROP_AUTODEL_RECORDS_MAX
PROP_AUTODEL_RECORDS_TRIGGER
property. Alter the cleanup only
the most recent (the value of this property) number of records will be
kept.
public static final java.lang.String PROP_CREATE_ALL
public static final java.lang.String PROP_CREATE_TABLE
public static final int COMPONENT_TYPE_CONFIG_INSTANCE
Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID
property.
public static final int COMPONENT_TYPE_ASSEMBLY_LINE
Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID
property.
public static final int COMPONENT_TYPE_EVENT_HANDLER
Tombstone.PROPERTY_NAME_COMPONENT_TYPE_ID
property.
public static final java.lang.String TABLE_NAME
public static final java.lang.String PROP_FIELD_ID
public static final java.lang.String PROP_FIELD_COMPONENT_TYPE_ID
public static final java.lang.String PROP_FIELD_EVENT_TYPE_ID
public static final java.lang.String PROP_FIELD_START_TIME
public static final java.lang.String PROP_FIELD_CREATED_ON
public static final java.lang.String PROP_FIELD_COMPONENT_NAME
public static final java.lang.String PROP_FIELD_CONFIGURATION
public static final java.lang.String PROP_FIELD_EXIT_CODE
public static final java.lang.String PROP_FIELD_ERROR_DESCR
public static final java.lang.String PROP_FIELD_GUID
public static final java.lang.String PROP_FIELD_STATS
public static final java.lang.String PROP_FIELD_USER_MESSAGE
Constructor Detail |
---|
public TombstoneManager() throws DIException
From TDI 7.0 the cleaning process will not be triggered in the constructor but should be started immediately after that using startAutoCleaner() method.
DIException
Method Detail |
---|
public void startAutoCleaner()
public Tombstone getTombstone(java.lang.String aGUID) throws DIException
aGUID
- The GUID of the requested tombstone
DIException
public Tombstone[] getAssemblyLineTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, int aRecentNumberOfTombstones) throws DIException
aAssemblyLineName
- The name of the AssemblyLine.aConfigID
- The name of the AssmeblyLine's configuration.aRecentNumberOfTombstones
- The recent n number of tombstones to be returned.
DIException
public Tombstone[] getAssemblyLineTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID) throws DIException
aAssemblyLineName
- The name of the AssemblyLine whose tombstones will be
extracted.aConfigID
- The AssemblyLine's configuration.
DIException
public Tombstone[] getAssemblyLineTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, java.util.Date aStartTime, java.util.Date aEndTime) throws DIException
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.
DIException
public Tombstone[] getConfigInstanceTombstones(java.lang.String aConfigID) throws DIException
aConfigID
- The configuration ID.
DIException
public Tombstone[] getConfigInstanceTombstones(java.lang.String aConfigID, java.util.Date aStartTime, java.util.Date aEndTime) throws DIException
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.
DIException
public Tombstone[] getTombstones(java.util.Date aStartTime, java.util.Date aEndTime) throws DIException
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.
DIException
public int deleteTombstones(int aDaysCount) throws DIException
aDaysCount
- Number of days.
DIException
- if an error occurs.public int keepMostRecentTombstones(int aRecentTombstonesToKeep) throws DIException
aRecentTombstonesToKeep
- number of recent tombstones to keep.
DIException
public int deleteALTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID) throws DIException
aAssemblyLineName
- The name of the AssemblyLine.aConfigID
- The AssmeblyLine configuration.
DIException
- if an error occurs.public int deleteALTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, int aDays) throws DIException
aAssemblyLineName
- The name of the AssemblyLine.aConfigID
- The AssemblyLine configuration.aDays
- Number of days.
DIException
- if an error occurs.public int deleteALTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, java.util.Date olderThanDate) throws DIException
aAssemblyLineName
- The name of the AssemblyLine.aConfigID
- The AssemblyLine configuration.olderThanDate
- Date
DIException
- if an error occurs.public int deleteALTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, java.util.Date startDate, java.util.Date endDate) throws DIException
Date
range.
aAssemblyLineName
- The name of the AssemblyLine.aConfigID
- The AssemblyLine configuration.startDate
- DateendDate
- Date
DIException
- if an error occurs.public int keepMostRecentALTombstones(java.lang.String aAssemblyLineName, java.lang.String aConfigID, int aRecentTombstonesToKeep) throws DIException
aAssemblyLineName
- The name of the AssemblyLine whose tombstone records will be
deleted.aConfigID
- The AssemblyLine configuration.aRecentTombstonesToKeep
- Number of recent tombstones to keep.
DIException
public int deleteCITombstones(java.lang.String aConfigID) throws DIException
aConfigID
- The configuration ID.
DIException
- if an error occurs.public int deleteCITombstones(java.lang.String aConfigID, int aDays) throws DIException
aConfigID
- The configuration ID.aDays
- Number of days.
DIException
- if an error occurs.public int keepMostRecentCITombstones(java.lang.String aConfigID, int aRecentTombstonesToKeep) throws DIException
aConfigID
- The configuration ID.aRecentTombstonesToKeep
- The number of most recent tombstones to keep.
DIException
public boolean deleteTombstone(java.lang.String aGUID) throws DIException
aGUID
- The GUID of the tombstone to delete.
DIException
- if an error occurs.public void setConnection(java.sql.Connection aConnection)
aConnection
- the connection to use.public java.sql.Connection getConnection()
public int getTombstonesCount() throws DIException
DIException
- if an error occurs.protected void doInsert(int aComponentTypeID, int aEventTypeID, long aStartTime, long aCreatedOn, java.lang.String aComponentName, java.lang.String aConfiguration, int aExitCode, java.lang.String aErrorDescr, java.lang.String aGUID, byte[] aStats, java.lang.String aUserMessage) throws DIException
aComponentTypeID
- the type of the component.aEventTypeID
- the type of the event.aStartTime
- the time the component was started.aCreatedOn
- the time the component was created.aComponentName
- the name of the component.aConfiguration
- the configuration id of the configInstance the AL was started
in.aExitCode
- the code the component exited with.aErrorDescr
- the description of the error (if any) the component ended
with.aGUID
- the globally unique identifier of the tombstone.aStats
- the statistics as a serialized Entry object.aUserMessage
- the user message.
DIException
- if an error occurs.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |