|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nbi.xmlsec.xacml.profile.rbac.RoleManager
This class is the main instance of the role management tool. It realises the different commands based on the command line. The role manager has to be configured using the RoleManager part of the configuration file.
Field Summary | |
private Configuration |
configuration
The RoleManager's configuration |
(package private) static Logger |
logger
|
private static Options |
options
|
private PolicyManager |
polMgr
The RoleManager's PolicyManager |
Constructor Summary | |
RoleManager(Configuration config)
Inits the RoleManager based on the given configuration. |
Method Summary | |
private void |
doAdd(CommandLine cmd)
|
private Permission |
doAddConditionToPermission(Permission perm,
CommandLine cmd)
|
private void |
doAddPermissionPolicyToRole(CommandLine cmd)
|
private void |
doAddPermissionToPermissionPolicy(CommandLine cmd)
|
private void |
doAddUserToRole(CommandLine cmd)
|
void |
doCmd(CommandLine cmd)
|
void |
doCmd(String[] args)
|
private void |
doHelp(CommandLine cmd)
|
private void |
doList(CommandLine cmd)
|
private void |
doRemove(CommandLine cmd)
|
private void |
doRemoveConditionFromPermission(CommandLine cmd)
|
private void |
doRemoveDomain(CommandLine cmd)
|
private void |
doRemovePermissionFromPermissionPolicy(CommandLine cmd)
|
private void |
doRemovePermissionPolicyFromRole(CommandLine cmd)
|
private void |
doRemoveRole(CommandLine cmd)
|
private void |
doRemoveUserFromRole(CommandLine cmd)
|
protected Assignment |
getAssignment(RoleAssignmentPolicySet policySet,
CommandLine cmd)
Gets the assignment from the role assignment policy set, or creates a new from the domain and role arguments from the command line and the configuration. |
String |
getDefaultDomain()
Retrieves the policy base directory from the current configuration. |
String |
getDomainParameter(CommandLine cmd)
Determines the domain using the command line. |
private List |
getLabels(List ids)
Extracts the labels from a list of identifiers. |
boolean |
getPermissionEffectParameter(CommandLine cmd)
Determines the permission effect parameter from the command line. |
String[] |
getPermissionParameter(CommandLine cmd)
Gets the Values for the PermissionParameter from the command line. |
List |
getPermissionPolicies(RolePolicySet policySet,
CommandLine cmd)
Gets the permission policies from the command line parameters from the RolePolicySet, or creates and adds new PermissionPolicies to the result list, if they can not be found in the RolePolicySet. |
String[] |
getPermissionPolicyParameter(CommandLine cmd)
Gets the Values for the PermissionPolicyParameter from the command line. |
protected PermissionPolicySet |
getPermissionPolicySet(RolePolicySet policySet,
CommandLine cmd)
Gets the current permission policy set from a role policy set, or creates a new permission policy set using the domain and role arguments from the command line and the configuration. |
protected List |
getPermissions(PermissionPolicy permPolicy,
CommandLine cmd)
Gets the permission labels listed in the CommandLine from the role policy set or creates new permissions from the domain and permission arguments of the command line and the configuration if the permission was not found in the PermissionPolicy. |
String |
getPolicyBaseDir()
Retrieves the policy base directory from the policy manager. |
protected RoleAssignmentPolicySet |
getRoleAssignmentPolicySet(CommandLine cmd)
Gets/Creates the current role assignment policy set using the policy manager, the domain arguments from the command line and the configuration. |
String |
getRoleParameter(CommandLine cmd)
Determines the role parameter from the command line. |
protected RolePolicySet |
getRolePolicySet(CommandLine cmd)
Gets/Creates the current role policy set using the policy manager, the domain and role arguments from the command line and the configuration. |
List |
getUserCertificates(CommandLine cmd)
Retrieves the certificates from the User parameter of the command line. |
private void |
initOptions()
|
static void |
main(String[] args)
|
private void |
printCollection(PrintStream out,
Collection coll,
String sep,
String headerLine)
Prints the elements of a collection to a stream. |
private void |
printErrorMsg(String msg,
String reason)
|
private void |
printMsg(String msg)
|
void |
setdefaultDomain(String defaultDomain)
Sets the policy base directory in the current configuration. |
void |
setPolicyBaseDir(String policyBaseDir)
Sets the policy base directory to the policy manager. |
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
private PolicyManager polMgr
private static Options options
Constructor Detail |
public RoleManager(Configuration config) throws Exception
config
- RoleManager's configuration.
Exception
Method Detail |
public String getPolicyBaseDir()
public void setPolicyBaseDir(String policyBaseDir)
public String getDefaultDomain()
public void setdefaultDomain(String defaultDomain)
public String getDomainParameter(CommandLine cmd)
public String getRoleParameter(CommandLine cmd)
public String[] getPermissionPolicyParameter(CommandLine cmd)
cmd
- Command line to parse
public String[] getPermissionParameter(CommandLine cmd)
cmd
- Command line to parse
public List getPermissionPolicies(RolePolicySet policySet, CommandLine cmd)
public List getUserCertificates(CommandLine cmd)
protected RolePolicySet getRolePolicySet(CommandLine cmd)
protected RoleAssignmentPolicySet getRoleAssignmentPolicySet(CommandLine cmd)
protected PermissionPolicySet getPermissionPolicySet(RolePolicySet policySet, CommandLine cmd)
protected Assignment getAssignment(RoleAssignmentPolicySet policySet, CommandLine cmd)
protected List getPermissions(PermissionPolicy permPolicy, CommandLine cmd)
public boolean getPermissionEffectParameter(CommandLine cmd)
true
, if the permission is set to permit,
false
, if the permission is set to deny.private void initOptions()
private void printErrorMsg(String msg, String reason)
private void printMsg(String msg)
private void printCollection(PrintStream out, Collection coll, String sep, String headerLine)
toString()
method of every element in the
collection. The elements are separated by the string sep. If
sep
is null
, no separation is done.
Optionally, a headerline may be printed.
out
- PrintStream to print the collection to.coll
- The collection to print.sep
- The separator string to separate the collection's elements or
null
, if separation is not wanted.headerLine
- The headerline to print or null
, if a
headerline is not wanted.private List getLabels(List ids)
ids
- List of Identifiers.
private void doHelp(CommandLine cmd)
private void doList(CommandLine cmd)
private void doAdd(CommandLine cmd)
private Permission doAddConditionToPermission(Permission perm, CommandLine cmd) throws ParsingException, UnknownIdentifierException, FunctionTypeException
ParsingException
UnknownIdentifierException
FunctionTypeException
private void doAddPermissionToPermissionPolicy(CommandLine cmd)
private void doAddPermissionPolicyToRole(CommandLine cmd)
private void doAddUserToRole(CommandLine cmd)
private void doRemove(CommandLine cmd)
private void doRemoveRole(CommandLine cmd)
private void doRemoveDomain(CommandLine cmd)
private void doRemovePermissionPolicyFromRole(CommandLine cmd)
private void doRemoveConditionFromPermission(CommandLine cmd)
private void doRemovePermissionFromPermissionPolicy(CommandLine cmd)
private void doRemoveUserFromRole(CommandLine cmd)
public void doCmd(CommandLine cmd)
public void doCmd(String[] args) throws ParseException
ParseException
public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |