|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nbi.xmlsec.xacml.profile.rbac.PolicyManager
This class is the main instance for policy management purposes. Starting on a policy base dir, it searches, writes, removes and checks the existance of policies using Identifiers, and retrieves Domains. The policy manager has to be configured using a PolicyManager part of the configuration file.
Field Summary | |
private Configuration |
configuration
The PolicyManager's configuration |
(package private) static Logger |
logger
|
(package private) PolicyFinder |
policyFinder
The PolicyManager's policy finder |
Constructor Summary | |
PolicyManager(Configuration config)
Inits the PolicyManager based on its configuration subset (PolicyManager). |
Method Summary | |
boolean |
exists(AbstractPolicy policy)
Verifies the existence of the policy using its identifier in the file system. |
boolean |
exists(Identifier id)
Verifies the existence of an identifier in the file system. |
PermissionPolicy |
findPermissionPolicy(String domain,
String permPolicy)
Retrieves the matching permission policy creating the given identifier. |
PermissionPolicySet |
findPermissionPolicySet(String domain,
String role)
Retrieves the matching permission policy set creating the given identifier. |
AbstractPolicy |
findPolicy(Identifier id)
Retrieves the policy matching the given identifier. |
RoleAssignmentPolicy |
findRoleAssignmentPolicy(String domain,
String label)
Retrieves the matching RoleAssignmentPolicy creating the given identifier. |
RoleAssignmentPolicySet |
findRoleAssignmentPolicySet(String domain)
Retrieves the matching RoleAssignmentPolicySet creating the given identifier. |
RolePolicySet |
findRolePolicySet(String domain,
String role)
Retrieves the matching role policy set creating the given identifier. |
protected File |
getDirectoryPath(String domain,
String typeId)
Retrieves the directory path for policies of a given domain and type. |
List |
getDomains()
Gets a list of the domains in the current policy base directory. |
List |
getIdentifiers(String domain,
String typeId)
Gets a list of identifiers of the policies of the given type within the given domain. |
List |
getPolicies(String domain,
String typeId)
Gets a list policies of the given type within the given domain. |
String |
getPolicyBaseDir()
Retrieves the policy base directory from the current configuration. |
IOFileFilter |
getPolicyFileFilter()
Retrieves a FileFilter bases on the file suffixes of the configuration. |
PolicyFinder |
getPolicyFinder()
Gets the current policy finder |
void |
initPolicyFinder()
Inits the PolicyFinder. |
boolean |
remove(AbstractPolicy policy)
Removes the file related to this policy. |
boolean |
remove(Identifier id)
Removes the file related to this policy identifier. |
boolean |
removeDomain(String domain)
Removes the whole domain directory from the file system. |
void |
setPolicyBaseDir(String policyBaseDir)
Sets the policy base directory in the current configuration. |
void |
setPolicyFinder(PolicyFinder policyFinder)
Sets a new policy finder |
void |
write(AbstractPolicy policy)
Write a policy to a file. |
void |
write(Identifier id)
Write the policy related to the identifier into a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static Logger logger
private Configuration configuration
PolicyFinder policyFinder
Constructor Detail |
public PolicyManager(Configuration config) throws Exception
config
- RoleManager's configuration.
Exception
Method Detail |
public void write(AbstractPolicy policy) throws ParsingException, IOException
policy
- The policy to write.
ParsingException
- Indicates a malformed policy identifier.
IOException
- If an I/O-problem occurs.public void write(Identifier id) throws ParsingException, IOException
id
- The identifier whose policy shall be written.
ParsingException
- Indicates a malformed policy identifier.
IOException
- If an I/O-problem occurs.public boolean exists(Identifier id)
id
- identifier to verify.
true
, if the related policy file exists,
false
otherwise.public boolean exists(AbstractPolicy policy) throws ParsingException
policy
- polciy to verify.
true
, if the related policy file exists,
false
otherwise.
ParsingException
public boolean remove(AbstractPolicy policy) throws ParsingException
policy
- policy file to remove.
true
, if the related policy file exists,
false
otherwise.
ParsingException
public boolean remove(Identifier id) throws ParsingException
id
- policy file to remove.
true
, if the related policy file exists,
false
otherwise.
ParsingException
public boolean removeDomain(String domain)
domain
- Domain to remove.
protected File getDirectoryPath(String domain, String typeId)
domain
- The domain of the policy type, or null.typeId
- The policy's typeId (e.g.
RolePolicySetIdentifier.TYPEID
).
public List getDomains()
String
instances.public List getPolicies(String domain, String typeId)
AbstractPolicy
instances.public List getIdentifiers(String domain, String typeId)
AbstractPolicy
instances.public AbstractPolicy findPolicy(Identifier id) throws ParsingException
PolicyFinder
is used
ParsingException
- If the policy could not be loaded.public RolePolicySet findRolePolicySet(String domain, String role) throws ParsingException
findPolicy(Identifier)
is used.
ParsingException
- If the policy could not be loaded.public RoleAssignmentPolicySet findRoleAssignmentPolicySet(String domain) throws ParsingException
findPolicy(Identifier)
is used.
domain
- The domain to search for.
ParsingException
- If the policy could not be loaded.public RoleAssignmentPolicy findRoleAssignmentPolicy(String domain, String label) throws ParsingException
findPolicy(Identifier)
is used.
domain
- The domain to search for.label
- The label of the RoleAssignmentPolicy to search for.
ParsingException
- If the policy could not be loaded.public PermissionPolicySet findPermissionPolicySet(String domain, String role) throws ParsingException
findPolicy(Identifier)
is used.
domain
- The domain to search for.role
- The label of the Role of the PermissionPolicySet to search
for.
ParsingException
- If the policy could not be loaded.public PermissionPolicy findPermissionPolicy(String domain, String permPolicy) throws ParsingException
findPolicy(Identifier)
is used.
domain
- The domain to search for.permPolicy
- The label of the Permission Policy to search for.
ParsingException
- If the policy could not be loaded.public void initPolicyFinder()
public PolicyFinder getPolicyFinder()
public void setPolicyFinder(PolicyFinder policyFinder)
policyFinder
- The new policy finder.public void setPolicyBaseDir(String policyBaseDir)
public String getPolicyBaseDir()
public IOFileFilter getPolicyFileFilter()
SuffixFileFilter
, if suffixes are
configured, otherwise TrueFileFilter
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |