ModeShape Distribution 3.5.0.Final

org.modeshape.jcr.security.acl
Class AccessControlEntryImpl

java.lang.Object
  extended by org.modeshape.jcr.security.acl.AccessControlEntryImpl
All Implemented Interfaces:
AccessControlEntry

public class AccessControlEntryImpl
extends Object
implements AccessControlEntry

Implementation for the Access Control entry record. An AccessControlEntry represents the association of one or more Privilege objects with a specific Principal.


Constructor Summary
AccessControlEntryImpl(Principal principal, Privilege[] privileges)
          Creates new ACL entry.
 
Method Summary
protected  boolean addIfNotPresent(Privilege[] privileges)
          Adds specified privileges to this entry.
protected  boolean combineRecursively(List<Privilege> list, Privilege[] privileges)
          Adds specified privileges to the given list.
 boolean equals(Object other)
           
 Principal getPrincipal()
           
 Privilege[] getPrivileges()
           
 int hashCode()
           
protected  boolean hasPrivileges(Privilege[] privileges)
          Tests given privileges.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControlEntryImpl

public AccessControlEntryImpl(Principal principal,
                              Privilege[] privileges)
                       throws AccessControlException
Creates new ACL entry.

Parameters:
principal - principal associated with this entry.
privileges - one or more privilege in association with given principal.
Throws:
AccessControlException - if one or more privileges are invalid.
Method Detail

getPrincipal

public Principal getPrincipal()
Specified by:
getPrincipal in interface AccessControlEntry

getPrivileges

public Privilege[] getPrivileges()
Specified by:
getPrivileges in interface AccessControlEntry

hasPrivileges

protected boolean hasPrivileges(Privilege[] privileges)
Tests given privileges.

Parameters:
privileges - privileges for testing.
Returns:
true if this entry contains all given privileges

addIfNotPresent

protected boolean addIfNotPresent(Privilege[] privileges)
Adds specified privileges to this entry.

Parameters:
privileges - privileges to add.
Returns:
true if at least one of privileges was added.

combineRecursively

protected boolean combineRecursively(List<Privilege> list,
                                     Privilege[] privileges)
Adds specified privileges to the given list.

Parameters:
list - the result list of combined privileges.
privileges - privileges to add.
Returns:
true if at least one of privileges was added.

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

ModeShape Distribution 3.5.0.Final

Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.