org.jboss.security.acl
Class ACLImpl

java.lang.Object
  extended by org.jboss.security.acl.ACLImpl
All Implemented Interfaces:
Serializable, org.jboss.security.acl.ACL

public class ACLImpl
extends Object
implements org.jboss.security.acl.ACL, Serializable

Simple ACL implementation that keeps the entries in a Map whose keys are the identities of the entries, to provide fast access.

Author:
Stefan Guilhen
See Also:
Serialized Form

Constructor Summary
ACLImpl(org.jboss.security.authorization.Resource resource)
           Builds an instance of ACLImpl for the specified resource.
ACLImpl(org.jboss.security.authorization.Resource resource, Collection<org.jboss.security.acl.ACLEntry> entries)
           Builds an instance of ACLImpl for the specified resource, and initialize it with the specified entries.
ACLImpl(String resourceString, Collection<org.jboss.security.acl.ACLEntry> entries)
           
 
Method Summary
 boolean addEntry(org.jboss.security.acl.ACLEntry entry)
           
 long getACLId()
           Obtains the persistent id of this ACLImpl.
 Collection<? extends org.jboss.security.acl.ACLEntry> getEntries()
           
 org.jboss.security.acl.ACLEntry getEntry(org.jboss.security.identity.Identity identity)
           
 org.jboss.security.acl.ACLEntry getEntry(String identityOrRole)
           
 org.jboss.security.authorization.Resource getResource()
           
 String getResourceAsString()
           Obtains the stringfied representation of the resource associated with this ACL.
 boolean isGranted(org.jboss.security.acl.ACLPermission permission, org.jboss.security.identity.Identity identity)
           
 boolean removeEntry(org.jboss.security.acl.ACLEntry entry)
           
 void setResource(org.jboss.security.authorization.Resource resource)
           Sets the resource associated with this ACL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACLImpl

public ACLImpl(org.jboss.security.authorization.Resource resource)

Builds an instance of ACLImpl for the specified resource.

Parameters:
resource - a reference to the Resource associated with the ACL being constructed.

ACLImpl

public ACLImpl(org.jboss.security.authorization.Resource resource,
               Collection<org.jboss.security.acl.ACLEntry> entries)

Builds an instance of ACLImpl for the specified resource, and initialize it with the specified entries.

Parameters:
resource - a reference to the Resource associated with the ACL being constructed.
entries - a Collection containing the ACL's initial entries.

ACLImpl

public ACLImpl(String resourceString,
               Collection<org.jboss.security.acl.ACLEntry> entries)
Method Detail

getACLId

public long getACLId()

Obtains the persistent id of this ACLImpl.

Returns:
a long representing the persistent id this ACL.

addEntry

public boolean addEntry(org.jboss.security.acl.ACLEntry entry)
Specified by:
addEntry in interface org.jboss.security.acl.ACL

removeEntry

public boolean removeEntry(org.jboss.security.acl.ACLEntry entry)
Specified by:
removeEntry in interface org.jboss.security.acl.ACL

getEntries

public Collection<? extends org.jboss.security.acl.ACLEntry> getEntries()
Specified by:
getEntries in interface org.jboss.security.acl.ACL

getEntry

public org.jboss.security.acl.ACLEntry getEntry(org.jboss.security.identity.Identity identity)
Specified by:
getEntry in interface org.jboss.security.acl.ACL

getEntry

public org.jboss.security.acl.ACLEntry getEntry(String identityOrRole)
Specified by:
getEntry in interface org.jboss.security.acl.ACL

isGranted

public boolean isGranted(org.jboss.security.acl.ACLPermission permission,
                         org.jboss.security.identity.Identity identity)
Specified by:
isGranted in interface org.jboss.security.acl.ACL

getResourceAsString

public String getResourceAsString()

Obtains the stringfied representation of the resource associated with this ACL.

Returns:
a String representation of the resource.

getResource

public org.jboss.security.authorization.Resource getResource()
Specified by:
getResource in interface org.jboss.security.acl.ACL

setResource

public void setResource(org.jboss.security.authorization.Resource resource)

Sets the resource associated with this ACL.

Parameters:
resource - a reference to the Resource associated with this ACL.


Copyright © 2009 JBoss Inc.. All Rights Reserved.