Class ACLImpl
- java.lang.Object
-
- org.jboss.security.acl.ACLImpl
-
- All Implemented Interfaces:
Serializable,ACL
@Entity public class ACLImpl extends Object implements 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
Constructors Constructor Description ACLImpl(String resourceString, Collection<ACLEntry> entries)ACLImpl(Resource resource)Builds an instance ofACLImplfor the specified resource.ACLImpl(Resource resource, Collection<ACLEntry> entries)Builds an instance ofACLImplfor the specified resource, and initialize it with the specified entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEntry(ACLEntry entry)Adds an entry to this ACL.longgetACLId()Obtains the persistent id of thisACLImpl.Collection<? extends ACLEntry>getEntries()Obtains the collection of allACLEntriesin this ACL.ACLEntrygetEntry(String identityOrRole)Obtains the entry that corresponds to the specified identity or role name.ACLEntrygetEntry(Identity identity)Obtains the entry that corresponds to the specified identity.ResourcegetResource()Obtains a reference to the resource being protected by this ACL.StringgetResourceAsString()Obtains the stringfied representation of the resource associated with thisACL.booleanisGranted(ACLPermission permission, Identity identity)Verify if the given permission is assigned to the specifiedIdentity.booleanremoveEntry(ACLEntry entry)Removes an entry from this ACL.voidsetResource(Resource resource)Sets the resource associated with thisACL.
-
-
-
Constructor Detail
-
ACLImpl
public ACLImpl(Resource resource)
Builds an instance of
ACLImplfor the specified resource.- Parameters:
resource- a reference to theResourceassociated with the ACL being constructed.
-
ACLImpl
public ACLImpl(Resource resource, Collection<ACLEntry> entries)
Builds an instance of
ACLImplfor the specified resource, and initialize it with the specified entries.- Parameters:
resource- a reference to theResourceassociated with the ACL being constructed.entries- aCollectioncontaining the ACL's initial entries.
-
ACLImpl
public ACLImpl(String resourceString, Collection<ACLEntry> entries)
-
-
Method Detail
-
getACLId
public long getACLId()
Obtains the persistent id of this
ACLImpl.- Returns:
- a
longrepresenting the persistent id this ACL.
-
addEntry
public boolean addEntry(ACLEntry entry)
Description copied from interface:ACLAdds an entry to this ACL. If the ACL already has an
ACLEntryassociated to the new entry's identity, then the new entry will not be added.
-
removeEntry
public boolean removeEntry(ACLEntry entry)
Description copied from interface:ACLRemoves an entry from this ACL.
- Specified by:
removeEntryin interfaceACL- Parameters:
entry- theACLEntryto be removed.- Returns:
trueif the entry is removed;falseif the entry can't be found in the ACL.
-
getEntries
public Collection<? extends ACLEntry> getEntries()
Description copied from interface:ACLObtains the collection of all
ACLEntriesin this ACL.- Specified by:
getEntriesin interfaceACL- Returns:
- a
Collectioncontaining all entries in this ACL.
-
getEntry
public ACLEntry getEntry(Identity identity)
Description copied from interface:ACLObtains the entry that corresponds to the specified identity. Calling this method is the same as doing
getEntry(identity.getName()).
-
getEntry
public ACLEntry getEntry(String identityOrRole)
Description copied from interface:ACLObtains the entry that corresponds to the specified identity or role name.
-
isGranted
public boolean isGranted(ACLPermission permission, Identity identity)
Description copied from interface:ACLVerify if the given permission is assigned to the specified
Identity.
-
getResourceAsString
public String getResourceAsString()
Obtains the stringfied representation of the resource associated with this
ACL.- Returns:
- a
Stringrepresentation of the resource.
-
getResource
public Resource getResource()
Description copied from interface:ACLObtains a reference to the resource being protected by this ACL.
- Specified by:
getResourcein interfaceACL- Returns:
- a reference to the
Resource.
-
setResource
public void setResource(Resource resource)
Sets the resource associated with this
ACL.- Parameters:
resource- a reference to theResourceassociated with thisACL.
-
-