org.addsimplicity.anicetus.hibernate
Class HibernateTelemetry

java.lang.Object
  extended by org.addsimplicity.anicetus.entity.GlobalInfo
      extended by org.addsimplicity.anicetus.entity.ExecInfo
          extended by org.addsimplicity.anicetus.hibernate.HibernateTelemetry
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>, org.addsimplicity.anicetus.entity.TelemetryContainer

public class HibernateTelemetry
extends org.addsimplicity.anicetus.entity.ExecInfo

The hibernate telemetry artifact tracks the actions performed by an application against the database through the Hibernate framework. The state captured provides information about what entities are involved, what operations were performed, what tables were involved, and what sql was executed. It also tracks timing information about the Hibernate transaction.

Author:
Dan Pritchett (driveawedge@yahoo.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
HibernateTelemetry()
          Construct a telemetry artifact without any parent.
HibernateTelemetry(org.addsimplicity.anicetus.entity.GlobalInfo parent)
          Construct a telemetry artifact with the specified parent.
 
Method Summary
 void addHibernateEntity(HibernateEntity entity)
          Add an entity to this artifact.
 void addSQLStatement(java.lang.String statement)
          Add a SQL statement to the telemetry.
 void addTable(java.lang.String table)
          Add a referenced table to the telemetry.
 java.util.Collection<HibernateEntity> getHibernateEntities()
          Return an immutable collection of entities that were involved in the Hibernate transaction.
 java.util.Collection<java.lang.String> getSQLStatements()
          Return an immutable collection of SQL statements that were executed by Hibernate for this transaction.
 java.util.Collection<java.lang.String> getTables()
          Return an immutable set of unique table names involved in this Hibernate transaction.
 void setHibernateEntities(java.util.Collection<HibernateEntity> entities)
          Set the entities involved in the Hibernate transaction.
 void setSQLStatements(java.util.Collection<java.lang.String> statements)
          Set the collection of SQL statements involved in the Hibernate transaction.
 void setTables(java.util.Collection<java.lang.String> tables)
          Set the collection of tables involved in the Hibernate transaction.
 
Methods inherited from class org.addsimplicity.anicetus.entity.ExecInfo
addChild, complete, getChildren, getDuration, getStatus, setDuration, setStatus, startTimer
 
Methods inherited from class org.addsimplicity.anicetus.entity.GlobalInfo
clear, containsKey, containsValue, entrySet, equals, get, getEntityId, getExecutionContext, getMessage, getParentId, getReportingNode, getTimeStamp, hashCode, isEmpty, keySet, put, putAll, remove, setEntityId, setExceptionAsMessage, setExecutionContext, setMessage, setParentId, setReportingNode, setTimeStamp, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateTelemetry

public HibernateTelemetry()
Construct a telemetry artifact without any parent.


HibernateTelemetry

public HibernateTelemetry(org.addsimplicity.anicetus.entity.GlobalInfo parent)
Construct a telemetry artifact with the specified parent.

Parameters:
parent - The parent of the artifact.
Method Detail

addHibernateEntity

public void addHibernateEntity(HibernateEntity entity)
Add an entity to this artifact. The same entity may appear multiple times, once for each operation that is performed upon it. This is true even if the same operation is performed more than once on the entity.

Parameters:
entity - The entity to add to the telemetry.

addSQLStatement

public void addSQLStatement(java.lang.String statement)
Add a SQL statement to the telemetry. SQL statements are generated by Hibernate and loosely correlate to the entities that are added. Multiple SQL statements may appear for each entity operation however. This method will also parse the table name from the statement and add them to the table lists.

Parameters:
statement - The SQL statement generated by Hibernate.

addTable

public void addTable(java.lang.String table)
Add a referenced table to the telemetry. Tables are added for any SQL statement they appear in.

Parameters:
table - The table name.

getHibernateEntities

public java.util.Collection<HibernateEntity> getHibernateEntities()
Return an immutable collection of entities that were involved in the Hibernate transaction.

Returns:
a collection of entities.

getSQLStatements

public java.util.Collection<java.lang.String> getSQLStatements()
Return an immutable collection of SQL statements that were executed by Hibernate for this transaction.

Returns:
a collection of SQL statements.

getTables

public java.util.Collection<java.lang.String> getTables()
Return an immutable set of unique table names involved in this Hibernate transaction.

Returns:
a distinct set of table names.

setHibernateEntities

public void setHibernateEntities(java.util.Collection<HibernateEntity> entities)
Set the entities involved in the Hibernate transaction.

Parameters:
entities - The entities involved in the Hibernate transaction.

setSQLStatements

public void setSQLStatements(java.util.Collection<java.lang.String> statements)
Set the collection of SQL statements involved in the Hibernate transaction.

Parameters:
statements - The SQL statements involved in the Hibernate transaction.

setTables

public void setTables(java.util.Collection<java.lang.String> tables)
Set the collection of tables involved in the Hibernate transaction.

Parameters:
tables - The collection of tables involved in the transaction.


Copyright © 2009 Add Simplicity. All Rights Reserved.