org.alfresco.service.cmr.avm.locking
Interface AVMLockingService

All Known Implementing Classes:
AVMLockingServiceImpl

public interface AVMLockingService

Service to handle AVM locking.


Nested Class Summary
static class AVMLockingService.Type
           
 
Method Summary
 void addWebProject(java.lang.String webProject)
          Add a web project to the locking tables if it doesn't already exist.
 AVMLock getLock(java.lang.String webProject, java.lang.String path)
          Get a lock on a given path
 java.util.List getStoreLocks(java.lang.String store)
          Get all locks that reside in a given store.
 java.util.List getUsersLocks(java.lang.String user)
          Get all the locks that a user owns.
 java.util.List getWebProjectLocks(java.lang.String webProject)
          Get all locks in a give web project.
 java.util.List getWebProjects()
          Get the names of all the web projects the service knows about.
 boolean hasAccess(NodeRef webProjectRef, java.lang.String avmPath, java.lang.String user)
          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 user)
          Is the user allowed to do anything to the given asset, other than read?
 void lockPath(AVMLock lock)
          Creates a lock of the given type on a path.
 void modifyLock(java.lang.String webProject, java.lang.String path, java.lang.String newPath, java.lang.String newStore, java.util.List usersToRemove, java.util.List usersToAdd)
          Modify a lock.
 void removeLock(java.lang.String webProject, java.lang.String path)
          Remove a lock.
 void removeLocksInDirectory(java.lang.String webProject, java.lang.String store, java.lang.String path)
          Remove all locks on files contained within a directory.
 void removeStoreLocks(java.lang.String store)
          Removes all locks residing in a store.
 void removeWebProject(java.lang.String webProject)
          Remove a web project and all associated data from the locking tables.
 

Method Detail

lockPath

void lockPath(AVMLock lock)
Creates a lock of the given type on a path. The lock is used to control access to all the corresponding paths in the given path's web project.

Parameters:
lock - The lock structure to create.

getLock

AVMLock getLock(java.lang.String webProject,
                java.lang.String path)
Get a lock on a given path

Parameters:
webProject - The website for which to get the lock.
path - The path to check for a lock.
Returns:
The Lock structure or null if there is no lock.

modifyLock

void modifyLock(java.lang.String webProject,
                java.lang.String path,
                java.lang.String newPath,
                java.lang.String newStore,
                java.util.List usersToRemove,
                java.util.List usersToAdd)
Modify a lock. Null change parameters are ignored.

Parameters:
webProject - The name of the web project.
path - The path of the lock.
newPath - The path that the lock should be given. (may be null)
newStore - The store that the lock should be given. (may be null)
usersToRemove - List of users to remove from the lock. (may be null)
usersToAdd - List of users to add to the lock. (may be null)

removeLock

void removeLock(java.lang.String webProject,
                java.lang.String path)
Remove a lock.

Parameters:
webProject - The web project the lock lives in.
path - The store relative path of the lock.

removeLocksInDirectory

void removeLocksInDirectory(java.lang.String webProject,
                            java.lang.String store,
                            java.lang.String path)
Remove all locks on files contained within a directory.

Parameters:
webProject -
store -
path -

removeStoreLocks

void removeStoreLocks(java.lang.String store)
Removes all locks residing in a store.

Parameters:
store - The store name.

getUsersLocks

java.util.List getUsersLocks(java.lang.String user)
Get all the locks that a user owns.

Parameters:
user - The name of the user.
Returns:
The (possibly empty list) of the user's locks.

addWebProject

void addWebProject(java.lang.String webProject)
Add a web project to the locking tables if it doesn't already exist.

Parameters:
webProject - The web project name.

removeWebProject

void removeWebProject(java.lang.String webProject)
Remove a web project and all associated data from the locking tables.

Parameters:
webProject - The web project name.

getWebProjectLocks

java.util.List getWebProjectLocks(java.lang.String webProject)
Get all locks in a give web project.

Parameters:
webProject - The web project name.
Returns:
All the locks found.

getStoreLocks

java.util.List getStoreLocks(java.lang.String store)
Get all locks that reside in a given store.

Parameters:
store - The store name.
Returns:
All the locks found.

hasAccess

boolean hasAccess(java.lang.String webProject,
                  java.lang.String avmPath,
                  java.lang.String user)
Is the user allowed to do anything to the given asset, other than read?

Parameters:
webProject - The name of the web project that this path is being checked in.
avmPath - A full avmPath
user - The name of the user, group, role to check on.
Returns:
Whether the user has access.

hasAccess

boolean hasAccess(NodeRef webProjectRef,
                  java.lang.String avmPath,
                  java.lang.String user)
Is the user allowed to do anything to the given asset, other than read?

Parameters:
webProjectRef - The NodeRef to the web project that this path is being checked in.
avmPath - A full avmPath
user - The name of the user, group, role to check on.
Returns:
Whether the user has access.

getWebProjects

java.util.List getWebProjects()
Get the names of all the web projects the service knows about.

Returns:
The list of web project names.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.