|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.avm.locking.AVMLockingServiceImpl
public class AVMLockingServiceImpl
Implementation of the lock service.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.avm.locking.AVMLockingService |
---|
AVMLockingService.LockState |
Field Summary | |
---|---|
static java.lang.String |
KEY_AVM_LOCKS
|
static java.lang.String |
KEY_LOCK_OWNER
|
Constructor Summary | |
---|---|
AVMLockingServiceImpl()
|
Method Summary | |
---|---|
java.util.Map |
getLockData(java.lang.String avmStore,
java.lang.String path)
Get the data associated with a lock |
java.lang.String |
getLockOwner(java.lang.String avmStore,
java.lang.String path)
Get the current holder of a lock on AVM store path |
AVMLockingService.LockState |
getLockState(java.lang.String avmStore,
java.lang.String path,
java.lang.String lockOwner)
Get the state of a lock with respect to a given AVM store, path and user |
boolean |
hasAccess(org.alfresco.service.cmr.repository.NodeRef webProjectRef,
java.lang.String avmPath,
java.lang.String lockOwner)
Is the user allowed to do anything to the given asset, other than read? |
boolean |
hasAccess(java.lang.String webProject,
java.lang.String avmPath,
java.lang.String lockOwner)
Is the user allowed to do anything to the given asset, other than read? |
void |
lock(java.lang.String avmStore,
java.lang.String path,
java.lang.String lockOwner,
java.util.Map lockData)
Creates a lock of the given type on a path within an AVM store. |
boolean |
modifyLock(java.lang.String avmStore,
java.lang.String path,
java.lang.String lockOwner,
java.lang.String newAvmStore,
java.lang.String newPath,
java.util.Map lockData)
Modify a lock if it exists or do nothing if it doesn't. |
static java.lang.String |
normalizePath(java.lang.String path)
Utility to get relative paths into canonical lock form - remove first forward slash - multiple forward slashes collapsed into single foward slash |
void |
removeLock(java.lang.String avmStore,
java.lang.String path)
Remove a lock. |
void |
removeLocks(java.lang.String avmStore)
Remove all locks for a specific AVM store |
void |
removeLocks(java.lang.String avmStore,
java.util.Map lockDataToMatch)
Remove all locks for a specific AVM store that also optionally match a map of lock data entries. |
void |
removeLocks(java.lang.String avmStore,
java.lang.String dirPath,
java.util.Map lockDataToMatch)
Remove all locks for a specific AVM store that start with a given directory path that also optionally match a map of lock data entries. |
void |
setAttributeService(AttributeService attributeService)
|
void |
setAuthorityService(AuthorityService authorityService)
|
void |
setAvmLockDAO(AVMLockDAO avmLockDAO)
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
|
void |
setPersonService(PersonService personService)
|
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
|
void |
setWebProjectStore(java.lang.String webProjectStore)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String KEY_AVM_LOCKS
public static final java.lang.String KEY_LOCK_OWNER
Constructor Detail |
---|
public AVMLockingServiceImpl()
Method Detail |
---|
public void setWebProjectStore(java.lang.String webProjectStore)
webProjectStore
- The webProjectStore to setpublic void setAttributeService(AttributeService attributeService)
attributeService
- the service to persist attributespublic void setAuthorityService(AuthorityService authorityService)
authorityService
- the service to check validity of usernamespublic void setPersonService(PersonService personService)
personService
- checks validity of person namespublic void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setAvmLockDAO(AVMLockDAO avmLockDAO)
public void lock(java.lang.String avmStore, java.lang.String path, java.lang.String lockOwner, java.util.Map lockData)
lock
in interface AVMLockingService
avmStore
- the name of the AVM storepath
- the relative path of the locklockOwner
- the user taking the locklockData
- additional data to append to the lockpublic boolean modifyLock(java.lang.String avmStore, java.lang.String path, java.lang.String lockOwner, java.lang.String newAvmStore, java.lang.String newPath, java.util.Map lockData)
modifyLock
in interface AVMLockingService
avmStore
- the name of the AVM storepath
- the relative path of the locklockOwner
- the user taking the lock and who must also own the existing locknewAvmStore
- the name of the new AVM storenewPath
- the new relative path of the locklockData
- the new additional data to append to the lock
public java.lang.String getLockOwner(java.lang.String avmStore, java.lang.String path)
getLockOwner
in interface AVMLockingService
avmStore
- the name of the AVM storepath
- the relative path of the lock
public java.util.Map getLockData(java.lang.String avmStore, java.lang.String path)
getLockData
in interface AVMLockingService
avmStore
- the name of the AVM storepath
- the relative path of the lock
public AVMLockingService.LockState getLockState(java.lang.String avmStore, java.lang.String path, java.lang.String lockOwner)
getLockState
in interface AVMLockingService
avmStore
- the name of the AVM storepath
- the relative path of the locklockOwner
- the user who might own the lock
public void removeLock(java.lang.String avmStore, java.lang.String path)
removeLock
in interface AVMLockingService
path
- the relative path of the lockpublic void removeLocks(java.lang.String avmStore)
removeLocks
in interface AVMLockingService
avmStore
- the name of the AVM storepublic void removeLocks(java.lang.String avmStore, java.lang.String dirPath, java.util.Map lockDataToMatch)
removeLocks
in interface AVMLockingService
avmStore
- the name of the AVM storedirPath
- optional - start with given directory path or null to match alllockDataToMatch
- optional - lock data to match (note: all entries must match) or null/empty to match allpublic void removeLocks(java.lang.String avmStore, java.util.Map lockDataToMatch)
removeLocks
in interface AVMLockingService
avmStore
- the name of the AVM storelockDataToMatch
- optional - lock data to match (note: all entries must match) or null/empty to match allpublic boolean hasAccess(java.lang.String webProject, java.lang.String avmPath, java.lang.String lockOwner)
hasAccess
in interface AVMLockingService
webProject
- the name of the WCM projectlockOwner
- the user to check
public boolean hasAccess(org.alfresco.service.cmr.repository.NodeRef webProjectRef, java.lang.String avmPath, java.lang.String lockOwner)
hasAccess
in interface AVMLockingService
webProjectRef
- the name of the WCM projectlockOwner
- the user to check
public static java.lang.String normalizePath(java.lang.String path)
path
- The incoming path.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |