public class StrongLockManager extends BasicDBListener
Modifier and Type | Class and Description |
---|---|
class |
StrongLockManager.CacheEntry |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHE_ENABLED_PROP |
static java.lang.String |
CACHE_MAX_ENTRIES_PROP |
static java.lang.String |
DATA_ID_FIELD |
static java.lang.String |
REVISION |
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MDATE_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
Modifier and Type | Method and Description |
---|---|
boolean |
canRequestUnlock(Data data,
Member mbr)
Returns true if the given member can request the lock (by mail).
|
boolean |
checkLockMember(Data data,
Member mbr)
Returns true if the given member has locked the given data or if the data is not locked.
|
static StrongLockManager |
getInstance() |
<T extends Data> |
getLockedDataSet(java.lang.Class<T> clazz)
Returns all the locked data for the given class.
|
<T extends Data> |
getLockedDataSet(java.lang.Class<T> clazz,
boolean useCache)
Returns all the locked data for the given class.
|
java.lang.String |
getLockInfo(Data data,
java.util.Locale locale)
Returns a string which explains who has the lock on the given data (return "" if the data is not locked)
|
StrongLock |
getStrongLock(Data data)
Returns the StrongLock bound to given data.
|
StrongLock |
getStrongLock(Data data,
boolean useCache)
Returns the StrongLock bound to given data.
|
boolean |
isLocked(Data data)
Returns true if the given data is locked.
|
void |
lock(Data data,
Member mbr)
Lock the given data for the given member.
|
void |
onPostDelete(DBData data,
org.hibernate.event.PostDeleteEvent event,
boolean firstTime) |
void |
onPostInsert(DBData data,
org.hibernate.event.PostInsertEvent event,
boolean firstTime) |
void |
onPostUpdate(DBData data,
org.hibernate.event.PostUpdateEvent event,
boolean firstTime) |
void |
refreshCacheEntry(Data data)
Invalidate the cache entries for the given publication
|
void |
requestUnlock(Data data,
Member mbr,
java.lang.String message)
Request to unlock the given data for the given member
|
void |
resetCache()
Reset the cache.
|
void |
unlock(Data data)
Unlock the given data, without checking the member.
|
void |
unlock(Data data,
Member mbr)
Unlock the given data
|
void |
unlock(Data data,
Member mbr,
boolean force)
Unlock the given data
|
getAdateFromState, getAuthorIdFromState, getCdateFromState, getEdateFromState, getMdateFromState, getPdateFromState, getPrePstatus, getPrePstatus, getPstatusFromState, hasNoChange, hasNoChange, init, onPreUpdate
public static final java.lang.String REVISION
public static final java.lang.String CACHE_ENABLED_PROP
public static final java.lang.String CACHE_MAX_ENTRIES_PROP
public static final java.lang.String DATA_ID_FIELD
public static StrongLockManager getInstance()
public StrongLock getStrongLock(Data data)
data
- the datapublic StrongLock getStrongLock(Data data, boolean useCache)
data
- the datauseCache
- indicate if the cache can be used.public boolean isLocked(Data data)
data
- the datapublic <T extends Data> java.util.Set<T> getLockedDataSet(java.lang.Class<T> clazz)
T
- Any Data typeclazz
- the classpublic <T extends Data> java.util.Set<T> getLockedDataSet(java.lang.Class<T> clazz, boolean useCache)
T
- Any Data typeclazz
- the classuseCache
- use the cache if truepublic void lock(Data data, Member mbr)
data
- the datambr
- the member who puts the lock.public void unlock(Data data, Member mbr)
data
- the datambr
- the member who releases the lock
(only the member who has locked and the admin
can release the lock).public void unlock(Data data)
data
- the datapublic void unlock(Data data, Member mbr, boolean force)
data
- the datambr
- the member who releases the lockforce
- if false only the member who has locked and the admin can release the lock.public boolean checkLockMember(Data data, Member mbr)
data
- the datambr
- the memberpublic java.lang.String getLockInfo(Data data, java.util.Locale locale)
data
- the datalocale
- the localepublic boolean canRequestUnlock(Data data, Member mbr)
data
- the datambr
- the member who request the lockpublic void requestUnlock(Data data, Member mbr, java.lang.String message)
data
- the locked datambr
- the member who request the lockmessage
- a free message from the member who request the lockpublic void resetCache()
public void refreshCacheEntry(Data data)
data
- the publication idpublic void onPostInsert(DBData data, org.hibernate.event.PostInsertEvent event, boolean firstTime)
onPostInsert
in interface DBListener
onPostInsert
in class BasicDBListener
DBListener.onPostInsert(DBData, PostInsertEvent, boolean)
public void onPostUpdate(DBData data, org.hibernate.event.PostUpdateEvent event, boolean firstTime)
onPostUpdate
in interface DBListener
onPostUpdate
in class BasicDBListener
DBListener.onPostUpdate(DBData, PostUpdateEvent, boolean)
public void onPostDelete(DBData data, org.hibernate.event.PostDeleteEvent event, boolean firstTime)
onPostDelete
in interface DBListener
onPostDelete
in class BasicDBListener
DBListener.onPostDelete(DBData, PostDeleteEvent, boolean)
Copyright © 2001-2010 Jalios SA. All Rights Reserved.