站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

DBRoleModuleImpl - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.identity.db
Class DBRoleModuleImpl

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.portal.jems.as.system.AbstractJBossService
              extended byorg.jboss.portal.identity.db.DBRoleModuleImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, RoleModule, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class DBRoleModuleImpl
extends AbstractJBossService
implements RoleModule

Version:
$Revision: 5448 $
Author:
Julien Viet , Thomas Heute , Roy Russo : roy at jboss dot org

Field Summary
protected  JNDI.Binding jndiBinding
          .
protected  java.lang.String jndiName
          .
private  org.apache.log4j.Logger log
          .
protected  org.hibernate.SessionFactory sessionFactory
          .
protected  java.lang.String sessionFactoryJNDIName
          .
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DBRoleModuleImpl()
           
 
Method Summary
 Role createRole(java.lang.String name, java.lang.String displayName)
          Create a new role with the specified name.
 Role findRoleById(java.lang.Object id)
          Retrieves a role by its id.
 Role findRoleById(java.lang.String id)
          Retrieves a role by its id.
 Role findRoleByName(java.lang.String name)
          Retrieves a role by its name
 java.util.Set findRoleMembers(java.lang.String roleName, int offset, int limit, java.lang.String userNameFilter)
          Returns role members based on rolename
 java.util.Set findRoles()
          Get all the roles
 java.util.Set findRolesByNames(java.lang.String[] names)
          Retrieve a collection of role from the role names.
protected  org.hibernate.Session getCurrentSession()
          Can be subclasses to provide testing in a non JTA environement.
 java.lang.String getJNDIName()
           
 java.util.Set getRoles(User user)
          Return the set of role objects that a given user has.
 int getRolesCount()
          Returns the number of roles.
 org.hibernate.SessionFactory getSessionFactory()
           
 java.lang.String getSessionFactoryJNDIName()
           
 void removeRole(java.lang.Object id)
          Remove a role.
 void setJNDIName(java.lang.String jndiName)
           
 void setRoles(User user, java.util.Set roles)
          Assign a set of role objects to a given user.
 void setSessionFactoryJNDIName(java.lang.String sessionFactoryJNDIName)
           
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService
create, destroy, getState, getStateString, start, stop
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
createService, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final org.apache.log4j.Logger log
.


sessionFactoryJNDIName

protected java.lang.String sessionFactoryJNDIName
.


sessionFactory

protected org.hibernate.SessionFactory sessionFactory
.


jndiName

protected java.lang.String jndiName
.


jndiBinding

protected JNDI.Binding jndiBinding
.

Constructor Detail

DBRoleModuleImpl

public DBRoleModuleImpl()
Method Detail

getSessionFactoryJNDIName

public java.lang.String getSessionFactoryJNDIName()

setSessionFactoryJNDIName

public void setSessionFactoryJNDIName(java.lang.String sessionFactoryJNDIName)

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()

getJNDIName

public java.lang.String getJNDIName()

setJNDIName

public void setJNDIName(java.lang.String jndiName)

startService

protected void startService()
                     throws java.lang.Exception
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Throws:
java.lang.Exception

findRoleByName

public Role findRoleByName(java.lang.String name)
                    throws IdentityException
Description copied from interface: RoleModule
Retrieves a role by its name

Specified by:
findRoleByName in interface RoleModule
Parameters:
name - the role name
Returns:
the role
Throws:
IdentityException

findRolesByNames

public java.util.Set findRolesByNames(java.lang.String[] names)
                               throws IdentityException
Description copied from interface: RoleModule
Retrieve a collection of role from the role names.

Specified by:
findRolesByNames in interface RoleModule
Parameters:
names - the role names
Returns:
a collection of roles
Throws:
IdentityException

findRoleById

public Role findRoleById(java.lang.String id)
                  throws java.lang.IllegalArgumentException,
                         IdentityException
Description copied from interface: RoleModule
Retrieves a role by its id.

Specified by:
findRoleById in interface RoleModule
Parameters:
id - the role id
Returns:
the role
Throws:
java.lang.IllegalArgumentException
IdentityException

findRoleById

public Role findRoleById(java.lang.Object id)
                  throws IdentityException
Description copied from interface: RoleModule
Retrieves a role by its id.

Specified by:
findRoleById in interface RoleModule
Parameters:
id - the role id
Returns:
the role
Throws:
IdentityException

createRole

public Role createRole(java.lang.String name,
                       java.lang.String displayName)
                throws IdentityException
Description copied from interface: RoleModule
Create a new role with the specified name.

Specified by:
createRole in interface RoleModule
Parameters:
name - the role name
displayName - the role display name
Returns:
the role
Throws:
IdentityException

removeRole

public void removeRole(java.lang.Object id)
                throws IdentityException
Description copied from interface: RoleModule
Remove a role.

Specified by:
removeRole in interface RoleModule
Parameters:
id - the role id
Throws:
IdentityException

getRolesCount

public int getRolesCount()
                  throws IdentityException
Description copied from interface: RoleModule
Returns the number of roles.

Specified by:
getRolesCount in interface RoleModule
Returns:
the number of roles
Throws:
IdentityException

findRoles

public java.util.Set findRoles()
                        throws IdentityException
Description copied from interface: RoleModule
Get all the roles

Specified by:
findRoles in interface RoleModule
Returns:
the roles
Throws:
IdentityException

findRoleMembers

public java.util.Set findRoleMembers(java.lang.String roleName,
                                     int offset,
                                     int limit,
                                     java.lang.String userNameFilter)
                              throws IdentityException
Description copied from interface: RoleModule
Returns role members based on rolename

Specified by:
findRoleMembers in interface RoleModule
Parameters:
roleName -
offset -
limit -
Throws:
IdentityException

setRoles

public void setRoles(User user,
                     java.util.Set roles)
              throws IdentityException
Description copied from interface: RoleModule
Assign a set of role objects to a given user.

Specified by:
setRoles in interface RoleModule
Parameters:
user - the user
roles - the user roles
Throws:
IdentityException

getRoles

public java.util.Set getRoles(User user)
                       throws IdentityException
Description copied from interface: RoleModule
Return the set of role objects that a given user has.

Specified by:
getRoles in interface RoleModule
Parameters:
user - the user
Returns:
the set of roles of the specified user
Throws:
IdentityException

getCurrentSession

protected org.hibernate.Session getCurrentSession()
Can be subclasses to provide testing in a non JTA environement.