org.figure8.join.businessobjects.security
Class Role

java.lang.Object
  extended by org.figure8.join.core.EntityObject
      extended by org.figure8.join.core.SortableEntityObject
          extended by org.figure8.join.businessobjects.security.Role
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Role
extends SortableEntityObject

This is an entity representing a security role into Join system. Role can also be seen a permission type handler.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_ADMIN_ROLE
          Default role name for Join administation
static java.lang.String DEFAULT_ARCHITECT_ROLE
          Default role name for software project architect
static java.lang.String DEFAULT_JOINER_ROLE
          Default role name for integration team members
static java.lang.String DEFAULT_SUPPLIER_ROLE
          Default role name for deliverables supplier
 
Constructor Summary
Role()
          Creates a new instance of Role
Role(java.lang.String name, java.lang.String description)
          Creates a new instance of Role with mandatory fields
 
Method Summary
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 PermissionResourceResolver getPermissionResourceResolver()
          Get the PermissionResourceResolver asssociated to this role (if any).
 java.lang.String getPermissionResourceResolverClass()
           
 java.lang.String getStringForComparison()
          Get the comparison criterion as a string.
protected  void instantiateResourceResolver()
          Try to instantiate the PermissionResourceResolver associated with this role (if any ...)
 void setDescription(java.lang.String description)
           
 void setName(java.lang.String name)
           
 void setPermissionResourceResolverClass(java.lang.String permissionResourceResolverClass)
          Give a resource resolver to this role. ie : an helper object that allows to retrieve resources to whom should apply security permission within this role.
 
Methods inherited from class org.figure8.join.core.SortableEntityObject
compareTo
 
Methods inherited from class org.figure8.join.core.EntityObject
clone, equals, getId, hashCode, isTransient
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ADMIN_ROLE

public static final java.lang.String DEFAULT_ADMIN_ROLE
Default role name for Join administation

See Also:
Constant Field Values

DEFAULT_JOINER_ROLE

public static final java.lang.String DEFAULT_JOINER_ROLE
Default role name for integration team members

See Also:
Constant Field Values

DEFAULT_ARCHITECT_ROLE

public static final java.lang.String DEFAULT_ARCHITECT_ROLE
Default role name for software project architect

See Also:
Constant Field Values

DEFAULT_SUPPLIER_ROLE

public static final java.lang.String DEFAULT_SUPPLIER_ROLE
Default role name for deliverables supplier

See Also:
Constant Field Values
Constructor Detail

Role

public Role()
Creates a new instance of Role


Role

public Role(java.lang.String name,
            java.lang.String description)
Creates a new instance of Role with mandatory fields

Parameters:
name - Name of this new role (must be unique)
description - Description of this new role
Method Detail

getName

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

setName

public void setName(java.lang.String name)
Parameters:
name - The name of this role

getDescription

public java.lang.String getDescription()
Returns:
The decription of this role

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - Description of this role (tips: use a key for localization)

getPermissionResourceResolverClass

public java.lang.String getPermissionResourceResolverClass()
Returns:
The FQN of the Java class used for managing permissions within this role

setPermissionResourceResolverClass

public void setPermissionResourceResolverClass(java.lang.String permissionResourceResolverClass)
                                        throws InvalidParameterException
Give a resource resolver to this role. ie : an helper object that allows to retrieve resources to whom should apply security permission within this role. This parameter must be the name of a Java class that implements org.figure8.join.services.security.PermissionResourceResolver

Parameters:
permissionResourceResolverClass - FQN of Java class
Throws:
InvalidParameterException - if the permissionResourceResolverClass is not valid

getPermissionResourceResolver

public PermissionResourceResolver getPermissionResourceResolver()
                                                         throws InvalidParameterException
Get the PermissionResourceResolver asssociated to this role (if any).

Returns:
The resolver instance or null if no resolver is associated to this role
Throws:
InvalidParameterException - if the permissionResourceResolverClass inner field is not valid

instantiateResourceResolver

protected void instantiateResourceResolver()
                                    throws InvalidParameterException
Try to instantiate the PermissionResourceResolver associated with this role (if any ...)

Throws:
InvalidParameterException - if the permissionResourceResolverClass inner field is not valid

getStringForComparison

public java.lang.String getStringForComparison()
Get the comparison criterion as a string. Criterion is the name.

Specified by:
getStringForComparison in class SortableEntityObject
Returns:
The string representation of comparison and sort criterion


Copyright © 2005-2008 Join. All Rights Reserved.