@PermitAll public class PersonManagementServiceBean extends PersonServiceBase implements PersonManagementServiceLocal, PersonManagementServiceRemote
PersonManagementService
using local database..ARGUMENT_PERSON_ID, ARGUMENT_SETTING_NAME
Constructor and Description |
---|
PersonManagementServiceBean()
Creates new instance.
|
PersonManagementServiceBean(RoleNameDao roleNameDao,
RoleDao roleDao,
PersonDao personDao,
SecurityRoleDao securityRoleDao,
SecurityManagerServiceLocal securityManager,
ComponentServiceLocal componentService)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
Person |
addPerson(Person person)
Adds new person into the application.
|
Person |
addPersonWithData(PersonData personData)
Adds new person into the application.
|
Person |
assignSecurityRolesToPerson(String personId,
List<String> securityRoleNames)
Assigns given list of security roles (specified by their names) to the user identified
by given
personId argument. |
RoleUnitNameList |
findRoles()
Returns a collection of all roles with all different combinations of parameters assigned to
persons.
|
Collection<PersonAttribute> |
getEditableAttributes()
Returns editable person attributes.
|
protected PersonDao |
getPersonDao()
Returns person service dao.
|
Collection<SecurityRole> |
getSecurityRoles(String personId)
Returns a collection of all the security roles currently assigned to the user identified by
given
personId or an empty collection if the user has no security roles assigned to
them. |
boolean |
isReadOnly()
Some implementations might not have write access to the system containing user information.
|
Person |
updatePerson(Person person)
Updates the person.
|
Person |
updatePersonLogin(String personId,
String newLogin)
Updates current login of the user identified by given
personId with the content
of newLogin argument. |
Person |
updatePersonPassword(String personId,
String newPassword)
Updates current password of the user identified by given
personId with the content
of newPassword argument. |
Person |
updatePersonWithData(PersonData personData)
Updates the person.
|
void |
validatePassword(String password)
Validates the given password candidate to the actual password policy.
|
checkActivePersonWithLoginExists, checkPersonWithIdExists, deleteSetting, findPersons, getPerson, getPersonByLogin, getPersonPicture, getPersonWithLogin, getSetting, hasPersonAnyRight, setPersonPicture, setSetting
getCurrentTransactionData, getOriginalPrincipal, getSecurityManagerService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkActivePersonWithLoginExists, deleteSetting, findPersons, getPerson, getPersonByLogin, getPersonPicture, getSetting, hasPersonAnyRight, setPersonPicture, setSetting
public PersonManagementServiceBean()
public PersonManagementServiceBean(RoleNameDao roleNameDao, RoleDao roleDao, PersonDao personDao, SecurityRoleDao securityRoleDao, SecurityManagerServiceLocal securityManager, ComponentServiceLocal componentService)
roleNameDao
- the role name daoroleDao
- the role daopersonDao
- the person daosecurityRoleDao
- securityManager
- the security managercomponentService
- the component serviceNullPointerException
- if any of the parameters is nullprotected PersonDao getPersonDao()
PersonServiceBase
getPersonDao
in class PersonServiceBase
@RightsAllowed(value="Person:Manage") public Person addPerson(Person person) throws PersonAlreadyExistsException, PersonNotFoundException, RoleNotFoundException
PersonManagementService
addPerson
in interface PersonManagementService
person
- person to be addedPersonAlreadyExistsException
- if the person
already exists in the applicationPersonNotFoundException
- if the person
contains substitutes that do not existRoleNotFoundException
- if the person
contains roles that do not exist@RightsAllowed(value="Person:Manage") public Person updatePersonLogin(String personId, String newLogin) throws PersonNotFoundException
PersonManagementService
personId
with the content
of newLogin
argument.
Note: The result of this method call has an effect only if the "LSPS login modules" are used for user authentication. In other cases (different JAAS-compliant LoginModule used), the calling this method has no effect for JAAS authentication process.
updatePersonLogin
in interface PersonManagementService
personId
- The id of the user. Cannot be blank.newLogin
- The new login to be set for the user identified by given personId
.
Cannot be blank.PersonNotFoundException
- if the user identified by their personId
does not exist in the
application.@PermitAll @RightsAllowed(value={"Person:Manage","Person:Change_Own_Password"}) public Person updatePersonPassword(String personId, String newPassword) throws PersonNotFoundException, InvalidPasswordException
PersonManagementService
personId
with the content
of newPassword
argument.
Note: The result of this method call has an effect only if the "LSPS login modules" are used for user authentication. In other cases (different JAAS-compliant LoginModule used), the calling this method has no effect for JAAS authentication process.
updatePersonPassword
in interface PersonManagementService
personId
- The id of the user. Cannot be blank.newPassword
- The new password to be set for the user identified by given personId
.
Cannot be blank.PersonNotFoundException
- if the user identified by their personId
does not exist in the
application.InvalidPasswordException
- if the password value does not meet the password value constraints@PermitAll @RightsAllowed(value={"Person:Manage","Person:Change_Own_Password"}) public void validatePassword(String password) throws InvalidPasswordException
PersonManagementService
validatePassword
in interface PersonManagementService
password
- the password candidate to be validatedInvalidPasswordException
- if the password candidate does not conform to the current
password policypublic Person updatePerson(Person person) throws PersonNotFoundException, PersonStaleException, RoleNotFoundException
PersonManagementService
Person.getDirectSubstitutes()
attribute. No persons in substitutions are updated.updatePerson
in interface PersonManagementService
person
- person to be updatedPersonNotFoundException
- if the person
contains substitutes that do not existPersonStaleException
- if the person
object is stale (this applies only if the version is not
null)RoleNotFoundException
- if the person
contains roles that do not exist@RightsAllowed(value="Person:Read") public RoleUnitNameList findRoles()
PersonManagementService
findRoles
in interface PersonManagementService
@RightsAllowed(value="Person:Manage") public Person assignSecurityRolesToPerson(String personId, List<String> securityRoleNames) throws PersonNotFoundException, SecurityRoleNotFoundException
PersonManagementService
personId
argument. All the security roles currently assigned to the user
will be replaced by new collection of security roles (given as the securityRoleNames
argument).assignSecurityRolesToPerson
in interface PersonManagementService
personId
- The id of the user. Cannot be blank.securityRoleNames
- The list of names of security roles to assign to given user. Cannot be
null
.PersonNotFoundException
- if the user with personId
is not foundSecurityRoleNotFoundException
- if any of the securityRoleNames
is not found@RightsAllowed(value="Person:Read") public Collection<SecurityRole> getSecurityRoles(String personId) throws PersonNotFoundException
PersonManagementService
personId
or an empty collection if the user has no security roles assigned to
them.getSecurityRoles
in interface PersonManagementService
personId
- The id name of the user.personId
.PersonNotFoundException
- if the user with personId
is not found in applicationpublic boolean isReadOnly()
PersonManagementService
isReadOnly
in interface PersonManagementService
public Collection<PersonAttribute> getEditableAttributes()
PersonManagementService
getEditableAttributes
in interface PersonManagementService
@RightsAllowed(value={"Person:Manage","Person:Change_Own_Password"}) public Person addPersonWithData(PersonData personData) throws PersonAlreadyExistsException, PersonNotFoundException, RoleNotFoundException, InvalidPasswordException, SecurityRoleNotFoundException
PersonManagementService
null
then the password is set. If the provided
security roles in the person data are not null
then security
roles are set.addPersonWithData
in interface PersonManagementService
personData
- data representing a person to be addedPersonAlreadyExistsException
- if the person
already exists in the applicationPersonNotFoundException
- if the person
contains substitutes that do not existRoleNotFoundException
- if the person
contains roles that do not existInvalidPasswordException
- if the password value does not meet the password value constraintsSecurityRoleNotFoundException
- if any of the security role names is not found@RightsAllowed(value={"Person:Manage","Person:Change_Own_Password"}) public Person updatePersonWithData(PersonData personData) throws PersonNotFoundException, PersonStaleException, RoleNotFoundException, InvalidPasswordException, SecurityRoleNotFoundException
PersonManagementService
Person.getDirectSubstitutes()
attribute. No persons in substitutions are updated.
If a non-null
password value is provided then the person's
password is updated. If security role names are provided then the
person's old security roles are replaced by the new ones.updatePersonWithData
in interface PersonManagementService
personData
- a data representing a person to be updatedPersonNotFoundException
- if the person contains substitutes that do not existPersonStaleException
- if the person object is stale (this applies only if the version is not
null)RoleNotFoundException
- if the person contains roles that do not existInvalidPasswordException
- if the password value does not meet the password value constraintsSecurityRoleNotFoundException
- if any of the security role names is not foundCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.