XGTRBAC
Class Policy

java.lang.Object
  extended by XGTRBAC.Policy

public class Policy
extends java.lang.Object

This class contains methods and members for maintaining policies. It is instantiated in RBACModule class (addPolicy method).


Field Summary
private  boolean applied
           
private  java.util.LinkedList DSDRoleSetList
           
private  java.util.LinkedList DurationExprList
           
private  GTRBACModule gtrbacModule
           
private  java.lang.String[] InfoItems
           
private  java.util.LinkedList IntervalExprList
           
static int NumDefFiles
           
static int NumInfoItems
           
static int NumPolicySheets
           
private  java.util.LinkedList PeriodicTimeExprList
           
private  java.util.LinkedList PermissionList
           
private  java.util.LinkedList PermissionRoleList
           
private  java.lang.String[] PolicyDefIds
           
private  java.lang.String[] PolicyDefPaths
           
private  org.w3c.dom.Document[] PolicyDefs
           
private  java.lang.String PolicyName
           
private  java.lang.String[] PolicySheetIds
           
private  java.lang.String[] PolicySheetPaths
           
private  org.w3c.dom.Document[] PolicySheets
           
private  java.util.LinkedList RoleList
           
private  java.util.LinkedList SSDRoleSetList
           
private  java.util.LinkedList UserList
           
private  java.util.LinkedList UserRoleList
           
 
Constructor Summary
Policy(java.lang.String name)
          Creates a new instance of Policy
 
Method Summary
 int addDSDRoleSet(java.lang.String dsd_id)
          Adds a new DSD role set to the DSDRoleSetList
 int addDurationExpr(java.lang.String d_expr_id)
          Adds a new duration expression to the DurationExprList
 int addIntervalExpr(java.lang.String i_expr_id)
          Adds a new interval expression to the IntervalExprList
 int addPeriodicTimeExpr(java.lang.String pt_expr_id)
          Adds a new periodic time expression to the Periodic TimeExprList
 int addPermission(java.lang.String perm_id)
          Adds a new permission to the PermissionList
 int addPRAssign(java.lang.String pr_id)
          Adds a new PRAssign to the PermissionRoleList
 int addRole(java.lang.String role_id)
          Adds a new role to the RoleList
 int addSSDRoleSet(java.lang.String ssd_id)
          Adds a new SSD role set to the SSDRoleSetList
 int addURAssign(java.lang.String ur_id)
          Adds a new URAssign to the UserRoleList
 int addUser(java.lang.String user_id)
          Adds a new user to the UserList
 boolean checkApplied()
          Checks whether the policy has been applied
 boolean checkLoadedDef(int index)
          Checks if a given policy definition is loaded
 boolean checkLoadedFile(int type, int index)
          Checks if a given policy file is loaded
 boolean checkLoadedSheet(int index)
          Checks if a given policy sheet is loaded
 java.lang.String checkUnloadedDef()
          Returns the name of first unloaded definition file of a policy object
 java.lang.String checkUnloadedFile()
          Returns the name of first unloaded file of a policy object
 java.lang.String checkUnloadedSheet()
          Returns the name of first unloaded policy sheet of a policy object
 java.lang.String getDefName(int index)
          Returns the name of definition file given its index
 int getDefNum(java.lang.String defn)
          Returns the index of the selected definition file
 DSDRoleSet getDSDRoleSet(java.lang.String dsd_id)
          Returns the DSD role set object
 int getDSDRoleSetCount()
          Returns the number of DSD role sets
 java.lang.String getDSDRoleSetId(int index)
          Returns the DSD role set id at the given index
 DurationExpr getDurationExpr(java.lang.String d_expr_id)
          Returns the duration expression object
 int getDurationExprCount()
          Returns the number of duration expressions
 java.lang.String getDurationExprId(int index)
          Returns the duration expression id at the given index
 java.lang.String getFileName(int type, int index)
          Returns the name of policy file given its type and index
 GTRBACModule getGTRBACModule()
          Returns the gtrbac module object running this policy
 java.lang.String getInfoItem(int index)
          Returns the info item for the policy
 int getInfoItemNum(java.lang.String item)
          Returns the index of selected info item
 IntervalExpr getIntervalExpr(java.lang.String i_expr_id)
          Returns the interval expression object
 int getIntervalExprCount()
          Returns the number of interval expressions
 java.lang.String getIntervalExprId(int index)
          Returns the interval expression id at the given index
 PeriodicTimeExpr getPeriodicTimeExpr(java.lang.String pt_expr_id)
          Returns the periodic time expression object
 int getPeriodicTimeExprCount()
          Returns the number of periodic time expressions
 java.lang.String getPeriodicTimeExprId(int index)
          Returns the periodic time expression id at the given index
 java.lang.String getPermId(int index)
          Returns the permission id at the given index- used to fill combo box
 Permission getPermission(java.lang.String perm_id)
          Returns the permission object
 int getPermissionCount()
          Returns the number of permissions
 org.w3c.dom.Document getPolicyDef(int index)
          Returns the policy definition file given its index
 java.lang.String getPolicyDefId(int index)
          Returns the id of a policy definition file
 java.lang.String getPolicyDefPath(int index)
          Returns the path of a policy definition file
 java.lang.String getPolicyName()
          Returns the name of a policy
 org.w3c.dom.Document getPolicySheet(int index)
          Returns the policy sheet given its index
 java.lang.String getPolicySheetId(int index)
          Returns the id of a policy sheet
 java.lang.String getPolicySheetPath(int index)
          Returns the path of a policy sheet
 PermRoleAssign getPRAssign(java.lang.String pr_id)
          Returns the PRAssign object
 int getPRAssignCount()
          Returns the number of permission-to-role assignments
 java.lang.String getPRAssignId(int index)
          Returns the PRAssign id at the given index
 Role getRole(java.lang.String role_id)
          Returns the role object given role id
 int getRoleCount()
          Returns the number of roles
 java.lang.String getRoleId(java.lang.String role_name)
          Returns the id of the role given the name
 java.lang.String getRoleName(int index)
          Returns the role name at the given index- used to fill combo box
 java.lang.String getSheetName(int index)
          Returns the name of policy sheet given its index
 int getSheetNum(java.lang.String sheet)
          Returns the index of the selected sheet
 SSDRoleSet getSSDRoleSet(java.lang.String ssd_id)
          Returns the SSD role set object
 int getSSDRoleSetCount()
          Returns the number of SSD role sets
 java.lang.String getSSDRoleSetId(int index)
          Returns the SSD role set id at the given index
 UserRoleAssign getURAssign(java.lang.String ur_id)
          Returns the URAssign object
 int getURAssignCount()
          Returns the number of user-role assignments
 java.lang.String getURAssignId(int index)
          Returns the URAssign id at the given index
 User getUser(java.lang.String user_id)
          Returns the user object
 int getUserCount()
          Returns the number of users
 java.lang.String getUserId(int index)
          Returns the user id at the given index- used to fill combo box
 void setApplied(boolean value)
          Sets whether the policy has been applied
 void setGTRBACModule(GTRBACModule gtrbac)
          Sets the gtrbac module object running this policy
 void setInfoItem(int index)
          Sets the info items for the policy
 void setPolicyDef(org.w3c.dom.Document doc, int index)
          Sets the policy definition file at a given index
 void setPolicyDefId(java.lang.String id, int index)
          Sets the id of a policy object
 void setPolicyDefPath(java.lang.String path, int index)
          Sets the path of a policy object
 void setPolicySheet(org.w3c.dom.Document doc, int index)
          Sets the policy sheet at a given index
 void setPolicySheetId(java.lang.String id, int index)
          Sets the id of a policy object
 void setPolicySheetPath(java.lang.String path, int index)
          Sets the path of a policy object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PolicyName

private java.lang.String PolicyName

PolicyDefs

private org.w3c.dom.Document[] PolicyDefs

PolicyDefPaths

private java.lang.String[] PolicyDefPaths

PolicyDefIds

private java.lang.String[] PolicyDefIds

PolicySheets

private org.w3c.dom.Document[] PolicySheets

PolicySheetPaths

private java.lang.String[] PolicySheetPaths

PolicySheetIds

private java.lang.String[] PolicySheetIds

InfoItems

private java.lang.String[] InfoItems

applied

private boolean applied

gtrbacModule

private GTRBACModule gtrbacModule

UserList

private java.util.LinkedList UserList

RoleList

private java.util.LinkedList RoleList

SSDRoleSetList

private java.util.LinkedList SSDRoleSetList

DSDRoleSetList

private java.util.LinkedList DSDRoleSetList

PermissionList

private java.util.LinkedList PermissionList

UserRoleList

private java.util.LinkedList UserRoleList

PermissionRoleList

private java.util.LinkedList PermissionRoleList

IntervalExprList

private java.util.LinkedList IntervalExprList

DurationExprList

private java.util.LinkedList DurationExprList

PeriodicTimeExprList

private java.util.LinkedList PeriodicTimeExprList

NumDefFiles

public static final int NumDefFiles
See Also:
Constant Field Values

NumPolicySheets

public static final int NumPolicySheets
See Also:
Constant Field Values

NumInfoItems

public static final int NumInfoItems
See Also:
Constant Field Values
Constructor Detail

Policy

public Policy(java.lang.String name)
Creates a new instance of Policy

Method Detail

getPolicyName

public java.lang.String getPolicyName()
Returns the name of a policy

Returns:
The policy name as String

getPolicySheet

public org.w3c.dom.Document getPolicySheet(int index)
Returns the policy sheet given its index

Parameters:
index - The integer index of policy sheet
Returns:
The policy sheet as Document

setPolicySheet

public void setPolicySheet(org.w3c.dom.Document doc,
                           int index)
Sets the policy sheet at a given index

Parameters:
doc - The policy sheet supplied as Document
index - The integer index of policy sheet

getPolicySheetPath

public java.lang.String getPolicySheetPath(int index)
Returns the path of a policy sheet

Parameters:
index - The integer index of policy sheet
Returns:
The policy sheet path as String

setPolicySheetPath

public void setPolicySheetPath(java.lang.String path,
                               int index)
Sets the path of a policy object

Parameters:
path - The policy sheet path supplied as String
index - The integer index of policy sheet

getPolicySheetId

public java.lang.String getPolicySheetId(int index)
Returns the id of a policy sheet

Parameters:
index - The integer index of policy sheet
Returns:
The policy sheet id as String

setPolicySheetId

public void setPolicySheetId(java.lang.String id,
                             int index)
Sets the id of a policy object

Parameters:
id - The policy sheet id supplied as String
index - The integer index of policy sheet

getPolicyDef

public org.w3c.dom.Document getPolicyDef(int index)
Returns the policy definition file given its index

Parameters:
index - The integer index of policy definition file
Returns:
The policy definition file as Document

setPolicyDef

public void setPolicyDef(org.w3c.dom.Document doc,
                         int index)
Sets the policy definition file at a given index

Parameters:
doc - The policy definition file supplied as Document
index - The integer index of policy definition file

getPolicyDefPath

public java.lang.String getPolicyDefPath(int index)
Returns the path of a policy definition file

Parameters:
index - The integer index of policy definition file
Returns:
The policy definition file path as String

setPolicyDefPath

public void setPolicyDefPath(java.lang.String path,
                             int index)
Sets the path of a policy object

Parameters:
path - The policy definition file path supplied as String
index - The integer index of policy definition file

getPolicyDefId

public java.lang.String getPolicyDefId(int index)
Returns the id of a policy definition file

Parameters:
index - The integer index of policy definition file
Returns:
The policy definition file id as String

setPolicyDefId

public void setPolicyDefId(java.lang.String id,
                           int index)
Sets the id of a policy object

Parameters:
id - The policy definition file id supplied as String
index - The integer index of policy definition file

getUserCount

public int getUserCount()
Returns the number of users

Returns:
The user count as int

getRoleCount

public int getRoleCount()
Returns the number of roles

Returns:
The role count as int

getSSDRoleSetCount

public int getSSDRoleSetCount()
Returns the number of SSD role sets

Returns:
The set count count as int

getDSDRoleSetCount

public int getDSDRoleSetCount()
Returns the number of DSD role sets

Returns:
The set count count as int

getPermissionCount

public int getPermissionCount()
Returns the number of permissions

Returns:
The permission count as int

getURAssignCount

public int getURAssignCount()
Returns the number of user-role assignments

Returns:
The assignment count as int

getPRAssignCount

public int getPRAssignCount()
Returns the number of permission-to-role assignments

Returns:
The assignment count as int

getIntervalExprCount

public int getIntervalExprCount()
Returns the number of interval expressions

Returns:
The interval expression count as int

getDurationExprCount

public int getDurationExprCount()
Returns the number of duration expressions

Returns:
The duration expression count as int

getPeriodicTimeExprCount

public int getPeriodicTimeExprCount()
Returns the number of periodic time expressions

Returns:
The periodic time expression count as int

checkApplied

public boolean checkApplied()
Checks whether the policy has been applied

Returns:
A boolean indicating whether the policy has been applied

setApplied

public void setApplied(boolean value)
Sets whether the policy has been applied

Parameters:
value - The applied status supplied as boolean

getGTRBACModule

public GTRBACModule getGTRBACModule()
Returns the gtrbac module object running this policy

Returns:
The gtrbac module object as GTRBACModule

setGTRBACModule

public void setGTRBACModule(GTRBACModule gtrbac)
Sets the gtrbac module object running this policy

Parameters:
gtrbac - The gtrbac module object supplied as GTRBACModule

checkLoadedFile

public boolean checkLoadedFile(int type,
                               int index)
Checks if a given policy file is loaded

Parameters:
type - An integer type of the policy file. '0' indicates a definiton file, '1' indicates a policy sheet.
index - An integer index of the policy file. Type '0' Index '0' = XCredTyoeDef Type '0' Index '1' = XSoDDef Type '0' Index '2' = XTempConstDef Type '1' Index '0' = XUS Type '1' Index '1' = XRS Type '1' Index '2' = XPS Type '1' Index '3' = XURAS Type '1' Index '4' = XPRAS
Returns:
A boolean indicating whether the file is loaded

checkUnloadedFile

public java.lang.String checkUnloadedFile()
Returns the name of first unloaded file of a policy object

Returns:
The file name as String

checkLoadedDef

public boolean checkLoadedDef(int index)
Checks if a given policy definition is loaded

Parameters:
index - The integer index of policy definition
Returns:
A boolean indicating whether the definition is loaded

checkUnloadedDef

public java.lang.String checkUnloadedDef()
Returns the name of first unloaded definition file of a policy object

Returns:
The definition file name as String

checkLoadedSheet

public boolean checkLoadedSheet(int index)
Checks if a given policy sheet is loaded

Parameters:
index - The integer index of policy sheet
Returns:
A boolean indicating whether the sheet is loaded

checkUnloadedSheet

public java.lang.String checkUnloadedSheet()
Returns the name of first unloaded policy sheet of a policy object

Returns:
The policy sheet name as String

setInfoItem

public void setInfoItem(int index)
Sets the info items for the policy

Parameters:
index - The integer array index of info item

getInfoItem

public java.lang.String getInfoItem(int index)
Returns the info item for the policy

Parameters:
index - The integer array index of info item
Returns:
The info item as String

getFileName

public java.lang.String getFileName(int type,
                                    int index)
Returns the name of policy file given its type and index

Parameters:
type - An integer type of the policy file. '0' indicates a definiton file, '1' indicates a policy sheet.
index - An integer index of the policy file. Type '0' Index '0' = XCredTyoeDef Type '0' Index '1' = XSoDDef Type '0' Index '2' = XTempConstDef Type '1' Index '0' = XUS Type '1' Index '1' = XRS Type '1' Index '2' = XPS Type '1' Index '3' = XURAS Type '1' Index '4' = XPRAS
Returns:
The name of policy file as String

getDefName

public java.lang.String getDefName(int index)
Returns the name of definition file given its index

Parameters:
index - The integer array index of definition file
Returns:
The name of definition file as String

getDefNum

public int getDefNum(java.lang.String defn)
Returns the index of the selected definition file

Parameters:
defn - The name of the definition file supplied as String
Returns:
The index of the definition file

getSheetName

public java.lang.String getSheetName(int index)
Returns the name of policy sheet given its index

Parameters:
index - The integer array index of policy sheet
Returns:
The name of policy sheet as String

getSheetNum

public int getSheetNum(java.lang.String sheet)
Returns the index of the selected sheet

Parameters:
sheet - The name of the sheet supplied as String
Returns:
The index of the sheet

getInfoItemNum

public int getInfoItemNum(java.lang.String item)
Returns the index of selected info item

Parameters:
item - The info item supplied as String
Returns:
The index of the item

addUser

public int addUser(java.lang.String user_id)
Adds a new user to the UserList

Parameters:
user_id - The ID of the user supplied as String
Returns:
Integer representing state of the operation

getUserId

public java.lang.String getUserId(int index)
Returns the user id at the given index- used to fill combo box

Parameters:
index - The integer index of the user from the combo box
Returns:
The user id as String

getUser

public User getUser(java.lang.String user_id)
Returns the user object

Parameters:
user_id - The ID of the user supplied as String
Returns:
The user object, null if none found

addRole

public int addRole(java.lang.String role_id)
Adds a new role to the RoleList

Parameters:
role_id - The ID of the role supplied as String
Returns:
Integer representing state of the operation

getRoleName

public java.lang.String getRoleName(int index)
Returns the role name at the given index- used to fill combo box

Parameters:
index - The integer index of the role from the combo box
Returns:
The role name as String

getRoleId

public java.lang.String getRoleId(java.lang.String role_name)
Returns the id of the role given the name

Parameters:
role_name - The name of the role supplied as type String
Returns:
The role id as String

getRole

public Role getRole(java.lang.String role_id)
Returns the role object given role id

Parameters:
role_id - The ID of the role supplied as String
Returns:
The role object, null if none found

addSSDRoleSet

public int addSSDRoleSet(java.lang.String ssd_id)
Adds a new SSD role set to the SSDRoleSetList

Parameters:
ssd_id - The ID of the role set supplied as String
Returns:
Integer representing state of the operation

getSSDRoleSetId

public java.lang.String getSSDRoleSetId(int index)
Returns the SSD role set id at the given index

Parameters:
index - The integer index of the role set
Returns:
The role set id as String

getSSDRoleSet

public SSDRoleSet getSSDRoleSet(java.lang.String ssd_id)
Returns the SSD role set object

Parameters:
ssd_id - The ID of the role set supplied as String
Returns:
The role set object, null if none found

addDSDRoleSet

public int addDSDRoleSet(java.lang.String dsd_id)
Adds a new DSD role set to the DSDRoleSetList

Parameters:
dsd_id - The ID of the role set supplied as String
Returns:
Integer representing state of the operation

getDSDRoleSetId

public java.lang.String getDSDRoleSetId(int index)
Returns the DSD role set id at the given index

Parameters:
index - The integer index of the role set
Returns:
The role set id as String

getDSDRoleSet

public DSDRoleSet getDSDRoleSet(java.lang.String dsd_id)
Returns the DSD role set object

Parameters:
dsd_id - The ID of the role set supplied as String
Returns:
The role set object, null if none found

addPermission

public int addPermission(java.lang.String perm_id)
Adds a new permission to the PermissionList

Parameters:
perm_id - The ID of the permission supplied as String
Returns:
Integer representing state of the operation

getPermId

public java.lang.String getPermId(int index)
Returns the permission id at the given index- used to fill combo box

Parameters:
index - The integer index of the permission from the combo box
Returns:
The permission id as String

getPermission

public Permission getPermission(java.lang.String perm_id)
Returns the permission object

Parameters:
perm_id - The id of the permission supplied as String
Returns:
The permission object, null if none found

addURAssign

public int addURAssign(java.lang.String ur_id)
Adds a new URAssign to the UserRoleList

Parameters:
ur_id - The ID of the URAssign supplied as String
Returns:
Integer representing state of the operation

getURAssignId

public java.lang.String getURAssignId(int index)
Returns the URAssign id at the given index

Parameters:
index - The integer index of the URAssign
Returns:
The URAssign id as String

getURAssign

public UserRoleAssign getURAssign(java.lang.String ur_id)
Returns the URAssign object

Parameters:
ur_id - The id of the URAssign supplied as String
Returns:
The URAssign object, null if none found

addPRAssign

public int addPRAssign(java.lang.String pr_id)
Adds a new PRAssign to the PermissionRoleList

Parameters:
pr_id - The ID of the PRAssign supplied as String
Returns:
Integer representing state of the operation

getPRAssignId

public java.lang.String getPRAssignId(int index)
Returns the PRAssign id at the given index

Parameters:
index - The integer index of the PRAssign
Returns:
The PRAssign id as String

getPRAssign

public PermRoleAssign getPRAssign(java.lang.String pr_id)
Returns the PRAssign object

Parameters:
pr_id - The id of the PRAssign supplied as String
Returns:
The PRAssign object, null if none found

addIntervalExpr

public int addIntervalExpr(java.lang.String i_expr_id)
Adds a new interval expression to the IntervalExprList

Parameters:
i_expr_id - The ID of the supplied as String
Returns:
Integer representing state of the operation

getIntervalExprId

public java.lang.String getIntervalExprId(int index)
Returns the interval expression id at the given index

Parameters:
index - The integer index of the expression
Returns:
The expression id as String

getIntervalExpr

public IntervalExpr getIntervalExpr(java.lang.String i_expr_id)
Returns the interval expression object

Parameters:
i_expr_id - The ID of the expression supplied as String
Returns:
The expression object, null if none found

addDurationExpr

public int addDurationExpr(java.lang.String d_expr_id)
Adds a new duration expression to the DurationExprList

Parameters:
d_expr_id - The ID of the supplied as String
Returns:
Integer representing state of the operation

getDurationExprId

public java.lang.String getDurationExprId(int index)
Returns the duration expression id at the given index

Parameters:
index - The integer index of the expression
Returns:
The expression id as String

getDurationExpr

public DurationExpr getDurationExpr(java.lang.String d_expr_id)
Returns the duration expression object

Parameters:
d_expr_id - The ID of the expression supplied as String
Returns:
The expression object, null if none found

addPeriodicTimeExpr

public int addPeriodicTimeExpr(java.lang.String pt_expr_id)
Adds a new periodic time expression to the Periodic TimeExprList

Parameters:
pt_expr_id - The ID of the supplied as String
Returns:
Integer representing state of the operation

getPeriodicTimeExprId

public java.lang.String getPeriodicTimeExprId(int index)
Returns the periodic time expression id at the given index

Parameters:
index - The integer index of the expression
Returns:
The expression id as String

getPeriodicTimeExpr

public PeriodicTimeExpr getPeriodicTimeExpr(java.lang.String pt_expr_id)
Returns the periodic time expression object

Parameters:
pt_expr_id - The ID of the expression supplied as String
Returns:
The expression object, null if none found