java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.me.commands.DBProcurementAuthenticationCmdImpl
When a requisitioner (a user of the B2B buyer org) logs on to the supplier system, if server is configured to authenticate against the databse then this task command will be called to perform either authentication or an update.
Before executing this task command the following set ops should be performed:
setAuthenticationLevel setBuyerCredentials setMarketPlaceBuyerCredentials setSupplierCredentilas setUpdateFlag
If the setUpdateFlag is called then, then upon execution of this task command, the credentials set are updated in the database.
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 made to isValidCredentials().
Field Summary |
---|
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.me.commands. DBProcurementAuthenticationCmd |
COPYRIGHT,
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECTargetableCommand |
COPYRIGHT |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
DBProcurementAuthenticationCmdImpl() DBAuthenticationCmdImpl default constructor |
Method Summary | |
---|---|
protected
byte[] |
formatPassword(byte[] bytePassword) Padds the password to it's maximum lenght with the OS padding char |
long |
getBuyerId() If the isValidCredentilas() returns true (ie. |
int |
getErrorCode() If the isValidCredentilas() returns false (ie. |
long |
getSupplierId() If the isValidCredentilas() returns true (ie. |
boolean |
isValidCredentials() After the this task command is executed, a boolean result flag will be set to indicate if the authentication was successful. |
void |
performExecute() The business logic for this task command. |
void |
setAuthenticationType(int authenticationType) Sets the authentication level (See B2BLogonCmd for details about against which credentials the buyer and supplier are validated.) |
void |
setBuyerCredentials(
Credentials buyerCredentials) Sets the buyer credentials under which the current B2B user wishes to logon. |
void |
setMarketPlaceBuyerCredentials(
Credentials mpBuyerCredentials) In case the buyer comes from a marketplace and wants to be authenticated against the marketplace credentials, use this method. |
void |
setMerchantKey(java.lang.String merchantKey) Sets the Merchant Key to be used in the encryption of the password. |
void |
setSupplierCredentilas(
Credentials supplierCredentials) Sets the supplier credentials for the store to which the buyer want to connect. |
void |
setUpdateFlag() This method is called to indicate instead of performing verification of the credentials, the credentials should be set in the database. |
void |
validateParameters() Check whether all the required parameters are available authentication. |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
reset,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Constructor Detail |
---|
public DBProcurementAuthenticationCmdImpl()
Method Detail |
---|
protected byte[] formatPassword(byte[] bytePassword)
bytePassword
- The original passwordpublic long getBuyerId()
getBuyerId
in interface
DBProcurementAuthenticationCmd
public int getErrorCode()
getErrorCode
in interface
DBProcurementAuthenticationCmd
public long getSupplierId()
getSupplierId
in interface
DBProcurementAuthenticationCmd
public boolean isValidCredentials()
isValidCredentials
in interface
DBProcurementAuthenticationCmd
public void performExecute() throws ECException
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
- Raised with _ERR_FINDER_EXCEPTION, _ERR_CREATE_EXCEPTION,
_ERR_REMOTE_EXCEPTION, _ERR_NAMING_EXCEPTION if the ejb catches any
exceptionspublic void setAuthenticationType(int authenticationType)
setAuthenticationType
in interface
DBProcurementAuthenticationCmd
authenticationType
- The new authentication
typepublic void setBuyerCredentials(Credentials buyerCredentials)
setBuyerCredentials
in interface
DBProcurementAuthenticationCmd
buyerCredentials
- buyer credentials under which the current
B2B user wishes to logonpublic void setMarketPlaceBuyerCredentials(Credentials mpBuyerCredentials)
setMarketPlaceBuyerCredentials
in interface
DBProcurementAuthenticationCmd
mpBuyerCredentials
- the marketplace buyer credentials under
which the current B2B user wishes to logonpublic void setMerchantKey(java.lang.String merchantKey)
setMerchantKey
in interface
DBProcurementAuthenticationCmd
merchantKey
- the Merchant Key.public void setSupplierCredentilas(Credentials supplierCredentials)
setSupplierCredentilas
in interface
DBProcurementAuthenticationCmd
supplierCredentials
- the supplier credentials for the store
to which the buyer want to connectpublic void setUpdateFlag()
setUpdateFlag
in interface
DBProcurementAuthenticationCmd
public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException.
- Raised with messages
_ERR_PROCUREMENT_INVALID_BUYER_CREDENTIAL,
_ERR_PROCUREMENT_INVALID_SUPPLIER_CREDENTIAL if either buyer credential,
supplier credential are null or empty.ECException