public class AVMLockingServiceImpl extends java.lang.Object implements AVMLockingService
AVMLockingService.LockState| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_AVM_LOCKS |
static java.lang.String |
KEY_LOCK_OWNER |
| Constructor and Description |
|---|
AVMLockingServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final java.lang.String KEY_AVM_LOCKS
public static final java.lang.String KEY_LOCK_OWNER
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 AVMLockingServiceavmStore - 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 AVMLockingServiceavmStore - 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 lockpublic java.lang.String getLockOwner(java.lang.String avmStore,
java.lang.String path)
getLockOwner in interface AVMLockingServiceavmStore - the name of the AVM storepath - the relative path of the lockpublic java.util.Map getLockData(java.lang.String avmStore,
java.lang.String path)
getLockData in interface AVMLockingServiceavmStore - the name of the AVM storepath - the relative path of the lockpublic AVMLockingService.LockState getLockState(java.lang.String avmStore, java.lang.String path, java.lang.String lockOwner)
getLockState in interface AVMLockingServiceavmStore - the name of the AVM storepath - the relative path of the locklockOwner - the user who might own the lockpublic void removeLock(java.lang.String avmStore,
java.lang.String path)
removeLock in interface AVMLockingServicepath - the relative path of the lockpublic void removeLocks(java.lang.String avmStore)
removeLocks in interface AVMLockingServiceavmStore - the name of the AVM storepublic void removeLocks(java.lang.String avmStore,
java.lang.String dirPath,
java.util.Map lockDataToMatch)
removeLocks in interface AVMLockingServiceavmStore - 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 AVMLockingServiceavmStore - 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 AVMLockingServicewebProject - the name of the WCM projectlockOwner - the user to checkpublic boolean hasAccess(org.alfresco.service.cmr.repository.NodeRef webProjectRef,
java.lang.String avmPath,
java.lang.String lockOwner)
hasAccess in interface AVMLockingServicewebProjectRef - the name of the WCM projectlockOwner - the user to checkpublic static java.lang.String normalizePath(java.lang.String path)
path - The incoming path.Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.