com.mizar.persistence.jpa.security
Class UserManagementJPAFactory

java.lang.Object
  extended by com.mizar.persistence.jpa.facade.JPAFacade
      extended by com.mizar.persistence.jpa.security.UserManagementJPAFactory
Direct Known Subclasses:
UserManagementFacesFactory

public class UserManagementJPAFactory
extends JPAFacade


Field Summary
 
Fields inherited from class com.mizar.persistence.jpa.facade.JPAFacade
em, emf, model, persistenceUnitName, schemaName, sequencesValidated, silent, verbose
 
Constructor Summary
UserManagementJPAFactory(java.lang.String persistenceUnitName)
           
 
Method Summary
 UserBean addUser(java.lang.String username, java.lang.String password, java.lang.String emailAddress, java.lang.String initialRoleList)
           
 void changePassword(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword, java.lang.String newPassword2)
           
 void changePassword(UserBean callingUser, java.lang.String userName, java.lang.String newPassword, java.lang.String newPassword2)
          Throws an AccessException if called by anyone other than the Admin
 UserBean createAnonymousUser()
           
 GroupBean createGroup(java.lang.String name)
           
 PermissionBean createPermission(java.lang.String name)
           
 RoleBean createRole(java.lang.String name)
           
 UserBean createUser(java.lang.String username, java.lang.String password, java.lang.String emailAddress, java.lang.String initialRoleList)
           
 UserPropertiesNameBean createUserProperty(java.lang.String name)
           
 void deleteGroup(java.lang.String groupName)
           
 void deletePermission(java.lang.String permissionName)
           
 void deleteRole(java.lang.String roleName)
           
 void deleteUser(java.lang.String username)
           
static boolean exists(javax.persistence.EntityManager em, java.lang.Class beanClass, java.lang.String property, java.lang.Object value)
           
static java.lang.String generateRandomPassword()
           
 UserBean getUserBean(java.lang.String userName)
           
 UserBean updateUser(UserBean changedBean, boolean useEmailAsUserName)
           
 void updateViewSetting(UserBean callingUser, java.lang.String projectName, org.jdom.Element root)
           
 
Methods inherited from class com.mizar.persistence.jpa.facade.JPAFacade
closeEm, closeEm, closeEmf, executeDDL, executeNativeUpdate, executeNativeUpdate, executeUpdate, getClosableConnectionAccessor, getConnection, getConnection, getEm, getEm, getEmf, getEmf, getLogger, getPassword, getPassword, getPersistenceUnitName, getSchemaName, getSequencesValidated, getSid, getSilent, getTableName, getToleratedErrorCodes, getUrl, getUser, getVerbose, mergeBean, persist, persistBean, printAnyBean, queryTester, queryTester, refreshBean, remove, removeBean, removeBean, setEmf, setPersistenceUnitName, setSilent, setToleratedErrorCodes, setVerbose, validateSequences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagementJPAFactory

public UserManagementJPAFactory(java.lang.String persistenceUnitName)
Method Detail

addUser

public UserBean addUser(java.lang.String username,
                        java.lang.String password,
                        java.lang.String emailAddress,
                        java.lang.String initialRoleList)
                 throws UserExistsException,
                        AlreadyExistsException,
                        InvalidEmailException,
                        AccessException
Throws:
UserExistsException
AlreadyExistsException
InvalidEmailException
AccessException

createUser

public UserBean createUser(java.lang.String username,
                           java.lang.String password,
                           java.lang.String emailAddress,
                           java.lang.String initialRoleList)
                    throws UserExistsException,
                           AlreadyExistsException,
                           InvalidEmailException
Throws:
UserExistsException
AlreadyExistsException
InvalidEmailException

createAnonymousUser

public UserBean createAnonymousUser()
                             throws java.lang.Exception
Throws:
java.lang.Exception

createGroup

public GroupBean createGroup(java.lang.String name)
                      throws AlreadyExistsException,
                             java.lang.Exception
Throws:
AlreadyExistsException
java.lang.Exception

updateUser

public UserBean updateUser(UserBean changedBean,
                           boolean useEmailAsUserName)
                    throws java.lang.Exception
Throws:
java.lang.Exception

generateRandomPassword

public static java.lang.String generateRandomPassword()

getUserBean

public UserBean getUserBean(java.lang.String userName)
                     throws AccessException
Throws:
AccessException

changePassword

public void changePassword(UserBean callingUser,
                           java.lang.String userName,
                           java.lang.String newPassword,
                           java.lang.String newPassword2)
                    throws AccessException
Throws an AccessException if called by anyone other than the Admin

Parameters:
userName -
newPassword -
newPassword2 -
Throws:
AccessException

changePassword

public void changePassword(java.lang.String userName,
                           java.lang.String oldPassword,
                           java.lang.String newPassword,
                           java.lang.String newPassword2)
                    throws AccessException
Throws:
AccessException

updateViewSetting

public void updateViewSetting(UserBean callingUser,
                              java.lang.String projectName,
                              org.jdom.Element root)
                       throws AccessException
Throws:
AccessException

deleteUser

public void deleteUser(java.lang.String username)
                throws AccessException
Throws:
AccessException

deleteGroup

public void deleteGroup(java.lang.String groupName)
                 throws AccessException
Throws:
AccessException

exists

public static boolean exists(javax.persistence.EntityManager em,
                             java.lang.Class beanClass,
                             java.lang.String property,
                             java.lang.Object value)

createRole

public RoleBean createRole(java.lang.String name)
                    throws AlreadyExistsException,
                           java.lang.Exception
Throws:
AlreadyExistsException
java.lang.Exception

deleteRole

public void deleteRole(java.lang.String roleName)

createPermission

public PermissionBean createPermission(java.lang.String name)
                                throws AlreadyExistsException,
                                       java.lang.Exception
Throws:
AlreadyExistsException
java.lang.Exception

deletePermission

public void deletePermission(java.lang.String permissionName)

createUserProperty

public UserPropertiesNameBean createUserProperty(java.lang.String name)
                                          throws AlreadyExistsException,
                                                 java.lang.Exception
Throws:
AlreadyExistsException
java.lang.Exception