com.ibm.commerce.security.commands
Class LDAPAuthenticationCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.security.commands.LDAPAuthenticationCmdImpl
All Implemented Interfaces:
ECCommand, LDAPAuthenticationCmd, TaskCommand

public class LDAPAuthenticationCmdImpl
extends TaskCommandImpl
implements LDAPAuthenticationCmd

If server is configured to authenticate against LDAP then this task command will be called to perform either authentication or an update.

Before executing this task command the following sets should be performed:

 		setEnciphereMerchantKey or setMerchantKey
		setLogonId
		setPassword
 

If the setUpdateFlag is called then, then upon execution of this task command, the credentials set are updated in LDAP.

If the setUpdateFlag is not called then, upon execution of this task command, verification of the credentials is performed. To determine whether the authentication was successful a call should be make to isValidCredentials.


Field Summary
static java.lang.String ERRTASK_NAME
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.security.commands.LDAPAuthenticationCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
LDAPAuthenticationCmdImpl()
           
 
Method Summary
 java.lang.String getAuthenticateUserId()
          Retrieve the logon ID under which the current user wishes to logon.
protected  byte[] getEncryptPassword()
          Retrieve the password to be used for authentication with the new logon ID.
protected  java.lang.String getLogonId()
          Retrieve the Logon ID under which the current user wishes to logon.
protected  java.lang.String getPassword()
          Retrieve the password to be used for authentication with the new logon ID.
 TypedProperty getRequestProperties()
          Return the request properties
 boolean isLogonIdValid()
          Gets a boolean result flag will be set to indicate if the logon id supplied was correct.
 boolean isUpdatePending()
          Indicates whether the password should be verified against an existing one in the database or if the password should be updated in the database.
 boolean isValidCredentials()
          Gets a boolean flag indicating if the authentication was successful.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
protected  void setAuthenticateUserId(java.lang.String astrAuthenticateUserId)
          Retrieves the logon ID under which the current user wishes to logon.
 void setLogonId(java.lang.String strLogonId)
          Sets the logon ID under which the current user wishes to logon.
 void setPassword(java.lang.String strPassword)
          Sets the password to be used for authentication with the new logon ID.
 void setUpdateFlag()
          Indicates that instead of performing verification of the credentials, the credentials should be set on LDAP.
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

ERRTASK_NAME

public static final java.lang.String ERRTASK_NAME
Constructor Detail

LDAPAuthenticationCmdImpl

public LDAPAuthenticationCmdImpl()
Method Detail

getAuthenticateUserId

public java.lang.String getAuthenticateUserId()
Retrieve the logon ID under which the current user wishes to logon.
Specified by:
getAuthenticateUserId in interface LDAPAuthenticationCmd
Returns:
The logon ID.

getEncryptPassword

protected byte[] getEncryptPassword()
Retrieve the password to be used for authentication with the new logon ID.
Returns:
The Password.

getLogonId

protected java.lang.String getLogonId()
Retrieve the Logon ID under which the current user wishes to logon.
Returns:
The Logon ID.

getPassword

protected java.lang.String getPassword()
Retrieve the password to be used for authentication with the new logon ID.
Returns:
The Password.

getRequestProperties

public TypedProperty getRequestProperties()
                                   throws ECException
Return the request properties

isLogonIdValid

public boolean isLogonIdValid()
Gets a boolean result flag will be set to indicate if the logon id supplied was correct. This method will return the this result flag to indicate if the authentication was successful.
Specified by:
isLogonIdValid in interface LDAPAuthenticationCmd
Returns:
True if logon ID is valid.

isUpdatePending

public boolean isUpdatePending()
Indicates whether the password should be verified against an existing one in the database or if the password should be updated in the database.
Returns:
True if password should be updated in the database.

isValidCredentials

public boolean isValidCredentials()
Gets a boolean flag indicating if the authentication was successful. After the this command task is executed, a boolean result flag will be set to indicate if the authentication was successful. This method will return the this result flag to indicate if the authentication was successful.
Specified by:
isValidCredentials in interface LDAPAuthenticationCmd
Returns:
True if authentication was successful.

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setAuthenticateUserId

protected void setAuthenticateUserId(java.lang.String astrAuthenticateUserId)
Retrieves the logon ID under which the current user wishes to logon.
Returns:
The logon ID.

setLogonId

public void setLogonId(java.lang.String strLogonId)
Sets the logon ID under which the current user wishes to logon.
Specified by:
setLogonId in interface LDAPAuthenticationCmd
Parameters:
strLogonID - The login ID.

setPassword

public void setPassword(java.lang.String strPassword)
Sets the password to be used for authentication with the new logon ID.
Specified by:
setPassword in interface LDAPAuthenticationCmd
Parameters:
strPassword - The password.

setUpdateFlag

public void setUpdateFlag()
Indicates that instead of performing verification of the credentials, the credentials should be set on LDAP.
Specified by:
setUpdateFlag in interface LDAPAuthenticationCmd

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -