org.apache.jackrabbit.core.security.authorization
Class AbstractCompiledPermissions

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authorization.AbstractCompiledPermissions
All Implemented Interfaces:
CompiledPermissions

public abstract class AbstractCompiledPermissions
extends Object
implements CompiledPermissions

AbstractCompiledPermissions...


Nested Class Summary
static class AbstractCompiledPermissions.Result
           
 
Field Summary
 
Fields inherited from interface org.apache.jackrabbit.core.security.authorization.CompiledPermissions
NO_PERMISSION
 
Constructor Summary
protected AbstractCompiledPermissions()
           
 
Method Summary
protected abstract  AbstractCompiledPermissions.Result buildResult(Path absPath)
           
 boolean canReadAll()
          Returns true if READ permission is granted everywhere.
protected  void clearCache()
          Removes all entries from the cache.
 void close()
          Indicate to this CompiledPermissions object that it is not used any more.
 int getPrivileges(Path absPath)
          Returns the Privilege bits granted by the underlying policy if the given absPath denotes an existing Node, otherwise it returns zero.
 AbstractCompiledPermissions.Result getResult(Path absPath)
           
 boolean grants(Path absPath, int permissions)
          Returns true if the specified permissions are granted on the item identified by the given path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.core.security.authorization.CompiledPermissions
canRead
 

Constructor Detail

AbstractCompiledPermissions

protected AbstractCompiledPermissions()
Method Detail

getResult

public AbstractCompiledPermissions.Result getResult(Path absPath)
                                             throws RepositoryException
Parameters:
absPath - Absolute path to return the result for.
Returns:
the Result for the give absPath.
Throws:
RepositoryException - if an error occurs.

buildResult

protected abstract AbstractCompiledPermissions.Result buildResult(Path absPath)
                                                           throws RepositoryException
Parameters:
absPath - Absolute path to build the result for.
Returns:
Result for the specified absPath.
Throws:
RepositoryException - If an error occurs.

clearCache

protected void clearCache()
Removes all entries from the cache.


close

public void close()
Description copied from interface: CompiledPermissions
Indicate to this CompiledPermissions object that it is not used any more.

Specified by:
close in interface CompiledPermissions
See Also:
CompiledPermissions.close()

grants

public boolean grants(Path absPath,
                      int permissions)
               throws RepositoryException
Description copied from interface: CompiledPermissions
Returns true if the specified permissions are granted on the item identified by the given path.

Specified by:
grants in interface CompiledPermissions
Parameters:
absPath - Absolute path pointing to an item. If the item does not exist yet (asking for 'add-node' and 'set-property' permission), it's direct ancestor must exist.
permissions - A combination of one or more of permission constants defined by Permission encoded as a bitmask value
Returns:
true if the specified permissions are granted, false otherwise.
Throws:
RepositoryException - if an error occurs.
See Also:
CompiledPermissions.grants(Path, int)

getPrivileges

public int getPrivileges(Path absPath)
                  throws RepositoryException
Description copied from interface: CompiledPermissions
Returns the Privilege bits granted by the underlying policy if the given absPath denotes an existing Node, otherwise it returns zero.

Specified by:
getPrivileges in interface CompiledPermissions
Parameters:
absPath - Absolute path to a Node.
Returns:
the granted privileges at absPath or zero if the path does not denote an existing Node.
Throws:
RepositoryException - if an error occurs
See Also:
CompiledPermissions.getPrivileges(Path)

canReadAll

public boolean canReadAll()
                   throws RepositoryException
Description copied from interface: CompiledPermissions
Returns true if READ permission is granted everywhere. This method acts as shortcut for CompiledPermissions.grants(Path, int) where permissions is Permission.READ and allows to shorten the evaluation time given the fact that a check for READ permission is considered to be the most frequent test.

Specified by:
canReadAll in interface CompiledPermissions
Returns:
true if the READ permission is granted everywhere.
Throws:
RepositoryException - if an error occurs
See Also:
CompiledPermissions.canReadAll()


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.