public class DBProcurementAuthenticationCmdImpl extends TaskCommandImpl implements DBProcurementAuthenticationCmd
A requisitioner is a user of a Business-to-Business buyer organization. Upon requisitioner logon via the supplier system, this task command will perform either an authentication or an update. This task command runs only if the server is configured to authenticate against the database.
Before executing this task command the following set operations should be performed:
If the setUpdateFlag method is called, upon execution of this task command, the credentials set are updated in the database.
If the setUpdateFlag method is not called, 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().
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright field
|
defaultCommandClassName, NAME
Constructor and Description |
---|
DBProcurementAuthenticationCmdImpl()
DBAuthenticationCmdImpl default constructor
|
Modifier and Type | Method and Description |
---|---|
long |
getBuyerId()
If
isValidCredentials() returns true (the command is successful),
this method can be called to get the buyer organization ID. |
int |
getErrorCode()
If
isValidCredentials() returns false (the command fails),
this method can be called to get the error code. |
long |
getSupplierId()
If
isValidCredentials() returns true (the command is successful),
this method can be called to get the supplier organization ID. |
boolean |
isValidCredentials()
After this task command is executed, a boolean result flag is
set to indicate if authentication succeeds.
|
void |
performExecute()
This method contains the business logic for this task command.
|
void |
setAuthenticationType(int authenticationType)
This method sets the authentication level for this user.
|
void |
setBuyerCredentials(Credentials buyerCredentials)
This method sets the buyer credentials under which the current
B2B user wishes to logon.
|
void |
setMarketPlaceBuyerCredentials(Credentials mpBuyerCredentials)
Use this method if the buyer comes from a marketplace and wants to be authenticated
against the marketplace credentials.
|
void |
setMerchantKey(java.lang.String aMerchantKey)
This method sets the Merchant Key to use in the encryption of
the password.
|
void |
setSupplierCredentilas(Credentials supplierCredentials)
This method sets the supplier credentials for the store to which
the buyer wants to connect.
|
void |
setUpdateFlag()
This method is called to indicate that the credentials should be set in the
database, instead of performing verification of the credentials.
|
void |
validateParameters()
This method checks whether all the required parameters are available for authentication.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
public static final java.lang.String COPYRIGHT
public DBProcurementAuthenticationCmdImpl()
public long getBuyerId()
isValidCredentials()
returns true (the command is successful),
this method can be called to get the buyer organization ID.getBuyerId
in interface DBProcurementAuthenticationCmd
public int getErrorCode()
isValidCredentials()
returns false (the command fails),
this method can be called to get the error code. This is required
because the B2B scenario needs to know the exact reason
for authentication failure.getErrorCode
in interface DBProcurementAuthenticationCmd
public long getSupplierId()
isValidCredentials()
returns true (the command is successful),
this method can be called to get the supplier organization ID.getSupplierId
in interface DBProcurementAuthenticationCmd
public boolean isValidCredentials()
isValidCredentials
in interface DBProcurementAuthenticationCmd
public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
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)
B2BLogonCmd
for
details regarding the credentials the buyer and supplier are validated against.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 aMerchantKey)
setMerchantKey
in interface DBProcurementAuthenticationCmd
aMerchantKey
- the Merchant Key.public void setSupplierCredentilas(Credentials supplierCredentials)
setSupplierCredentilas
in interface DBProcurementAuthenticationCmd
supplierCredentials
- the supplier credentials for
the store to which the buyer wants 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 or supplier credential are null or empty.ECException