Package com.jalios.jcms
Class StrongLockManager
java.lang.Object
com.jalios.jcms.db.BasicDBListener
com.jalios.jcms.StrongLockManager
- All Implemented Interfaces:
DBConstants,DBListener,PluginComponent,JPropertiesListener
This class manages StrongLock.
- Since:
- jcms-6.2.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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, CLASSIFICATION_LEVEL_FIELD, DBDATA_URID, EXTENDED_READ_RIGHTS, 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 -
Method Summary
Modifier and TypeMethodDescriptionbooleancanRequestUnlock(Data data, Member mbr) Returns true if the given member can request the unlock (by mail).booleanReturns true if the member can unlock the given databooleancanUnlock(StrongLock lock, Member mbr) Returns true if the member can unlock the given lockbooleancheckLockMember(Data data, Member mbr) Returns true if the given member has locked the given data or if the data is not locked.booleancheckLockMember(Data data, Member mbr, boolean useCache) Returns true if the given member has locked the given data or if the data is not locked.static StrongLockManagergetLockedDataSet(Class<T> clazz) Returns all the locked data for the given class.getLockedDataSet(Class<T> clazz, boolean useCache) Returns all the locked data for the given class.getLockedDataSet(Class<T> clazz, Member mbr) Returns all the locked data for the given class and locked by the given member.getLockInfo(Data data, Locale locale) Returns a string which explains who has the lock on the given data (return "" if the data is not locked)getLockInfo(Data data, Locale locale, boolean useCache) Returns a string which explains who has the lock on the given data (return "" if the data is not locked)getStrongLock(Data data) Returns the StrongLock bound to given data.getStrongLock(Data data, boolean useCache) Returns the StrongLock bound to given data.booleanReturns true if the given data is locked.voidLock the given data for the given member.voidLock the given data for the given member.voidonPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime) This method is called after a DBData has been deleted.voidonPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime) This method is called after a DBData has been created.voidonPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime) This method is called after a DBData has been updated.voidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.voidrefreshCacheEntry(Data data) Invalidate the cache entries for the given publicationvoidrequestUnlock(Data data, Member mbr, String message) Request to unlock the given data for the given membervoidReset the cache.voidUnlock the given data, without checking the member.voidUnlock the given datavoidUnlock the given dataMethods inherited from class com.jalios.jcms.db.BasicDBListener
getAdateFromState, getAuthorIdFromState, getCdateFromState, getDateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate
-
Field Details
-
CACHE_ENABLED_PROP
- See Also:
-
CACHE_MAX_ENTRIES_PROP
- See Also:
-
CACHE_EXPIRATION_PROP
- See Also:
-
UNLOCKED_CACHE_ENABLED_PROP
- See Also:
-
UNLOCKED_CACHE_MAX_ENTRIES_PROP
- See Also:
-
UNLOCKED_CACHE_EXPIRATION_PROP
- See Also:
-
DATA_ID_FIELD
- See Also:
-
REQUEST_UNLOCK_ALERT_NAME
- See Also:
-
UNLOCKED_ALERT_NAME
- See Also:
-
-
Method Details
-
getInstance
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked 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.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
getStrongLock
Returns the StrongLock bound to given data.- Parameters:
data- the data- Returns:
- the StrongLock bound to given data.
- Since:
- jcms-6.2.0
-
getStrongLock
Returns the StrongLock bound to given data.- Parameters:
data- the datauseCache- indicate if the cache can be used.- Returns:
- the StrongLock bound to given data.
- Since:
- jcms-6.2.0
-
isLocked
Returns true if the given data is locked.- Parameters:
data- the data- Returns:
- true if the given data is locked.
- Since:
- jcms-6.2.0
-
getLockedDataSet
Returns all the locked data for the given class.- Type Parameters:
T- Any Data type- Parameters:
clazz- the class- Returns:
- all the locked data for the given class.
- Since:
- jcms-6.2.0
-
getLockedDataSet
Returns all the locked data for the given class.- Type Parameters:
T- Any Data type- Parameters:
clazz- the classuseCache- use the cache if true- Returns:
- all the locked data for the given class.
- Since:
- jcms-6.2.0
-
getLockedDataSet
Returns all the locked data for the given class and locked by the given member.- Type Parameters:
T- Any Data type- Parameters:
clazz- the classmbr- the member- Returns:
- all the locked data for the given class and locked by the given member.
- Since:
- jcms-9.0.1
-
lock
Lock the given data for the given member.- Parameters:
data- the datambr- the member who puts the lock.- Since:
- jcms-6.2.0
-
lock
Lock the given data for the given member.- Parameters:
data- the datambr- the member who puts the lock.context- the context of the lockcontextData- the context data (custom data put by context manager)- Since:
- jcms-10.0.2
-
unlock
Unlock the given data- Parameters:
data- the datambr- the member who releases the lock (only the member who has locked and the admin can release the lock).- Since:
- jcms-6.2.0
-
unlock
Unlock the given data, without checking the member.- Parameters:
data- the data- Since:
- jcms-6.2.0
-
unlock
Unlock the given data- Parameters:
data- the datambr- the member who releases the lockforce- if false only the member who has locked and the admin can release the lock.- Since:
- jcms-6.2.0
-
canUnlock
Returns true if the member can unlock the given data- Parameters:
data- the datambr- the member- Returns:
- true if the member can unlock the given data
- Since:
- jcms-9.0.0
-
canUnlock
Returns true if the member can unlock the given lock- Parameters:
lock- the lockmbr- the member- Returns:
- true if the member can unlock the given lock
- Since:
- jcms-9.0.0
-
checkLockMember
Returns true if the given member has locked the given data or if the data is not locked.- Parameters:
data- the datambr- the member- Returns:
- true if the given member has locked the given data or if the data is not locked.
- Since:
- jcms-6.2.0
-
checkLockMember
Returns true if the given member has locked the given data or if the data is not locked.- Parameters:
data- the datambr- the memberuseCache- indicate if the cache can be used.- Returns:
- true if the given member has locked the given data or if the data is not locked.
- Since:
- jcms-10.0.1
-
getLockInfo
Returns a string which explains who has the lock on the given data (return "" if the data is not locked)- Parameters:
data- the datalocale- the locale- Returns:
- a string which explains who has the lock.
- Since:
- jcms-6.2.0
-
getLockInfo
Returns a string which explains who has the lock on the given data (return "" if the data is not locked)- Parameters:
data- the datalocale- the localeuseCache- indicate if the cache can be used.- Returns:
- a string which explains who has the lock.
- Since:
- jcms-6.2.0
-
canRequestUnlock
Returns true if the given member can request the unlock (by mail).- Parameters:
data- the datambr- the member who request the unlock- Returns:
- true if the given member can request the unlock.
- Since:
- jcms-8.0.0
-
requestUnlock
Request to unlock the given data for the given member- Parameters:
data- the locked datambr- the member who request the unlockmessage- a free message from the member who request the unlock- Since:
- jcms-8.0.0
-
resetCache
public void resetCache()Reset the cache. A new cache is initialized.- Since:
- jcms-6.2.0
-
refreshCacheEntry
Invalidate the cache entries for the given publication- Parameters:
data- the publication id- Since:
- jcms-6.2.0
-
onPostInsert
Description copied from interface:DBListenerThis method is called after a DBData has been created.- Specified by:
onPostInsertin interfaceDBListener- Overrides:
onPostInsertin classBasicDBListener- 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
Description copied from interface:DBListenerThis method is called after a DBData has been updated.- Specified by:
onPostUpdatein interfaceDBListener- Overrides:
onPostUpdatein classBasicDBListener- 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
Description copied from interface:DBListenerThis method is called after a DBData has been deleted.- Specified by:
onPostDeletein interfaceDBListener- Overrides:
onPostDeletein classBasicDBListener- 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.- See Also:
-