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

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authorization.UnmodifiableAccessControlList
All Implemented Interfaces:
AccessControlList, AccessControlPolicy, org.apache.jackrabbit.api.security.JackrabbitAccessControlList, org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy

public class UnmodifiableAccessControlList
extends Object
implements org.apache.jackrabbit.api.security.JackrabbitAccessControlList

An implementation of the AccessControlList interface that only allows for reading. The write methods (addAccessControlEntry and removeAccessControlEntry) throw an AccessControlException.


Constructor Summary
UnmodifiableAccessControlList(AccessControlList acl)
          Construct a new UnmodifiableAccessControlList
UnmodifiableAccessControlList(List<? extends AccessControlEntry> accessControlEntries)
          Construct a new UnmodifiableAccessControlList
UnmodifiableAccessControlList(List<? extends AccessControlEntry> accessControlEntries, String path, Map<String,Integer> restrictions)
          Construct a new UnmodifiableAccessControlList
 
Method Summary
 boolean addAccessControlEntry(Principal principal, Privilege[] privileges)
           
 boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow)
           
 boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String,Value> restrictions)
           
 boolean equals(Object obj)
           
 AccessControlEntry[] getAccessControlEntries()
           
 String getPath()
           
 String[] getRestrictionNames()
           
 int getRestrictionType(String restrictionName)
           
 int hashCode()
           
 boolean isEmpty()
           
 void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry)
           
 void removeAccessControlEntry(AccessControlEntry ace)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmodifiableAccessControlList

public UnmodifiableAccessControlList(AccessControlList acl)
                              throws RepositoryException
Construct a new UnmodifiableAccessControlList

Parameters:
acl - The AccessControlList to be wrapped in order to prevent it's modification.
Throws:
RepositoryException - The the entries cannot be retrieved from the specified AccessControlList.

UnmodifiableAccessControlList

public UnmodifiableAccessControlList(List<? extends AccessControlEntry> accessControlEntries)
Construct a new UnmodifiableAccessControlList

Parameters:
accessControlEntries - A list of access control entries.

UnmodifiableAccessControlList

public UnmodifiableAccessControlList(List<? extends AccessControlEntry> accessControlEntries,
                                     String path,
                                     Map<String,Integer> restrictions)
Construct a new UnmodifiableAccessControlList

Parameters:
accessControlEntries -
path -
restrictions -
Method Detail

getAccessControlEntries

public AccessControlEntry[] getAccessControlEntries()
                                             throws RepositoryException
Specified by:
getAccessControlEntries in interface AccessControlList
Throws:
RepositoryException
See Also:
AccessControlList.getAccessControlEntries()

addAccessControlEntry

public boolean addAccessControlEntry(Principal principal,
                                     Privilege[] privileges)
                              throws AccessControlException,
                                     RepositoryException
Specified by:
addAccessControlEntry in interface AccessControlList
Throws:
AccessControlException
RepositoryException
See Also:
AccessControlList.addAccessControlEntry(Principal, Privilege[])

removeAccessControlEntry

public void removeAccessControlEntry(AccessControlEntry ace)
                              throws AccessControlException,
                                     RepositoryException
Specified by:
removeAccessControlEntry in interface AccessControlList
Throws:
AccessControlException
RepositoryException
See Also:
AccessControlList.removeAccessControlEntry(AccessControlEntry)

getRestrictionNames

public String[] getRestrictionNames()
Specified by:
getRestrictionNames in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
See Also:
JackrabbitAccessControlList.getRestrictionNames()

getRestrictionType

public int getRestrictionType(String restrictionName)
Specified by:
getRestrictionType in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
See Also:
JackrabbitAccessControlList.getRestrictionType(String)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
See Also:
JackrabbitAccessControlList.isEmpty()

size

public int size()
Specified by:
size in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
See Also:
JackrabbitAccessControlList.size()

addEntry

public boolean addEntry(Principal principal,
                        Privilege[] privileges,
                        boolean isAllow)
                 throws AccessControlException
Specified by:
addEntry in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
Throws:
AccessControlException
See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean)

addEntry

public boolean addEntry(Principal principal,
                        Privilege[] privileges,
                        boolean isAllow,
                        Map<String,Value> restrictions)
                 throws AccessControlException
Specified by:
addEntry in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
Throws:
AccessControlException
See Also:
JackrabbitAccessControlList.addEntry(Principal, Privilege[], boolean, Map)

orderBefore

public void orderBefore(AccessControlEntry srcEntry,
                        AccessControlEntry destEntry)
                 throws AccessControlException
Specified by:
orderBefore in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlList
Throws:
AccessControlException
See Also:
JackrabbitAccessControlList.orderBefore(AccessControlEntry, AccessControlEntry)

getPath

public String getPath()
Specified by:
getPath in interface org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy
See Also:
JackrabbitAccessControlPolicy.getPath()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(Object)


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