Class DBEventLogManager

java.lang.Object
com.jalios.jcms.db.BasicDBListener
com.jalios.jcms.db.DBEventLogManager
All Implemented Interfaces:
DBConstants, DBListener, JcmsConstants, PluginComponent, AlarmListener, JaliosConstants, JPropertiesListener

public class DBEventLogManager extends BasicDBListener implements JPropertiesListener, AlarmListener, JcmsConstants
This class replays the hibernate events on all the other replicas.
Since:
jcms-6.0.0
Author:
Olivier Dedieu
  • Field Details

  • Method Details

    • getInstance

      public static DBEventLogManager getInstance()
    • propertiesChange

      public void propertiesChange(JProperties properties)
      Description copied from interface: JPropertiesListener
      Invoked after properties have been modified in JCMS and save on disk.

      You cannot alter the value received in parameters.

      Note that properties parameter may be null, a limited set of site properties, or all site properties.

      To check that a property has been modified, reload the "current" property instead using channel.getProperties or channel.getProperty.

      Specified by:
      propertiesChange in interface JPropertiesListener
      Parameters:
      properties - the properties which have been submitted to change
    • onPostInsert

      public void onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
      Description copied from interface: DBListener
      This method is called after a DBData has been created.
      Specified by:
      onPostInsert in interface DBListener
      Overrides:
      onPostInsert in class BasicDBListener
      Parameters:
      data - the data.
      event - the event.
      firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
      See Also:
    • onPostUpdate

      public void onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
      Description copied from interface: DBListener
      This method is called after a DBData has been updated.
      Specified by:
      onPostUpdate in interface DBListener
      Overrides:
      onPostUpdate in class BasicDBListener
      Parameters:
      data - the data.
      event - the event.
      firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
      See Also:
    • onPostDelete

      public void onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
      Description copied from interface: DBListener
      This method is called after a DBData has been deleted.
      Specified by:
      onPostDelete in interface DBListener
      Overrides:
      onPostDelete in class BasicDBListener
      Parameters:
      data - the deleted DBData. WARNING! In a JSync Cluster, when firstTime is false, this data will be null. In this case, to get information about this deleted data, you must use the event and in particular event.getId(), which returns the JPlatform ID of the data, and event.getDeletedState() which returns the attributes of the data.
      event - the event
      firstTime - true on the JSync replica on which the operation took place and false on the other replicas.
      See Also:
    • getReplicaUridSet

      public Set<String> getReplicaUridSet()
    • handleAlarm

      public void handleAlarm(AlarmEntry entry)
      Description copied from interface: AlarmListener
      Invoked when an alarm is triggered.
      Specified by:
      handleAlarm in interface AlarmListener
      Parameters:
      entry - the AlarmEntry which has been triggered.
    • processNewDBEventLogs

      public void processNewDBEventLogs(String sender)
    • getNewDBEventLogList

      @Deprecated protected List<DBEventLog> getNewDBEventLogList()
      Deprecated.
      This method should not be used any more as it's limited in size, other db event log will be not read after this limit before full scan
      Returns all the DBEventLog not yet processed by this replica.
      Returns:
      all the DBEventLog not yet processed by this replica (never return null). (size limited by QUERY_LIMIT_PROP)
      Since:
      jcms-6.0.0
    • getDBEventLogsSummary

      public List<DBEventLogSummary> getDBEventLogsSummary()
    • deleteDBEventLog

      public boolean deleteDBEventLog(String source, String target)
    • getNewDBEventLogScrollResult

      protected org.hibernate.ScrollableResults getNewDBEventLogScrollResult()
      Returns all the DBEventLog not yet processed by this replica.
      Returns:
      all the DBEventLog not yet processed by this replica (never return null).
      Since:
      jcms-10.0.8
    • resetNotificationTimerThreadLocal

      public void resetNotificationTimerThreadLocal()