org.moremotion.security
Class Role

java.lang.Object
  extended by org.moremotion.security.Role
All Implemented Interfaces:
java.lang.Comparable

public class Role
extends java.lang.Object
implements java.lang.Comparable

Represents a role by a name and description. A Role may zero or more checkpoints.

Version:
$Id: Role.java 51 2008-03-10 11:46:54Z erkan $

Constructor Summary
Role()
          Creates a new role.
Role(java.lang.String name, java.lang.String description)
          Creates a new role.
 
Method Summary
 void addCheckPoint(CheckPoint checkPoint)
          Adds a check point to role.
 int compareTo(java.lang.Object obj)
          Compares this role to other.
 boolean equals(java.lang.Object obj)
          Checks wheter or not this role is equal to other.
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of the specified role attribute.
 java.util.Properties getAttributes()
          Returns the attribute of this role.
 CheckPoint[] getCheckPoints()
          Returns a list of check points.
 java.lang.String getDescription()
          Returns role description.
 java.lang.String getId()
          Gets role identifier.
 java.lang.String getName()
          Returns role name.
 boolean hasCheckPoint(java.lang.String checkPointName)
          Returns trueif this role has the given check point, false otherwise.
 void removeAttribute(java.lang.String name)
          Removes the specified attribute from this role.
 void removeCheckPoint(CheckPoint checkPoint)
          Removes a check point from role.
 void setAttribute(java.lang.String name, java.lang.String value)
          Sets a user attribute to this role.
 void setDescription(java.lang.String description)
          Sets role description.
 void setId(java.lang.String value)
          Sets role identifier.
 void setName(java.lang.String name)
          Sets role name.
 java.lang.String toString()
          Returns string respresentation of role.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Role

public Role()
Creates a new role.


Role

public Role(java.lang.String name,
            java.lang.String description)
Creates a new role.

Parameters:
name - Role name.
description - Role description.
Method Detail

addCheckPoint

public void addCheckPoint(CheckPoint checkPoint)
Adds a check point to role.


removeCheckPoint

public void removeCheckPoint(CheckPoint checkPoint)
Removes a check point from role.


getCheckPoints

public CheckPoint[] getCheckPoints()
Returns a list of check points.


hasCheckPoint

public boolean hasCheckPoint(java.lang.String checkPointName)
Returns trueif this role has the given check point, false otherwise.


getName

public java.lang.String getName()
Returns role name.


getDescription

public java.lang.String getDescription()
Returns role description.


setName

public void setName(java.lang.String name)
Sets role name.


setDescription

public void setDescription(java.lang.String description)
Sets role description.


getId

public java.lang.String getId()
Gets role identifier.


setId

public void setId(java.lang.String value)
Sets role identifier.

For internal use only.


equals

public boolean equals(java.lang.Object obj)
Checks wheter or not this role is equal to other.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns string respresentation of role.

Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object obj)
Compares this role to other.

Specified by:
compareTo in interface java.lang.Comparable

getAttributes

public java.util.Properties getAttributes()
Returns the attribute of this role.


setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Sets a user attribute to this role.


getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns the value of the specified role attribute.


removeAttribute

public void removeAttribute(java.lang.String name)
Removes the specified attribute from this role.



Copyright © 2002-2008 MOR YAZILIM. All Rights Reserved.