Package com.jalios.jcms.db
Class BasicDBListener
- java.lang.Object
-
- com.jalios.jcms.db.BasicDBListener
-
- All Implemented Interfaces:
DBConstants
,DBListener
,PluginComponent
- Direct Known Subclasses:
AlertListener
,BasicDBListenerStoreListener
,CacheDBListener
,DBContentListener
,DBEventLogManager
,MediaProgressionManager
,MemberPreferenceListener
,PublicationFollowerListener
,ReaderTrackerManager
,StrongLockManager
,VoteListener
,VoteManager
,WorkspaceDBMemberListener
public class BasicDBListener extends java.lang.Object implements DBListener, DBConstants, PluginComponent
This class is a default implementation of DBListener.- Since:
- jcms-6.0.0
- Version:
- $Revision: 122811 $
- Author:
- Olivier Dedieu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_OPAUTHOR, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READ_ACK, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_RESTRICTIVE_UPDATE_RIGHTS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, OPAUTHOR_ID_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
-
-
Constructor Summary
Constructors Constructor Description BasicDBListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Date
getAdateFromState(java.lang.Object[] state)
Returns the adate from the given hibernate state.java.lang.String
getAuthorIdFromState(java.lang.Object[] state)
Returns the authorId from the given hibernate state.java.util.Date
getCdateFromState(java.lang.Object[] state)
Returns the cdate from the given hibernate state.java.util.Date
getDateFromState(java.lang.Object[] state, int index)
Returns the given date from the given hibernate state.java.util.Date
getEdateFromState(java.lang.Object[] state)
Returns the edate from the given hibernate state.java.util.Date
getMdateFromState(java.lang.Object[] state)
Returns the mdate from the given hibernate state.java.util.Date
getPdateFromState(java.lang.Object[] state)
Returns the pdate from the given hibernate state.int
getPrePstatus(org.hibernate.event.PostUpdateEvent event)
Returns the pstatus from the given PostUpdateEvent.int
getPrePstatus(org.hibernate.event.PreUpdateEvent event)
Returns the pstatus from the given PreUpdateEvent.int
getPstatusFromState(java.lang.Object[] state)
Returns the pstatus from the given hibernate state.boolean
hasNoChange(org.hibernate.event.PostUpdateEvent event)
boolean
hasNoChange(org.hibernate.event.PreUpdateEvent event)
boolean
init(Plugin plugin)
Initialize the component with the given plugin configurationvoid
onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
This method is called after a DBData has been deleted.void
onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
This method is called after a DBData has been created.void
onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
This method is called after a DBData has been updated.void
onPreUpdate(DBData data, org.hibernate.event.PreUpdateEvent event)
This method is called before a DBData is updated.
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public boolean init(Plugin plugin)
Description copied from interface:PluginComponent
Initialize the component with the given plugin configuration- Specified by:
init
in interfacePluginComponent
- Parameters:
plugin
- the calling plugin- Returns:
- true if the component has been correctly initialized.
- Since:
- jcms-6.0.0
- See Also:
PluginComponent.init(Plugin)
-
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 interfaceDBListener
- 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.- Since:
- jcms-6.0.0
- See Also:
DBListener.onPostInsert(DBData, PostInsertEvent, boolean)
-
onPreUpdate
public void onPreUpdate(DBData data, org.hibernate.event.PreUpdateEvent event)
Description copied from interface:DBListener
This method is called before a DBData is updated.- Specified by:
onPreUpdate
in interfaceDBListener
- Parameters:
data
- the data.event
- the event.- Since:
- jcms-6.0.0
- See Also:
DBListener.onPreUpdate(DBData, PreUpdateEvent)
-
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 interfaceDBListener
- 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.- Since:
- jcms-6.0.0
- See Also:
DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)
-
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 interfaceDBListener
- 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 eventfirstTime
- true on the JSync replica on which the operation took place and false on the other replicas.- Since:
- jcms-6.0.0
- See Also:
DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
-
hasNoChange
public boolean hasNoChange(org.hibernate.event.PreUpdateEvent event)
-
hasNoChange
public boolean hasNoChange(org.hibernate.event.PostUpdateEvent event)
-
getCdateFromState
public java.util.Date getCdateFromState(java.lang.Object[] state)
Returns the cdate from the given hibernate state.- Parameters:
state
- the state- Returns:
- the cdate from the given hibernate state.
- Since:
- jcms-6.0.0
-
getMdateFromState
public java.util.Date getMdateFromState(java.lang.Object[] state)
Returns the mdate from the given hibernate state.- Parameters:
state
- the state- Returns:
- the mdate from the given hibernate state.
- Since:
- jcms-6.0.0
-
getAuthorIdFromState
public java.lang.String getAuthorIdFromState(java.lang.Object[] state)
Returns the authorId from the given hibernate state.- Parameters:
state
- the state- Returns:
- the authorId from the given hibernate state.
- Since:
- jcms-6.0.0
-
getPstatusFromState
public int getPstatusFromState(java.lang.Object[] state)
Returns the pstatus from the given hibernate state.- Parameters:
state
- the state- Returns:
- the pstatus from the given hibernate state.
- Since:
- jcms-6.0.0
-
getPdateFromState
public java.util.Date getPdateFromState(java.lang.Object[] state)
Returns the pdate from the given hibernate state.- Parameters:
state
- the state- Returns:
- the pdate from the given hibernate state.
- Since:
- jcms-6.0.0
-
getEdateFromState
public java.util.Date getEdateFromState(java.lang.Object[] state)
Returns the edate from the given hibernate state.- Parameters:
state
- the state- Returns:
- the edate from the given hibernate state.
- Since:
- jcms-6.0.0
-
getAdateFromState
public java.util.Date getAdateFromState(java.lang.Object[] state)
Returns the adate from the given hibernate state.- Parameters:
state
- the state- Returns:
- the adate from the given hibernate state.
- Since:
- jcms-6.0.0
-
getPrePstatus
public int getPrePstatus(org.hibernate.event.PreUpdateEvent event)
Returns the pstatus from the given PreUpdateEvent.- Parameters:
event
- the event- Returns:
- the pstatus from the given PreUpdateEvent.
- Since:
- jcms-6.0.0
-
getPrePstatus
public int getPrePstatus(org.hibernate.event.PostUpdateEvent event)
Returns the pstatus from the given PostUpdateEvent.- Parameters:
event
- the event- Returns:
- the pstatus from the given PostUpdateEvent.
- Since:
- jcms-6.0.0
-
getDateFromState
public java.util.Date getDateFromState(java.lang.Object[] state, int index)
Returns the given date from the given hibernate state.- Parameters:
state
- the stateindex
- the index of the date field in the state- Returns:
- the given date from the given hibernate state.
- Since:
- jcms-8.0.2
-
-