org.enhydra.shark.eventaudit
Class DODSEventAuditManager

java.lang.Object
  extended by org.enhydra.shark.eventaudit.DODSEventAuditManager
All Implemented Interfaces:
EventAuditManagerInterface

public class DODSEventAuditManager
extends java.lang.Object
implements EventAuditManagerInterface

Used to save, restore or delete relevant engine objects from database, using DODS persistent layer.

Version:
1.0
Author:
Tanja Jovanovic

Field Summary
protected  java.util.Map _acStates
           
protected  java.util.Map _evTypes
           
protected  java.util.Map _prStates
           
protected  CallbackUtilities cus
           
protected  com.lutris.appserver.server.sql.LogicalDatabase db
           
protected static short DB_TYPE_BLOB
           
protected static short DB_TYPE_BOOLEAN
           
protected static short DB_TYPE_DATE
           
protected static short DB_TYPE_DOUBLE
           
protected static short DB_TYPE_LONG
           
protected static short DB_TYPE_VCHAR
           
protected static short DB_TYPE_XML
           
protected static java.lang.String[] eventTypes
           
protected static java.lang.String LOG_CHANNEL
           
protected static int max_vchar_size
           
protected static int MAX_VCHAR_SIZE_LIMIT
           
protected static java.lang.String objectid_column_name
           
protected  boolean persistOldEventAuditData
           
protected  boolean storeArraysAsBLOBs
           
protected  boolean usingStandardVariableDataModel
           
 
Constructor Summary
DODSEventAuditManager()
           
 
Method Summary
protected  com.lutris.appserver.server.sql.DBTransaction __getDBTransaction()
           
 void configure(CallbackUtilities cb)
           
 void delete(WMSessionHandle shandle, AssignmentEventAuditPersistenceObject aea)
           
 void delete(WMSessionHandle shandle, CreateProcessEventAuditPersistenceObject cpea)
           
 void delete(WMSessionHandle shandle, DataEventAuditPersistenceObject dea)
           
 void delete(WMSessionHandle shandle, StateEventAuditPersistenceObject sea)
           
protected  java.lang.Object getNewEventAuditDataBLOB(WMSessionHandle sh, NewEventAuditDataDO newEventAuditDataDO)
           
protected  java.lang.Object getNewEventAuditDataWOB(WMSessionHandle sh, NewEventAuditDataWOBDO theDO)
           
 java.math.BigDecimal getNextDecId(java.lang.String idName)
           
protected  java.lang.Object getOldEventAuditDataBLOB(WMSessionHandle sh, OldEventAuditDataDO oldEventAuditDataDO)
           
protected  java.lang.Object getOldEventAuditDataWOB(WMSessionHandle sh, OldEventAuditDataWOBDO theDO)
           
protected  ActivityStateEventAuditDO getPersistedActivityStateObject(java.lang.String value, boolean searchByKeyValue)
           
protected  AssignmentEventAuditDO[] getPersistedAssignmentEventObjects(java.lang.String pId, java.lang.String aId, java.lang.String sqlWhere, int startAt, int limit)
           
protected  CreateProcessEventAuditDO[] getPersistedCreateProcessEventObjects(java.lang.String pId)
           
protected  DataEventAuditDO[] getPersistedDataEventObjects(java.lang.String pId, java.lang.String aId, java.lang.String sqlWhere, int startAt, int limit)
           
protected  EventTypeDO getPersistedEventTypeObject(java.lang.String value, boolean searchByKeyValue)
           
protected  NewEventAuditDataDO getPersistedNewEventAuditDataObject(DataEventAuditDO deaDO, java.lang.String vdId)
           
protected  AssignmentEventAuditDO getPersistedObject(AssignmentEventAuditPersistenceObject aea)
           
protected  CreateProcessEventAuditDO getPersistedObject(CreateProcessEventAuditPersistenceObject cpea)
           
protected  DataEventAuditDO getPersistedObject(DataEventAuditPersistenceObject dea)
           
protected  StateEventAuditDO getPersistedObject(StateEventAuditPersistenceObject sea)
           
protected  OldEventAuditDataDO getPersistedOldEventAuditDataObject(DataEventAuditDO deaDO, java.lang.String vdId)
           
protected  ProcessStateEventAuditDO getPersistedProcessStateObject(java.lang.String value, boolean searchByKeyValue)
           
protected  StateEventAuditDO[] getPersistedStateEventObjects(java.lang.String pId, java.lang.String aId, java.lang.String sqlWhere, int startAt, int limit)
           
protected  void initActivityAndProcessStatesTable()
          Fills the state table with possible activity and process states.
 java.util.List listActivityHistoryInfoWhere(WMSessionHandle shandle, java.lang.String sqlWhere, int startAt, int limit, boolean fillVariablesInfo)
           
 java.util.List listProcessDefinitionHistoryInfoWhere(WMSessionHandle shandle, java.lang.String factoryName, boolean countProcessInstances)
           
 java.util.List listProcessHistoryInfoWhere(WMSessionHandle shandle, java.lang.String sqlWhere, int startAt, int limit, boolean fillActivitiesInfo, boolean fillActivityVariablesInfo, boolean fillVariablesInfo)
           
 void persist(WMSessionHandle shandle, AssignmentEventAuditPersistenceObject aea)
           
 void persist(WMSessionHandle shandle, CreateProcessEventAuditPersistenceObject cpea)
           
 void persist(WMSessionHandle shandle, DataEventAuditPersistenceObject dea)
           
 void persist(WMSessionHandle shandle, StateEventAuditPersistenceObject sea)
           
protected  void persistNewEventAuditDataBLOB(NewEventAuditDataDO nedDO, java.lang.Object val)
           
protected  void persistNewEventAuditDataBLOB(WMSessionHandle shandle, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void persistNewEventAuditDataWOB(NewEventAuditDataWOBDO nedDO, java.lang.Object val)
           
protected  void persistNewEventAuditDataWOB(WMSessionHandle shandle, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void persistOldEventAuditDataBLOB(OldEventAuditDataDO oedDO, java.lang.Object val)
           
protected  void persistOldEventAuditDataBLOB(WMSessionHandle shandle, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void persistOldEventAuditDataWOB(OldEventAuditDataWOBDO oedDO, java.lang.Object val)
           
protected  void persistOldEventAuditDataWOB(WMSessionHandle shandle, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void refreshDOCaches()
           
 boolean restore(WMSessionHandle shandle, AssignmentEventAuditPersistenceObject aea)
           
protected  boolean restore(WMSessionHandle shandle, AssignmentEventAuditPersistenceObject engineObj, AssignmentEventAuditDO DO)
           
 boolean restore(WMSessionHandle shandle, CreateProcessEventAuditPersistenceObject cpea)
           
protected  boolean restore(WMSessionHandle shandle, CreateProcessEventAuditPersistenceObject engineObj, CreateProcessEventAuditDO DO)
           
 boolean restore(WMSessionHandle shandle, DataEventAuditPersistenceObject dea)
           
protected  boolean restore(WMSessionHandle shandle, DataEventAuditPersistenceObject engineObj, DataEventAuditDO DO)
           
 boolean restore(WMSessionHandle shandle, StateEventAuditPersistenceObject sea)
           
protected  boolean restore(WMSessionHandle shandle, StateEventAuditPersistenceObject engineObj, StateEventAuditDO DO)
           
 java.util.List restoreActivityHistory(WMSessionHandle shandle, java.lang.String procId, java.lang.String actId)
           
protected  void restoreNewEventAuditDataBLOB(WMSessionHandle sh, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void restoreNewEventAuditDataWOB(WMSessionHandle sh, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void restoreOldEventAuditDataBLOB(WMSessionHandle sh, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
protected  void restoreOldEventAuditDataWOB(WMSessionHandle sh, DataEventAuditPersistenceObject dea, DataEventAuditDO deaDO)
           
 java.util.List restoreProcessHistory(WMSessionHandle shandle, java.lang.String procId)
           
protected  void setLDBName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_CHANNEL

protected static final java.lang.String LOG_CHANNEL
See Also:
Constant Field Values

eventTypes

protected static final java.lang.String[] eventTypes

DB_TYPE_BOOLEAN

protected static final short DB_TYPE_BOOLEAN
See Also:
Constant Field Values

DB_TYPE_LONG

protected static final short DB_TYPE_LONG
See Also:
Constant Field Values

DB_TYPE_DOUBLE

protected static final short DB_TYPE_DOUBLE
See Also:
Constant Field Values

DB_TYPE_VCHAR

protected static final short DB_TYPE_VCHAR
See Also:
Constant Field Values

DB_TYPE_DATE

protected static final short DB_TYPE_DATE
See Also:
Constant Field Values

DB_TYPE_BLOB

protected static final short DB_TYPE_BLOB
See Also:
Constant Field Values

DB_TYPE_XML

protected static final short DB_TYPE_XML
See Also:
Constant Field Values

MAX_VCHAR_SIZE_LIMIT

protected static final int MAX_VCHAR_SIZE_LIMIT
See Also:
Constant Field Values

max_vchar_size

protected static int max_vchar_size

cus

protected CallbackUtilities cus

_prStates

protected java.util.Map _prStates

_acStates

protected java.util.Map _acStates

_evTypes

protected java.util.Map _evTypes

usingStandardVariableDataModel

protected boolean usingStandardVariableDataModel

persistOldEventAuditData

protected boolean persistOldEventAuditData

storeArraysAsBLOBs

protected boolean storeArraysAsBLOBs

db

protected com.lutris.appserver.server.sql.LogicalDatabase db

objectid_column_name

protected static java.lang.String objectid_column_name
Constructor Detail

DODSEventAuditManager

public DODSEventAuditManager()
Method Detail

configure

public void configure(CallbackUtilities cb)
               throws java.lang.Exception
Specified by:
configure in interface EventAuditManagerInterface
Throws:
java.lang.Exception

initActivityAndProcessStatesTable

protected void initActivityAndProcessStatesTable()
                                          throws EventAuditException
Fills the state table with possible activity and process states. For now, the 'keyValue' and the 'name' attribute of state record has the same value, but in the future, if the names of states changes, it will be very easy to change this table entries without affecting other tables. NOTE: When new names are introduced, the getPersistentXXX that use it also has to be changed

Parameters:
dbName -
Throws:
EventAuditException

persist

public void persist(WMSessionHandle shandle,
                    AssignmentEventAuditPersistenceObject aea)
             throws EventAuditException
Specified by:
persist in interface EventAuditManagerInterface
Throws:
EventAuditException

persist

public void persist(WMSessionHandle shandle,
                    DataEventAuditPersistenceObject dea)
             throws EventAuditException
Specified by:
persist in interface EventAuditManagerInterface
Throws:
EventAuditException

persist

public void persist(WMSessionHandle shandle,
                    StateEventAuditPersistenceObject sea)
             throws EventAuditException
Specified by:
persist in interface EventAuditManagerInterface
Throws:
EventAuditException

persist

public void persist(WMSessionHandle shandle,
                    CreateProcessEventAuditPersistenceObject cpea)
             throws EventAuditException
Specified by:
persist in interface EventAuditManagerInterface
Throws:
EventAuditException

persistOldEventAuditDataBLOB

protected void persistOldEventAuditDataBLOB(WMSessionHandle shandle,
                                            DataEventAuditPersistenceObject dea,
                                            DataEventAuditDO deaDO)
                                     throws EventAuditException
Throws:
EventAuditException

persistOldEventAuditDataBLOB

protected void persistOldEventAuditDataBLOB(OldEventAuditDataDO oedDO,
                                            java.lang.Object val)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

persistOldEventAuditDataWOB

protected void persistOldEventAuditDataWOB(WMSessionHandle shandle,
                                           DataEventAuditPersistenceObject dea,
                                           DataEventAuditDO deaDO)
                                    throws EventAuditException
Throws:
EventAuditException

persistOldEventAuditDataWOB

protected void persistOldEventAuditDataWOB(OldEventAuditDataWOBDO oedDO,
                                           java.lang.Object val)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

persistNewEventAuditDataBLOB

protected void persistNewEventAuditDataBLOB(WMSessionHandle shandle,
                                            DataEventAuditPersistenceObject dea,
                                            DataEventAuditDO deaDO)
                                     throws EventAuditException
Throws:
EventAuditException

persistNewEventAuditDataBLOB

protected void persistNewEventAuditDataBLOB(NewEventAuditDataDO nedDO,
                                            java.lang.Object val)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

persistNewEventAuditDataWOB

protected void persistNewEventAuditDataWOB(WMSessionHandle shandle,
                                           DataEventAuditPersistenceObject dea,
                                           DataEventAuditDO deaDO)
                                    throws EventAuditException
Throws:
EventAuditException

persistNewEventAuditDataWOB

protected void persistNewEventAuditDataWOB(NewEventAuditDataWOBDO nedDO,
                                           java.lang.Object val)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

restore

public boolean restore(WMSessionHandle shandle,
                       AssignmentEventAuditPersistenceObject aea)
                throws EventAuditException
Specified by:
restore in interface EventAuditManagerInterface
Throws:
EventAuditException

restore

protected boolean restore(WMSessionHandle shandle,
                          AssignmentEventAuditPersistenceObject engineObj,
                          AssignmentEventAuditDO DO)
                   throws EventAuditException
Throws:
EventAuditException

restore

public boolean restore(WMSessionHandle shandle,
                       DataEventAuditPersistenceObject dea)
                throws EventAuditException
Specified by:
restore in interface EventAuditManagerInterface
Throws:
EventAuditException

restore

protected boolean restore(WMSessionHandle shandle,
                          DataEventAuditPersistenceObject engineObj,
                          DataEventAuditDO DO)
                   throws EventAuditException
Throws:
EventAuditException

restore

public boolean restore(WMSessionHandle shandle,
                       StateEventAuditPersistenceObject sea)
                throws EventAuditException
Specified by:
restore in interface EventAuditManagerInterface
Throws:
EventAuditException

restore

protected boolean restore(WMSessionHandle shandle,
                          StateEventAuditPersistenceObject engineObj,
                          StateEventAuditDO DO)
                   throws EventAuditException
Throws:
EventAuditException

restore

public boolean restore(WMSessionHandle shandle,
                       CreateProcessEventAuditPersistenceObject cpea)
                throws EventAuditException
Specified by:
restore in interface EventAuditManagerInterface
Throws:
EventAuditException

restore

protected boolean restore(WMSessionHandle shandle,
                          CreateProcessEventAuditPersistenceObject engineObj,
                          CreateProcessEventAuditDO DO)
                   throws EventAuditException
Throws:
EventAuditException

restoreOldEventAuditDataBLOB

protected void restoreOldEventAuditDataBLOB(WMSessionHandle sh,
                                            DataEventAuditPersistenceObject dea,
                                            DataEventAuditDO deaDO)
                                     throws EventAuditException
Throws:
EventAuditException

restoreOldEventAuditDataWOB

protected void restoreOldEventAuditDataWOB(WMSessionHandle sh,
                                           DataEventAuditPersistenceObject dea,
                                           DataEventAuditDO deaDO)
                                    throws EventAuditException
Throws:
EventAuditException

restoreNewEventAuditDataBLOB

protected void restoreNewEventAuditDataBLOB(WMSessionHandle sh,
                                            DataEventAuditPersistenceObject dea,
                                            DataEventAuditDO deaDO)
                                     throws EventAuditException
Throws:
EventAuditException

getOldEventAuditDataBLOB

protected java.lang.Object getOldEventAuditDataBLOB(WMSessionHandle sh,
                                                    OldEventAuditDataDO oldEventAuditDataDO)
                                             throws java.lang.Throwable
Throws:
java.lang.Throwable

getOldEventAuditDataWOB

protected java.lang.Object getOldEventAuditDataWOB(WMSessionHandle sh,
                                                   OldEventAuditDataWOBDO theDO)
                                            throws java.lang.Throwable
Throws:
java.lang.Throwable

getNewEventAuditDataBLOB

protected java.lang.Object getNewEventAuditDataBLOB(WMSessionHandle sh,
                                                    NewEventAuditDataDO newEventAuditDataDO)
                                             throws java.lang.Throwable
Throws:
java.lang.Throwable

getNewEventAuditDataWOB

protected java.lang.Object getNewEventAuditDataWOB(WMSessionHandle sh,
                                                   NewEventAuditDataWOBDO theDO)
                                            throws java.lang.Throwable
Throws:
java.lang.Throwable

restoreNewEventAuditDataWOB

protected void restoreNewEventAuditDataWOB(WMSessionHandle sh,
                                           DataEventAuditPersistenceObject dea,
                                           DataEventAuditDO deaDO)
                                    throws EventAuditException
Throws:
EventAuditException

restoreProcessHistory

public java.util.List restoreProcessHistory(WMSessionHandle shandle,
                                            java.lang.String procId)
                                     throws EventAuditException
Specified by:
restoreProcessHistory in interface EventAuditManagerInterface
Throws:
EventAuditException

restoreActivityHistory

public java.util.List restoreActivityHistory(WMSessionHandle shandle,
                                             java.lang.String procId,
                                             java.lang.String actId)
                                      throws EventAuditException
Specified by:
restoreActivityHistory in interface EventAuditManagerInterface
Throws:
EventAuditException

delete

public void delete(WMSessionHandle shandle,
                   AssignmentEventAuditPersistenceObject aea)
            throws EventAuditException
Specified by:
delete in interface EventAuditManagerInterface
Throws:
EventAuditException

delete

public void delete(WMSessionHandle shandle,
                   DataEventAuditPersistenceObject dea)
            throws EventAuditException
Specified by:
delete in interface EventAuditManagerInterface
Throws:
EventAuditException

delete

public void delete(WMSessionHandle shandle,
                   StateEventAuditPersistenceObject sea)
            throws EventAuditException
Specified by:
delete in interface EventAuditManagerInterface
Throws:
EventAuditException

delete

public void delete(WMSessionHandle shandle,
                   CreateProcessEventAuditPersistenceObject cpea)
            throws EventAuditException
Specified by:
delete in interface EventAuditManagerInterface
Throws:
EventAuditException

getPersistedObject

protected AssignmentEventAuditDO getPersistedObject(AssignmentEventAuditPersistenceObject aea)
                                             throws EventAuditException
Throws:
EventAuditException

getPersistedAssignmentEventObjects

protected AssignmentEventAuditDO[] getPersistedAssignmentEventObjects(java.lang.String pId,
                                                                      java.lang.String aId,
                                                                      java.lang.String sqlWhere,
                                                                      int startAt,
                                                                      int limit)
                                                               throws EventAuditException
Throws:
EventAuditException

getPersistedObject

protected DataEventAuditDO getPersistedObject(DataEventAuditPersistenceObject dea)
                                       throws EventAuditException
Throws:
EventAuditException

getPersistedDataEventObjects

protected DataEventAuditDO[] getPersistedDataEventObjects(java.lang.String pId,
                                                          java.lang.String aId,
                                                          java.lang.String sqlWhere,
                                                          int startAt,
                                                          int limit)
                                                   throws EventAuditException
Throws:
EventAuditException

getPersistedObject

protected StateEventAuditDO getPersistedObject(StateEventAuditPersistenceObject sea)
                                        throws EventAuditException
Throws:
EventAuditException

getPersistedStateEventObjects

protected StateEventAuditDO[] getPersistedStateEventObjects(java.lang.String pId,
                                                            java.lang.String aId,
                                                            java.lang.String sqlWhere,
                                                            int startAt,
                                                            int limit)
                                                     throws EventAuditException
Throws:
EventAuditException

getPersistedObject

protected CreateProcessEventAuditDO getPersistedObject(CreateProcessEventAuditPersistenceObject cpea)
                                                throws EventAuditException
Throws:
EventAuditException

getPersistedOldEventAuditDataObject

protected OldEventAuditDataDO getPersistedOldEventAuditDataObject(DataEventAuditDO deaDO,
                                                                  java.lang.String vdId)
                                                           throws EventAuditException
Throws:
EventAuditException

getPersistedNewEventAuditDataObject

protected NewEventAuditDataDO getPersistedNewEventAuditDataObject(DataEventAuditDO deaDO,
                                                                  java.lang.String vdId)
                                                           throws EventAuditException
Throws:
EventAuditException

getPersistedCreateProcessEventObjects

protected CreateProcessEventAuditDO[] getPersistedCreateProcessEventObjects(java.lang.String pId)
                                                                     throws EventAuditException
Throws:
EventAuditException

getPersistedActivityStateObject

protected ActivityStateEventAuditDO getPersistedActivityStateObject(java.lang.String value,
                                                                    boolean searchByKeyValue)
                                                             throws EventAuditException
Throws:
EventAuditException

getPersistedProcessStateObject

protected ProcessStateEventAuditDO getPersistedProcessStateObject(java.lang.String value,
                                                                  boolean searchByKeyValue)
                                                           throws EventAuditException
Throws:
EventAuditException

getPersistedEventTypeObject

protected EventTypeDO getPersistedEventTypeObject(java.lang.String value,
                                                  boolean searchByKeyValue)
                                           throws EventAuditException
Throws:
EventAuditException

getNextDecId

public java.math.BigDecimal getNextDecId(java.lang.String idName)
                                  throws EventAuditException
Throws:
EventAuditException

__getDBTransaction

protected com.lutris.appserver.server.sql.DBTransaction __getDBTransaction()
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

setLDBName

protected void setLDBName()

refreshDOCaches

protected void refreshDOCaches()
                        throws java.lang.Exception
Throws:
java.lang.Exception

listProcessHistoryInfoWhere

public java.util.List listProcessHistoryInfoWhere(WMSessionHandle shandle,
                                                  java.lang.String sqlWhere,
                                                  int startAt,
                                                  int limit,
                                                  boolean fillActivitiesInfo,
                                                  boolean fillActivityVariablesInfo,
                                                  boolean fillVariablesInfo)
                                           throws EventAuditException
Specified by:
listProcessHistoryInfoWhere in interface EventAuditManagerInterface
Throws:
EventAuditException

listActivityHistoryInfoWhere

public java.util.List listActivityHistoryInfoWhere(WMSessionHandle shandle,
                                                   java.lang.String sqlWhere,
                                                   int startAt,
                                                   int limit,
                                                   boolean fillVariablesInfo)
                                            throws EventAuditException
Specified by:
listActivityHistoryInfoWhere in interface EventAuditManagerInterface
Throws:
EventAuditException

listProcessDefinitionHistoryInfoWhere

public java.util.List listProcessDefinitionHistoryInfoWhere(WMSessionHandle shandle,
                                                            java.lang.String factoryName,
                                                            boolean countProcessInstances)
                                                     throws EventAuditException
Specified by:
listProcessDefinitionHistoryInfoWhere in interface EventAuditManagerInterface
Throws:
EventAuditException