|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.lock.CmsLockManager
The CmsLockManager is used by the Cms application to detect the lock state of a resource.
The lock state depends on the path of the resource, and probably locked parent folders. The result of a query to the lock manager are instances of CmsLock objects.
CmsObject.getLock(CmsResource)
,
CmsLock
Method Summary | |
void |
addResource(CmsDriverManager driverManager,
CmsDbContext dbc,
CmsResource resource,
CmsUUID userId,
int projectId,
int mode)
Adds a resource to the lock manager. |
int |
countExclusiveLocksInFolder(java.lang.String foldername)
Counts the exclusive locked resources inside a folder. |
int |
countExclusiveLocksInProject(CmsProject project)
Counts the exclusive locked resources in a project. |
protected void |
finalize()
|
static CmsLockManager |
getInstance()
Returns the shared instance of the lock manager. |
CmsLock |
getLock(CmsDriverManager driverManager,
CmsDbContext dbc,
CmsResource resource)
Returns the lock for a resource. |
boolean |
isLocked(CmsDriverManager driverManager,
CmsDbContext dbc,
CmsResource resource)
Proves if a resource is locked. |
void |
removeDeletedResource(CmsDriverManager driverManager,
CmsDbContext dbc,
java.lang.String resourceName)
Removes a resource after it has been deleted by the driver manager. |
CmsLock |
removeResource(CmsDriverManager driverManager,
CmsDbContext dbc,
CmsResource resource,
boolean forceUnlock)
Removes a resource from the lock manager. |
void |
removeResourcesInProject(int projectId)
Removes all resources that are exclusively locked in a project. |
void |
removeTempLocks(CmsUUID userId)
Removes all exclusive temporary locks of a user. |
int |
size()
Returns the number of exclusive locked resources. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static CmsLockManager getInstance()
public void addResource(CmsDriverManager driverManager, CmsDbContext dbc, CmsResource resource, CmsUUID userId, int projectId, int mode) throws CmsLockException, CmsException
driverManager
- the driver managerdbc
- the current database contextresource
- the resourceuserId
- the ID of the user who locked the resourceprojectId
- the ID of the project where the resource is lockedmode
- flag indicating the mode (temporary or common) of a lock
CmsLockException
- if the resource is locked
CmsException
- if somethong goes wrongpublic int countExclusiveLocksInFolder(java.lang.String foldername)
foldername
- the folder
public int countExclusiveLocksInProject(CmsProject project)
project
- the project
public CmsLock getLock(CmsDriverManager driverManager, CmsDbContext dbc, CmsResource resource) throws CmsException
driverManager
- the driver managerdbc
- the current database contextresource
- the resource
CmsException
- if something goes wrongpublic boolean isLocked(CmsDriverManager driverManager, CmsDbContext dbc, CmsResource resource) throws CmsException
Use getLock(CmsDriverManager, CmsDbContext, CmsResource)
to obtain a CmsLock object for the specified resource to get further information
about how the resource is locked.
driverManager
- the driver managerdbc
- the current database contextresource
- the resource
CmsException
- if something goes wrongpublic void removeDeletedResource(CmsDriverManager driverManager, CmsDbContext dbc, java.lang.String resourceName) throws CmsException
driverManager
- the driver managerdbc
- the current database contextresourceName
- the root path of the deleted resource
CmsException
- if something goes wrongpublic CmsLock removeResource(CmsDriverManager driverManager, CmsDbContext dbc, CmsResource resource, boolean forceUnlock) throws CmsException
The forceUnlock option should be used with caution. forceUnlock will remove the lock by ignoring any rules which may cause wrong lock states.
driverManager
- the driver managerdbc
- the current database contextresource
- the resourceforceUnlock
- true, if a resource is forced to get unlocked, no matter by which user and in which project the resource is currently locked
CmsException
- if something goes wrongpublic void removeResourcesInProject(int projectId)
projectId
- the ID of the project where the resources have been lockedpublic void removeTempLocks(CmsUUID userId)
userId
- the ID of the user whose locks are removedpublic int size()
public java.lang.String toString()
Object.toString()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |