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

UserModuleImpl - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.core.impl.user
Class UserModuleImpl

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.portal.common.system.AbstractJBossService
              extended byorg.jboss.portal.core.modules.AbstractModule
                  extended byorg.jboss.portal.core.impl.user.UserModuleImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, UserModule

public class UserModuleImpl
extends AbstractModule
implements UserModule


Field Summary
protected  HibernateProvider hibernateProvider
          .
protected  org.hibernate.SessionFactory sessionFactory
          .
 
Fields inherited from class org.jboss.portal.core.modules.AbstractModule
JNDIName
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
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
UserModuleImpl()
           
 
Method Summary
 User createUser(java.lang.String name, java.lang.String password, java.lang.String realEmail)
          Creates a new user with the specified name.
 User findUserById(java.lang.Object id)
          Retrieve a user by its id.
 User findUserById(java.lang.String id)
          Retrieve a user by its id.
 User findUserByUserName(java.lang.String userName)
          Retrieve a user by its name.
 java.util.Set findUsers(int offset, int limit)
          Get a range of users.
 java.util.Set findUsersFilteredByUserName(java.lang.String filter, int offset, int limit)
          Get a range of users.
protected  org.hibernate.Session getCurrentSession()
          Can be subclasses to provide testing in a non JTA environement.
 HibernateProvider getHibernateProvider()
           
 PreferencesGroup getPreferencesGroup(User user)
          Return the preferences group for the specified user.
 int getUserCount()
          Returns the number of users.
 void removeUser(java.lang.Object id)
          Remove a user.
 void setHibernateProvider(HibernateProvider hibernateProvider)
           
protected  void startService()
           
 void stopService()
           
 
Methods inherited from class org.jboss.portal.core.modules.AbstractModule
getJNDIName, setJNDIName
 
Methods inherited from class org.jboss.portal.common.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

hibernateProvider

protected HibernateProvider hibernateProvider
.


sessionFactory

protected org.hibernate.SessionFactory sessionFactory
.

Constructor Detail

UserModuleImpl

public UserModuleImpl()
Method Detail

startService

protected void startService()
                     throws java.lang.Exception
Overrides:
startService in class AbstractModule
Throws:
java.lang.Exception

stopService

public void stopService()
                 throws java.lang.Exception
Overrides:
stopService in class AbstractModule
Throws:
java.lang.Exception

getHibernateProvider

public HibernateProvider getHibernateProvider()

setHibernateProvider

public void setHibernateProvider(HibernateProvider hibernateProvider)

findUserByUserName

public User findUserByUserName(java.lang.String userName)
                        throws ModuleException
Description copied from interface: UserModule
Retrieve a user by its name.

Specified by:
findUserByUserName in interface UserModule
Parameters:
userName - the user name
Returns:
the user
Throws:
ModuleException

findUserById

public User findUserById(java.lang.String id)
                  throws java.lang.IllegalArgumentException,
                         ModuleException,
                         NoSuchUserException
Description copied from interface: UserModule
Retrieve a user by its id.

Specified by:
findUserById in interface UserModule
Parameters:
id - the user id
Returns:
the user
Throws:
java.lang.IllegalArgumentException - if the id is null or not in the good format
ModuleException
NoSuchUserException

findUserById

public User findUserById(java.lang.Object id)
                  throws java.lang.IllegalArgumentException,
                         ModuleException,
                         NoSuchUserException
Description copied from interface: UserModule
Retrieve a user by its id.

Specified by:
findUserById in interface UserModule
Parameters:
id - the user id
Returns:
the user
Throws:
java.lang.IllegalArgumentException - if the id is null
ModuleException
NoSuchUserException

createUser

public User createUser(java.lang.String name,
                       java.lang.String password,
                       java.lang.String realEmail)
                throws ModuleException
Description copied from interface: UserModule
Creates a new user with the specified name.

Specified by:
createUser in interface UserModule
Parameters:
name - the user name
Returns:
the user
Throws:
ModuleException

removeUser

public void removeUser(java.lang.Object id)
                throws ModuleException
Description copied from interface: UserModule
Remove a user.

Specified by:
removeUser in interface UserModule
Parameters:
id - the user id
Throws:
ModuleException

findUsers

public java.util.Set findUsers(int offset,
                               int limit)
                        throws ModuleException
Description copied from interface: UserModule
Get a range of users.

Specified by:
findUsers in interface UserModule
Parameters:
offset - the offset of the first result to retrieve
limit - the maximum number of users to retrieve
Returns:
the user set
Throws:
ModuleException

findUsersFilteredByUserName

public java.util.Set findUsersFilteredByUserName(java.lang.String filter,
                                                 int offset,
                                                 int limit)
                                          throws ModuleException
Description copied from interface: UserModule
Get a range of users.

Specified by:
findUsersFilteredByUserName in interface UserModule
Parameters:
filter - a string filter applied to the user name.
offset - the offset of the frist result to retrieve
limit - the maximum number of users to retrieve
Returns:
the user set
Throws:
ModuleException

getUserCount

public int getUserCount()
                 throws ModuleException
Description copied from interface: UserModule
Returns the number of users.

Specified by:
getUserCount in interface UserModule
Returns:
the number of users
Throws:
ModuleException

getPreferencesGroup

public PreferencesGroup getPreferencesGroup(User user)
Description copied from interface: UserModule
Return the preferences group for the specified user.

Specified by:
getPreferencesGroup in interface UserModule

getCurrentSession

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