edu.nyu.cs.pdsg.drbac
Class Role

java.lang.Object
  extended byedu.nyu.cs.pdsg.drbac.Role
All Implemented Interfaces:
Credentials, java.io.Serializable

public class Role
extends java.lang.Object
implements Credentials, java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
 class Role.RoleImpl
           
 
Field Summary
 int id
           
protected  Role.RoleImpl impl
           
protected static java.util.Vector roles
           
 
Constructor Summary
Role(Role _role, boolean _assign)
          Assign Copy Initializer
Role(RoleId _roleid, java.lang.String _name, DiscoveryTag _searchTag)
          Standard Simple Initializer
Role(RoleId _roleid, java.lang.String _name, DiscoveryTag _searchTag, boolean _assign)
          Standard Initializer
Role(java.lang.String _role, DiscoveryTag _searchTag)
          Human Interface Initializer
 
Method Summary
 boolean assign()
           
 int compareTo(java.lang.Object o)
          Compare this role to another object
 java.lang.String descriptionString()
           
 boolean equals(java.lang.Object o)
          Compares this Role to another object
 boolean equivalentTo(Role obj)
          Compare this role to another role logically
protected  Role.RoleImpl getImpl(int id)
          Gets the role information for the unique integer
 java.math.BigInteger getModulus()
           
 int hashCode()
           
 boolean hasSameEntity(Role r)
          Compares the entity of this role to the entity of another role
 boolean isLogicalAttribute()
          Test to see if a given Role is logically an Attribute, i.e.
 boolean isLogicalEntity()
          Test to see if a given Role is logically an Entity, i.e.
 boolean isLogicalRole()
          Test to see if a given Role is logically a Role, i.e.
protected  int makeRoleImpl(RoleId _roleid, java.lang.String _name, DiscoveryTag _searchTag, boolean _assign)
          Internal: Generates a unique integer for each role
 java.lang.String name()
           
 boolean nameEquals(java.lang.String s)
          Compare the name of this role to another string
 boolean nameEquals(java.lang.String s, boolean forceType)
           
 RoleId roleid()
           
 DiscoveryTag searchTag()
           
 void setSortIndex(int x)
          Set the internally used sortIndex of this role
 int sortIndex()
           
 java.lang.String toLongString()
           
 java.lang.String toString()
           
 java.lang.String toTitleString()
           
 void updateID()
          This function must be called after the role is deserialized, or equals() will not work properly
protected  int verifyImplId(Role.RoleImpl impl)
          Re-generates the unique integer for a given role
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

roles

protected static java.util.Vector roles

id

public int id

impl

protected Role.RoleImpl impl
Constructor Detail

Role

public Role(java.lang.String _role,
            DiscoveryTag _searchTag)
Human Interface Initializer

Parameters:
_role - the string containing the role in the form of (A.y, or A)
_searchTag - information about the role's home server

Role

public Role(RoleId _roleid,
            java.lang.String _name,
            DiscoveryTag _searchTag)
Standard Simple Initializer

Parameters:
_roleid - the entity this role belongs to
_name - the role's name, or null to represent an entity
_searchTag - information about the role's home server

Role

public Role(RoleId _roleid,
            java.lang.String _name,
            DiscoveryTag _searchTag,
            boolean _assign)
Standard Initializer

Parameters:
_roleid - the entity this role belongs to
_name - the role's name, or null to represent an entity
_searchTag - information about the role's home server
_assign - true to make the role represent a role with assign capabilities

Role

public Role(Role _role,
            boolean _assign)
Assign Copy Initializer

Parameters:
_role - the role to copy
_assign - the new value of assign
Method Detail

updateID

public void updateID()
This function must be called after the role is deserialized, or equals() will not work properly


equals

public boolean equals(java.lang.Object o)
Compares this Role to another object

Returns:
true if the objects are the same

hasSameEntity

public boolean hasSameEntity(Role r)
Compares the entity of this role to the entity of another role

Returns:
true if the roles have the same entity

getModulus

public java.math.BigInteger getModulus()
Returns:
the modulus of the public key

compareTo

public int compareTo(java.lang.Object o)
Compare this role to another object


isLogicalEntity

public boolean isLogicalEntity()
Test to see if a given Role is logically an Entity, i.e. it has no name in the namespace defined by the Role's RoleId.

Returns:
true if this role is an entity

isLogicalAttribute

public boolean isLogicalAttribute()
Test to see if a given Role is logically an Attribute, i.e. it has a name in the namespace defined by the Role's RoleId, and the name ends with one of the four Attribute operators: +, *, <, >.

Returns:
true if this role can be used as an attribute

isLogicalRole

public boolean isLogicalRole()
Test to see if a given Role is logically a Role, i.e. it has a name in the namespace defined by the Role's RoleId, but it is not an Attribute.

Returns:
true if this role is a logical role

hashCode

public int hashCode()
Returns:
the hashcode of this role

nameEquals

public boolean nameEquals(java.lang.String s)
Compare the name of this role to another string

Parameters:
s - the string to compare to
Returns:
true if this name is equal to the given string

nameEquals

public boolean nameEquals(java.lang.String s,
                          boolean forceType)

equivalentTo

public boolean equivalentTo(Role obj)
Compare this role to another role logically

Parameters:
obj - the role to compare to
Returns:
true if this role has by default the rights of obj

toString

public java.lang.String toString()
Returns:
a human readable representation of this role

toTitleString

public java.lang.String toTitleString()
Returns:
a human readable representation of this role suitable for use in a title

toLongString

public java.lang.String toLongString()
Returns:
a long human readable representation of this role

descriptionString

public java.lang.String descriptionString()
Returns:
a descript view of the role for use by drbac_GUI

roleid

public RoleId roleid()
Returns:
the roleid of this role

name

public java.lang.String name()
Returns:
the name of this role

searchTag

public DiscoveryTag searchTag()
Returns:
information about the home of this role

assign

public boolean assign()
Returns:
whether this role represents a role with the right of assign

sortIndex

public int sortIndex()
Returns:
the internally used sortIndex of this role

setSortIndex

public void setSortIndex(int x)
Set the internally used sortIndex of this role


makeRoleImpl

protected int makeRoleImpl(RoleId _roleid,
                           java.lang.String _name,
                           DiscoveryTag _searchTag,
                           boolean _assign)
Internal: Generates a unique integer for each role


getImpl

protected Role.RoleImpl getImpl(int id)
Gets the role information for the unique integer


verifyImplId

protected int verifyImplId(Role.RoleImpl impl)
Re-generates the unique integer for a given role



Copyright (c) 2002-2003 New York University RLAB