Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jeteam.bean.security
Class RoleServiceBean  view RoleServiceBean download RoleServiceBean.java

java.lang.Object
  extended byorg.jeteam.bean.security.RoleServiceBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean
Direct Known Subclasses:
RoleServiceBeanImpl

public abstract class RoleServiceBean
extends java.lang.Object
implements javax.ejb.SessionBean

This bean is a service to Role CRUD operations.

A role identifies a profile in the system, this can be a developer, a manager, a reviewer, etc... Each role has a set of privileges associated with it which will allow an entity associated to that role to have access to the system. While privileges are a fine-grain view on the system authorization a role is coarse-grained.


Constructor Summary
RoleServiceBean()
           
 
Method Summary
abstract  void addPrivilege(RoleDTO role, PrivilegeDTO privilege)
           Associates a privilege to the role.
abstract  void clearPrivileges(RoleDTO role)
           Removes all privileges associated to this role, only the relationships will be removed; the privileges will not be touched.
abstract  RoleDTO createRole(RoleDTO role)
           Creates a new role.
 void ejbCreate()
           
 void ejbPostCreate()
           
abstract  PrivilegeDTO[] getPrivileges(RoleDTO role)
           Returns a collection of all privileges associated to this role.
abstract  RoleDTO[] getRoles()
           Returns all roles in the data source.
abstract  org.jeteam.bean.user.UserDTO[] getUsers(RoleDTO role)
           Returns all the users implementing the role.
abstract  void removePrivilege(RoleDTO role, PrivilegeDTO privilege)
           Removing a privilege from a role will result in removing the privilege from the relationship, it will not be deleted.
abstract  void removeRole(RoleDTO role)
           Removes a role from the data source.
abstract  void setPrivileges(RoleDTO role, PrivilegeDTO[] privileges)
           Sets the privileges associated to the argument role, the previous set of privileges will be cleared.
abstract  void updateRole(RoleDTO role)
           Updates the properties of the role.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionBean
ejbActivate, ejbPassivate, ejbRemove, setSessionContext
 

Constructor Detail

RoleServiceBean

public RoleServiceBean()
Method Detail

createRole

public abstract RoleDTO createRole(RoleDTO role)
                            throws RoleException

Creates a new role. The name must be unique.


removeRole

public abstract void removeRole(RoleDTO role)
                         throws RoleException

Removes a role from the data source.


getRoles

public abstract RoleDTO[] getRoles()
                            throws RoleException

Returns all roles in the data source.


addPrivilege

public abstract void addPrivilege(RoleDTO role,
                                  PrivilegeDTO privilege)
                           throws RoleException

Associates a privilege to the role.


removePrivilege

public abstract void removePrivilege(RoleDTO role,
                                     PrivilegeDTO privilege)
                              throws RoleException

Removing a privilege from a role will result in removing the privilege from the relationship, it will not be deleted.


getPrivileges

public abstract PrivilegeDTO[] getPrivileges(RoleDTO role)
                                      throws RoleException

Returns a collection of all privileges associated to this role.


clearPrivileges

public abstract void clearPrivileges(RoleDTO role)
                              throws RoleException

Removes all privileges associated to this role, only the relationships will be removed; the privileges will not be touched.


getUsers

public abstract org.jeteam.bean.user.UserDTO[] getUsers(RoleDTO role)
                                                 throws RoleException

Returns all the users implementing the role.


updateRole

public abstract void updateRole(RoleDTO role)
                         throws RoleException

Updates the properties of the role. The name can be changed but must remain unique in the set of all roles.


setPrivileges

public abstract void setPrivileges(RoleDTO role,
                                   PrivilegeDTO[] privileges)
                            throws RoleException

Sets the privileges associated to the argument role, the previous set of privileges will be cleared.


ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException