Class ITIMPasswordPolicyImpl
- java.lang.Object
-
- com.ibm.di.plugin.pwstore.itim.policy.impl.ITIMPasswordPolicyImpl
-
- All Implemented Interfaces:
PasswordPolicyService
public final class ITIMPasswordPolicyImpl extends java.lang.Object implements PasswordPolicyService
The class represents a facade that supports password policy validation check, and password synchronization against ITIM. Instances must be created using a PasswordPolicyFactory;ITIMPasswordPolicyFactoryImpl
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLastStatusMessage()
Get the status message returned from the previous invocation ofsynchronizePassword(String, List)
orvalidatePassword(String, List)
.void
initialize()
Perform and required post construction initialization.boolean
ready()
Ensure the password policy subsystem is available.void
setConnection(PolicyServiceConnection conn)
Set the connection.void
synchronizePassword(java.lang.String userName, java.util.List passwordValues)
Synchronize the password values via ITIM.void
terminate()
Perform and required cleanup in preparation for shutdown.boolean
validatePassword(java.lang.String userName, java.util.List passwordValues)
Check against ITIM that the password values conform to policy.
-
-
-
Method Detail
-
setConnection
public void setConnection(PolicyServiceConnection conn)
Set the connection.- Specified by:
setConnection
in interfacePasswordPolicyService
- Parameters:
conn
- - The connection.- Throws:
java.lang.IllegalArgumentException
- if conn isnull
.
-
ready
public boolean ready()
Ensure the password policy subsystem is available. Check that communication with ITIM is working. If used, this method should be called before validatePassword(List).- Specified by:
ready
in interfacePasswordPolicyService
- Returns:
- true if policy subsystem is ready.
- Throws:
java.lang.IllegalStateException
- ofgetItimPrincipalName()
orgetItimPrincipalPassword()
equalnull
.
-
validatePassword
public boolean validatePassword(java.lang.String userName, java.util.List passwordValues) throws PolicyConnectionException, MalformedResponseException
Check against ITIM that the password values conform to policy.- Specified by:
validatePassword
in interfacePasswordPolicyService
- Parameters:
userName
- - The user name, e.g. jdoe or eruid=jdoepasswordValues
- - List of associated password values to be checked. List must have length > 0- Returns:
- true if all passwords conform to policy.
- Throws:
PolicyConnectionException
- if connection to policy service is lost.MalformedResponseException
- if a policy service response cannot be parsed.java.lang.IllegalArgumentException
- if passwordValues.length() <= 0.java.lang.IllegalStateException
- ofgetItimPrincipalName()
orgetItimPrincipalPassword()
equalnull
.
-
synchronizePassword
public void synchronizePassword(java.lang.String userName, java.util.List passwordValues) throws PolicyConnectionException, MalformedResponseException, PasswordSynchException
Synchronize the password values via ITIM.- Specified by:
synchronizePassword
in interfacePasswordPolicyService
- Parameters:
userName
- - The user name whose password values will be synchronized.passwordValues
- - List of associated password values to be checked. List must have length > 0- Throws:
PolicyConnectionException
- if connection to policy service is lost.MalformedResponseException
- if a policy service response cannot be parsed.PasswordSynchException
- if any single password value cannot be synchronized, e.g. connection failure.java.lang.IllegalArgumentException
- if passwordValues.length() <= 0, or either parameter reference is null..java.lang.IllegalStateException
- ofgetItimPrincipalName()
orgetItimPrincipalPassword()
equalnull
.
-
initialize
public void initialize() throws PolicyInitializationException
Perform and required post construction initialization. For example, establish network connections.- Specified by:
initialize
in interfacePasswordPolicyService
- Throws:
PolicyInitializationException
-
terminate
public void terminate()
Perform and required cleanup in preparation for shutdown.- Specified by:
terminate
in interfacePasswordPolicyService
-
getLastStatusMessage
public java.lang.String getLastStatusMessage()
Get the status message returned from the previous invocation ofsynchronizePassword(String, List)
orvalidatePassword(String, List)
.- Specified by:
getLastStatusMessage
in interfacePasswordPolicyService
- Returns:
- The status message from the service, or
null
if no status was returned.
-
-