com.ibm.commerce.me.commands
Class AuthenticationHelperCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.TaskCommandImpl
-
- com.ibm.commerce.me.commands.AuthenticationHelperCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, AuthenticationHelperCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class AuthenticationHelperCmdImpl extends TaskCommandImpl implements AuthenticationHelperCmd
This command is invoked by the Business Direct commands to authenticate a Business Direct buyer. Before invoking this command the caller has to set the following parameters.
setLogonMode setBuyerCredentials setMarketPlaceBuyerCredentials setSupplierCredentilas setUpdateFlag
After this command is executed, the following methods can be invoked to get the results of command execution.
isValidCredentials getErrorCode getBuyerId getSupplierId
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
IBM copyright notice field.-
Fields inherited from interface com.ibm.commerce.me.commands.AuthenticationHelperCmd
defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description AuthenticationHelperCmdImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
getAuthType()
This method gets the authentication type.Credentials
getBuyerCredentials()
This method gets the buyer credential information that stores the buyer organization code, code type, user ID, and password.long
getBuyerId()
If the isValidCredentials() returns true (if the command succeeds) then this method can be called to get the buyer organization ID.int
getErrorCode()
If the isValidCredentials() returns false (if authentication fails) then this method can be called to get the error code.SessionInfo
getSessionInfo()
This method returns the registered requisitioner ID.Credentials
getSupplierCredentials()
This method gets the supplier credential information which stores the supplier organizations code, code type, user ID and password.long
getSupplierId()
If the isValidCredentials() returns true (if the command succeeds) then this method can be called to get the supplier organization ID.boolean
isValidCredentials()
After the task commands execute, a boolean result flag is set to indicate if authentication succeeds.void
performExecute()
The business logic for this task command.void
setAuthType(int anAuthType)
This method sets the authentication type.void
setBuyerCredentials(Credentials buyerCredentials)
This method sets the buyer credentials under which the current B2B user wishes to logon.void
setLogonMode(short logonMode)
This method sets the logon mode.void
setMarketPlaceBuyerCredentials(Credentials mpBuyerCredentials)
Use this method if the buyer comes from a marketplace and wants to be authenticated against the marketplace credentials.void
setProtocolId(java.lang.Integer aProtocolId)
This method sets the protocol ID.void
setSessionInfo(SessionInfo sessionInfo)
This method sets information pertaining to requisitioner registration.void
setSupplierCredentials(Credentials supplierCredentials)
This method sets the supplier credentials for the store that the buyer wants to connect to.void
setUpdateFlag()
This method indicates that the credentials should be set in the database, instead of performing verification on the credentials.void
validateParameters()
This method checks whether all the required parameters are available for authentication.-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
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
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
IBM copyright notice field.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAuthType
public int getAuthType()
This method gets the authentication type.- Returns:
- the authentication type
-
getBuyerCredentials
public Credentials getBuyerCredentials()
This method gets the buyer credential information that stores the buyer organization code, code type, user ID, and password.- Specified by:
getBuyerCredentials
in interfaceAuthenticationHelperCmd
- Returns:
- the buyer credential information
-
getBuyerId
public long getBuyerId()
If the isValidCredentials() returns true (if the command succeeds) then this method can be called to get the buyer organization ID.- Specified by:
getBuyerId
in interfaceAuthenticationHelperCmd
- Returns:
- the ID of the buyer organization.
-
getErrorCode
public int getErrorCode()
If the isValidCredentials() returns false (if authentication fails) then this method can be called to get the error code. This is required as the B2B scenario needs to know the exact reason for authentication failure.- Specified by:
getErrorCode
in interfaceAuthenticationHelperCmd
- Returns:
- a code indicating the error status
-
getSessionInfo
public SessionInfo getSessionInfo()
This method returns the registered requisitioner ID.- Specified by:
getSessionInfo
in interfaceAuthenticationHelperCmd
- Returns:
- long userId public long getUsersId() { return this.userId; } /** This method retrieves information pertaining to requisitioner registration.
- See Also:
com.ibm.commerce.me.datatype
-
getSupplierCredentials
public Credentials getSupplierCredentials()
This method gets the supplier credential information which stores the supplier organizations code, code type, user ID and password.- Specified by:
getSupplierCredentials
in interfaceAuthenticationHelperCmd
- Returns:
- the supplier credential information
-
getSupplierId
public long getSupplierId()
If the isValidCredentials() returns true (if the command succeeds) then this method can be called to get the supplier organization ID.- Specified by:
getSupplierId
in interfaceAuthenticationHelperCmd
- Returns:
- the ID of the supplier organization.
-
isValidCredentials
public boolean isValidCredentials()
After the task commands execute, a boolean result flag is set to indicate if authentication succeeds. This method returns the result flag to indicate if the authentication succeeds.- Specified by:
isValidCredentials
in interfaceAuthenticationHelperCmd
- Returns:
- true if authentication succeeds, otherwise false
-
performExecute
public void performExecute() throws ECException
The business logic for this task command. To see the details of the logic see the comments for the class.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
- is raised ifcheckCredentails()
catches any exceptions.
-
setAuthType
public void setAuthType(int anAuthType)
This method sets the authentication type.- Specified by:
setAuthType
in interfaceAuthenticationHelperCmd
- Parameters:
the
- authentication type
-
setBuyerCredentials
public void setBuyerCredentials(Credentials buyerCredentials)
This method sets the buyer credentials under which the current B2B user wishes to logon.- Specified by:
setBuyerCredentials
in interfaceAuthenticationHelperCmd
- Parameters:
buyerCredentials
- the buyer credentials
-
setLogonMode
public void setLogonMode(short logonMode)
This method sets the logon mode.- Specified by:
setLogonMode
in interfaceAuthenticationHelperCmd
- Parameters:
logonMode
- the new logon mode
-
setMarketPlaceBuyerCredentials
public void setMarketPlaceBuyerCredentials(Credentials mpBuyerCredentials)
Use this method if the buyer comes from a marketplace and wants to be authenticated against the marketplace credentials. This method will set the marketplace buyer credentials under which the current B2B user wishes to logon.- Specified by:
setMarketPlaceBuyerCredentials
in interfaceAuthenticationHelperCmd
- Parameters:
mpBuyerCredentials
- the marketplace buyer credentials
-
setProtocolId
public void setProtocolId(java.lang.Integer aProtocolId)
This method sets the protocol ID.- Specified by:
setProtocolId
in interfaceAuthenticationHelperCmd
- Parameters:
aProtocolId
- the protocol ID
-
setSessionInfo
public void setSessionInfo(SessionInfo sessionInfo)
This method sets information pertaining to requisitioner registration.- Specified by:
setSessionInfo
in interfaceAuthenticationHelperCmd
- Parameters:
sessionInfo
- the session information pertaining to requisitioner registration- See Also:
com.ibm.commerce.me.datatype
-
setSupplierCredentials
public void setSupplierCredentials(Credentials supplierCredentials)
This method sets the supplier credentials for the store that the buyer wants to connect to.- Specified by:
setSupplierCredentials
in interfaceAuthenticationHelperCmd
- Parameters:
supplierCredentials
- the supplier credential
-
setUpdateFlag
public void setUpdateFlag()
This method indicates that the credentials should be set in the database, instead of performing verification on the credentials.- Specified by:
setUpdateFlag
in interfaceAuthenticationHelperCmd
-
validateParameters
public void validateParameters() throws ECException
This method checks whether all the required parameters are available for authentication. To view the parameters required for each authentication level refer to the comments for the class. The checking includes: 1. buyer credential is not null and contains non empty code and code domain- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
- is raised with message _ERR_PROCUREMENT_INVALID_CREDENTIAL if the check for buyer credential fails
-
-