Class AbstractUserWorkflowAdapter
- java.lang.Object
-
- org.apache.syncope.core.workflow.java.AbstractWorkflowAdapter
-
- org.apache.syncope.core.workflow.java.AbstractUserWorkflowAdapter
-
- All Implemented Interfaces:
UserWorkflowAdapter
,WorkflowAdapter
- Direct Known Subclasses:
DefaultUserWorkflowAdapter
,FlowableUserWorkflowAdapter
@Transactional(propagation=REQUIRES_NEW, rollbackFor=java.lang.Throwable.class) public abstract class AbstractUserWorkflowAdapter extends AbstractWorkflowAdapter implements UserWorkflowAdapter
-
-
Field Summary
Fields Modifier and Type Field Description protected UserDataBinder
dataBinder
protected EntityFactory
entityFactory
protected static Logger
LOG
protected Map<String,AccountRule>
perContextAccountRules
protected Map<String,PasswordRule>
perContextPasswordRules
protected RealmDAO
realmDAO
protected SecurityProperties
securityProperties
protected UserDAO
userDAO
-
Constructor Summary
Constructors Constructor Description AbstractUserWorkflowAdapter(UserDataBinder dataBinder, UserDAO userDAO, RealmDAO realmDAO, EntityFactory entityFactory, SecurityProperties securityProperties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description UserWorkflowResult<String>
activate(String key, String token, String updater, String context)
Activate an user.UserWorkflowResult<Pair<UserUR,Boolean>>
confirmPasswordReset(String key, String token, String password, String updater, String context)
Confirm password reset for an user.UserWorkflowResult<Pair<String,Boolean>>
create(UserCR userCR, boolean disablePwdPolicyCheck, Boolean enabled, String creator, String context)
Create an user, optionally disabling password policy check.UserWorkflowResult<Pair<String,Boolean>>
create(UserCR userCR, String creator, String context)
Create an user.void
delete(String userKey, String eraser, String context)
Delete an user.protected abstract UserWorkflowResult<String>
doActivate(User user, String token, String updater, String context)
protected abstract UserWorkflowResult<Pair<UserUR,Boolean>>
doConfirmPasswordReset(User user, String token, String password, String updater, String context)
protected abstract UserWorkflowResult<Pair<String,Boolean>>
doCreate(UserCR userCR, boolean disablePwdPolicyCheck, Boolean enabled, String creator, String context)
protected abstract void
doDelete(User user, String eraser, String context)
protected abstract UserWorkflowResult<String>
doReactivate(User user, String updater, String context)
protected abstract void
doRequestPasswordReset(User user, String updater, String context)
protected abstract UserWorkflowResult<String>
doSuspend(User user, String updater, String context)
protected abstract UserWorkflowResult<Pair<UserUR,Boolean>>
doUpdate(User user, UserUR userUR, String updater, String context)
protected Pair<Boolean,Boolean>
enforcePolicies(User user, boolean disablePwdPolicyCheck, String clearPassword)
protected List<AccountPolicy>
getAccountPolicies(User user)
protected List<AccountRule>
getAccountRules(AccountPolicy policy)
protected List<PasswordPolicy>
getPasswordPolicies(User user)
protected List<PasswordRule>
getPasswordRules(PasswordPolicy policy)
String
getPrefix()
Pair<UserWorkflowResult<String>,Boolean>
internalSuspend(String key, String updater, String context)
Suspend an user (used by internal authentication process)UserWorkflowResult<String>
reactivate(String key, String updater, String context)
Reactivate an user.void
requestPasswordReset(String key, String updater, String context)
Request password reset for an user.UserWorkflowResult<String>
suspend(String key, String updater, String context)
Suspend an user.UserWorkflowResult<Pair<UserUR,Boolean>>
update(UserUR userUR, String updater, String context)
Update an user.-
Methods inherited from class org.apache.syncope.core.workflow.java.AbstractWorkflowAdapter
metadata
-
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
dataBinder
protected final UserDataBinder dataBinder
-
userDAO
protected final UserDAO userDAO
-
realmDAO
protected final RealmDAO realmDAO
-
entityFactory
protected final EntityFactory entityFactory
-
securityProperties
protected final SecurityProperties securityProperties
-
perContextAccountRules
protected final Map<String,AccountRule> perContextAccountRules
-
perContextPasswordRules
protected final Map<String,PasswordRule> perContextPasswordRules
-
-
Constructor Detail
-
AbstractUserWorkflowAdapter
public AbstractUserWorkflowAdapter(UserDataBinder dataBinder, UserDAO userDAO, RealmDAO realmDAO, EntityFactory entityFactory, SecurityProperties securityProperties)
-
-
Method Detail
-
getPrefix
public String getPrefix()
- Specified by:
getPrefix
in interfaceWorkflowAdapter
- Returns:
- any string that might be interpreted as 'prefix' (say table prefix in SQL environments)
-
getAccountPolicies
protected List<AccountPolicy> getAccountPolicies(User user)
-
getAccountRules
protected List<AccountRule> getAccountRules(AccountPolicy policy)
-
getPasswordPolicies
protected List<PasswordPolicy> getPasswordPolicies(User user)
-
getPasswordRules
protected List<PasswordRule> getPasswordRules(PasswordPolicy policy)
-
enforcePolicies
protected Pair<Boolean,Boolean> enforcePolicies(User user, boolean disablePwdPolicyCheck, String clearPassword)
-
create
public UserWorkflowResult<Pair<String,Boolean>> create(UserCR userCR, String creator, String context)
Description copied from interface:UserWorkflowAdapter
Create an user.- Specified by:
create
in interfaceUserWorkflowAdapter
- Parameters:
userCR
- user to be created and whether to propagate it as activecreator
- username that requested this operationcontext
- context information- Returns:
- user just created
-
doCreate
protected abstract UserWorkflowResult<Pair<String,Boolean>> doCreate(UserCR userCR, boolean disablePwdPolicyCheck, Boolean enabled, String creator, String context)
-
create
public UserWorkflowResult<Pair<String,Boolean>> create(UserCR userCR, boolean disablePwdPolicyCheck, Boolean enabled, String creator, String context)
Description copied from interface:UserWorkflowAdapter
Create an user, optionally disabling password policy check.- Specified by:
create
in interfaceUserWorkflowAdapter
- Parameters:
userCR
- user to be created and whether to propagate it as activedisablePwdPolicyCheck
- disable password policy check?enabled
- specify true/false to force active/supended statuscreator
- username that requested this operationcontext
- context information- Returns:
- user just created
-
doActivate
protected abstract UserWorkflowResult<String> doActivate(User user, String token, String updater, String context)
-
activate
public UserWorkflowResult<String> activate(String key, String token, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Activate an user.- Specified by:
activate
in interfaceUserWorkflowAdapter
- Parameters:
key
- user to be activatedtoken
- to be verified for activationupdater
- username that requested this operationcontext
- context information- Returns:
- user just updated
-
doUpdate
protected abstract UserWorkflowResult<Pair<UserUR,Boolean>> doUpdate(User user, UserUR userUR, String updater, String context)
-
update
public UserWorkflowResult<Pair<UserUR,Boolean>> update(UserUR userUR, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Update an user.- Specified by:
update
in interfaceUserWorkflowAdapter
- Parameters:
userUR
- modification set to be performedupdater
- username that requested this operationcontext
- context information- Returns:
- user just updated and propagations to be performed
-
doSuspend
protected abstract UserWorkflowResult<String> doSuspend(User user, String updater, String context)
-
suspend
public UserWorkflowResult<String> suspend(String key, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Suspend an user.- Specified by:
suspend
in interfaceUserWorkflowAdapter
- Parameters:
key
- to be suspendedupdater
- username that requested this operationcontext
- context information- Returns:
- user just suspended
-
internalSuspend
public Pair<UserWorkflowResult<String>,Boolean> internalSuspend(String key, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Suspend an user (used by internal authentication process)- Specified by:
internalSuspend
in interfaceUserWorkflowAdapter
- Parameters:
key
- to be suspendedupdater
- username that requested this operationcontext
- context information- Returns:
- user just suspended and information whether to propagate suspension
-
doReactivate
protected abstract UserWorkflowResult<String> doReactivate(User user, String updater, String context)
-
reactivate
public UserWorkflowResult<String> reactivate(String key, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Reactivate an user.- Specified by:
reactivate
in interfaceUserWorkflowAdapter
- Parameters:
key
- user to be reactivatedupdater
- username that requested this operationcontext
- context information- Returns:
- user just reactivated
-
doRequestPasswordReset
protected abstract void doRequestPasswordReset(User user, String updater, String context)
-
requestPasswordReset
public void requestPasswordReset(String key, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Request password reset for an user.- Specified by:
requestPasswordReset
in interfaceUserWorkflowAdapter
- Parameters:
key
- user requesting password resetupdater
- username that requested this operationcontext
- context information
-
doConfirmPasswordReset
protected abstract UserWorkflowResult<Pair<UserUR,Boolean>> doConfirmPasswordReset(User user, String token, String password, String updater, String context)
-
confirmPasswordReset
public UserWorkflowResult<Pair<UserUR,Boolean>> confirmPasswordReset(String key, String token, String password, String updater, String context)
Description copied from interface:UserWorkflowAdapter
Confirm password reset for an user.- Specified by:
confirmPasswordReset
in interfaceUserWorkflowAdapter
- Parameters:
key
- user confirming password resettoken
- security tokenpassword
- new password valueupdater
- username that requested this operationcontext
- context information- Returns:
- user just updated and propagations to be performed
-
delete
public void delete(String userKey, String eraser, String context)
Description copied from interface:UserWorkflowAdapter
Delete an user.- Specified by:
delete
in interfaceUserWorkflowAdapter
- Parameters:
userKey
- user to be deletederaser
- username that requested this operationcontext
- context information
-
-