Ontimize 5.2072EN

com.ontimize.db.event
Class DataPropagationListener

java.lang.Object
  extended bycom.ontimize.db.event.DataPropagationListener
All Implemented Interfaces:
EntityDataChangeListener, java.util.EventListener, TransactionEntityDataChangeListener

public class DataPropagationListener
extends java.lang.Object
implements TransactionEntityDataChangeListener


Nested Class Summary
static class DataPropagationListener.OperationConfiguration
           
 
Field Summary
protected  java.lang.String configuration
          String with the configuration of the data propagation
protected  int eventType
          Type of event to listen to
protected  java.util.List operationConfiguration
          List of operations to do when a new event happen
 
Constructor Summary
DataPropagationListener(java.lang.String configuration, int eventType)
          Create a new DataPropagationListener
 
Method Summary
 void dataChanged(DataChangeEvent e)
           
 void dataChanged(DataChangeEvent e, java.sql.Connection con)
           
protected  java.util.Hashtable getAttributesValues(java.util.Hashtable values, java.util.Hashtable relations)
          Get the attributes to update using the updated values in the original entity and the relation between the columns in the original entity and the new one
protected  java.util.Hashtable getKeysValues(DataChangeEvent event, java.util.Hashtable relations, java.sql.Connection con)
          Get the keys to identify the record to modify in the new entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configuration

protected java.lang.String configuration
String with the configuration of the data propagation


eventType

protected int eventType
Type of event to listen to


operationConfiguration

protected java.util.List operationConfiguration
List of operations to do when a new event happen

Constructor Detail

DataPropagationListener

public DataPropagationListener(java.lang.String configuration,
                               int eventType)
Create a new DataPropagationListener

Parameters:
configuration - This string must be something like: operationName1&entityName1&column1 :referenceColumn1:columnN:referenceColumnN &key1:referenceKey1:keyN:referenceKeyN
eventType - Event type can be DataChangeEvent.UPDATE_EVENT, DataChangeEvent.INSERT_EVENT or DataChangeEvent.DELETE_EVENT
Method Detail

dataChanged

public void dataChanged(DataChangeEvent e,
                        java.sql.Connection con)
Specified by:
dataChanged in interface TransactionEntityDataChangeListener

getAttributesValues

protected java.util.Hashtable getAttributesValues(java.util.Hashtable values,
                                                  java.util.Hashtable relations)
Get the attributes to update using the updated values in the original entity and the relation between the columns in the original entity and the new one

Parameters:
values -
relations -
Returns:

getKeysValues

protected java.util.Hashtable getKeysValues(DataChangeEvent event,
                                            java.util.Hashtable relations,
                                            java.sql.Connection con)
                                     throws java.lang.Exception
Get the keys to identify the record to modify in the new entity. Sometimes this keys are in the event information but sometimes we have to make a new query to get the keys

Parameters:
event -
relations -
con -
Returns:
Throws:
java.lang.Exception

dataChanged

public void dataChanged(DataChangeEvent e)
Specified by:
dataChanged in interface EntityDataChangeListener

Ontimize