XGTRBAC
Class Session

java.lang.Object
  extended by XGTRBAC.Session

public class Session
extends java.lang.Object

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


Field Summary
private  GTRBACModule gtrbacModule
           
private  java.util.LinkedList RoleNames
           
private  java.lang.String UserId
           
 
Constructor Summary
Session(java.lang.String user_id)
          Creates a new instance of Session
 
Method Summary
 int addRole(Policy policy, java.lang.String role_name)
          Adds a new role name to the RoleList
 java.util.LinkedList getActivatedRoles(Policy policy)
          Returns the activated roles for the user
 GTRBACModule getGTRBACModule()
          Returns the gtrbac module object running this session
 int getRoleCount()
          Returns the number of roles
 java.lang.String getRoleName(int index)
          Returns the role name at the given index- used to fill combo box
 java.lang.String getUserId()
          Returns the id of session user
 void setGTRBACModule(GTRBACModule gtrbac)
          Sets the gtrbac module object running this session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UserId

private java.lang.String UserId

RoleNames

private java.util.LinkedList RoleNames

gtrbacModule

private GTRBACModule gtrbacModule
Constructor Detail

Session

public Session(java.lang.String user_id)
Creates a new instance of Session

Method Detail

getUserId

public java.lang.String getUserId()
Returns the id of session user

Returns:
The user id as String

getRoleCount

public int getRoleCount()
Returns the number of roles

Returns:
The role count as int

addRole

public int addRole(Policy policy,
                   java.lang.String role_name)
Adds a new role name to the RoleList

Parameters:
policy - The reference to policy object supplied as Policy
role_name - The name 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

getActivatedRoles

public java.util.LinkedList getActivatedRoles(Policy policy)
Returns the activated roles for the user

Parameters:
policy - The reference to policy object supplied as Policy
Returns:
The activated roles list as LinkedList

getGTRBACModule

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

Returns:
The gtrbac module object as GTRBACModule

setGTRBACModule

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

Parameters:
gtrbac - The gtrbac module object supplied as GTRBACModule