public class JPAPersistenceStrategy extends Object implements ACLPersistenceStrategy
Implementation of ACLPersistenceStrategy that uses the Java Persistence API (JPA) to
persist the ACLs.
| Constructor and Description |
|---|
JPAPersistenceStrategy() |
JPAPersistenceStrategy(ACLResourceFactory resourceFactory) |
| Modifier and Type | Method and Description |
|---|---|
ACL |
createACL(Resource resource)
Creates a new
ACL and associates it to the given resource. |
ACL |
createACL(Resource resource,
Collection<ACLEntry> entries)
Creates a new
ACL with the specified entries and associates it to the given resource. |
ACL |
getACL(Resource resource)
Obtains a reference to the
ACL associated to the given resource. |
Collection<ACL> |
getACLs()
Obtains all
ACLs that are managed by this ACLPersistenceStrategy. |
boolean |
removeACL(ACL acl)
Removes the given
ACL, breaking the existing association with the resource it relates to. |
boolean |
removeACL(Resource resource)
Removes the
ACL associated with the specified resource. |
boolean |
updateACL(ACL acl)
Updates the given
ACL. |
public JPAPersistenceStrategy()
public JPAPersistenceStrategy(ACLResourceFactory resourceFactory)
public ACL createACL(Resource resource)
ACLPersistenceStrategy
Creates a new ACL and associates it to the given resource.
createACL in interface ACLPersistenceStrategyresource - the Resource for which an ACL is to be created.ACL.public ACL createACL(Resource resource, Collection<ACLEntry> entries)
ACLPersistenceStrategy
Creates a new ACL with the specified entries and associates it to the given resource.
createACL in interface ACLPersistenceStrategyresource - the Resource for which an ACL is to be created.entries - a Collection containing the entries that must be added to the ACL.ACL.public boolean removeACL(ACL acl)
ACLPersistenceStrategy
Removes the given ACL, breaking the existing association with the resource it relates to.
removeACL in interface ACLPersistenceStrategyacl - a reference to the ACL that is to be removed.true if the ACL was removed; false otherwise.public boolean removeACL(Resource resource)
ACLPersistenceStrategy
Removes the ACL associated with the specified resource.
removeACL in interface ACLPersistenceStrategyresource - the Resource whose associated ACL is to be removed.true if the ACL was removed; false otherwise.public ACL getACL(Resource resource)
ACLPersistenceStrategy
Obtains a reference to the ACL associated to the given resource.
getACL in interface ACLPersistenceStrategyresource - the Resource for which the associated ACL is wanted.ACL associated with the resource, or null if no
ACL could be found.public Collection<ACL> getACLs()
ACLPersistenceStrategy
Obtains all ACLs that are managed by this ACLPersistenceStrategy.
getACLs in interface ACLPersistenceStrategyCollection containing all ACLs retrieved by this strategy.public boolean updateACL(ACL acl)
ACLPersistenceStrategy
Updates the given ACL. This usually means updating the repository where the ACLs are stored.
updateACL in interface ACLPersistenceStrategyacl - the ACL that needs to be updated.true if the ACL was updated; false otherwise.Copyright © 2016 JBoss by Red Hat. All rights reserved.