public class WOPILockManagerPlugin
extends org.exoplatform.container.component.BaseComponentPlugin
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CACHE_NAME
The Constant CACHE_NAME.
|
protected static long |
EXPIRES_DELAY
The Constant EXPIRES_DELAY.
|
protected ScheduledExecutorService |
expiresExecutor
The executor for removing expired locks.
|
protected org.exoplatform.services.jcr.RepositoryService |
jcrService
The jcr service.
|
protected static long |
LOCK_EXPIRES
The Constant LOCK_EXPIRES.
|
protected org.exoplatform.services.cache.ExoCache<String,FileLock> |
locks
The locks.
|
protected org.exoplatform.services.cms.lock.LockService |
lockService
The lock service.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
protected static String |
MIX_LOCKABLE
The Constant MIX_LOCKABLE.
|
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders
The session providers.
|
| Constructor and Description |
|---|
WOPILockManagerPlugin(org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.cms.lock.LockService lockService)
Instantiates a new WOPI lock manager plugin.
|
| Modifier and Type | Method and Description |
|---|---|
FileLock |
getLock(javax.jcr.Node node)
Gets the lock from cache.
|
protected javax.jcr.Session |
getSystemSession()
Gets the system session.
|
protected javax.jcr.Session |
getUserSession(String workspace)
Gets the user session.
|
void |
lock(javax.jcr.Node node,
String lockId)
Locks the node with provided lockId, stores the lock in the cache.
|
void |
refreshLock(javax.jcr.Node node,
String lockId)
Refreshes lock by prolonging the lock expires.
|
protected void |
removeExpired()
Removes the expired locks or locks with expiration time less than EXPIRES_DELAY.
|
void |
unlock(javax.jcr.Node node,
String lockId,
String workspace)
Unlocks the node with provided lockId.
|
protected static final String CACHE_NAME
protected static final String MIX_LOCKABLE
protected static final org.exoplatform.services.log.Log LOG
protected static final long LOCK_EXPIRES
protected static final long EXPIRES_DELAY
protected org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected org.exoplatform.services.jcr.RepositoryService jcrService
protected org.exoplatform.services.cms.lock.LockService lockService
protected ScheduledExecutorService expiresExecutor
public WOPILockManagerPlugin(org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.cms.lock.LockService lockService)
cacheService - the cache servicesessionProviders - the session providersjcrService - the jcr servicelockService - the lock servicepublic void lock(javax.jcr.Node node,
String lockId)
throws javax.jcr.RepositoryException,
LockMismatchException
node - the nodelockId - the lock idjavax.jcr.RepositoryException - the repository exceptionLockMismatchException - the lock mismatch exceptionpublic FileLock getLock(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionpublic void unlock(javax.jcr.Node node,
String lockId,
String workspace)
throws javax.jcr.RepositoryException,
LockMismatchException
node - the nodelockId - the lock idworkspace - the workspacejavax.jcr.RepositoryException - the repository exceptionLockMismatchException - if the node isn't locked of provided lockId doesn't match the current onepublic void refreshLock(javax.jcr.Node node,
String lockId)
throws javax.jcr.RepositoryException,
LockMismatchException
node - the nodelockId - the lock idjavax.jcr.RepositoryException - the repository exceptionLockMismatchException - the lock mismatch exceptionprotected javax.jcr.Session getUserSession(String workspace) throws javax.jcr.RepositoryException
workspace - the workspacejavax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.Session getSystemSession()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - the repository exceptionprotected void removeExpired()
Copyright © 2003–2020 eXo Platform SAS. All rights reserved.