com.ibm.commerce.foundation.server.command.soi
Class MessageMappingCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl
-
- All Implemented Interfaces:
- BusinessObjectDocumentCmd, 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
- Direct Known Subclasses:
- AttachmentMessageMappingCmdImpl, ManagedDirectoryMessageMappingCmdImpl, OrderMessageMappingCmdImpl
public class MessageMappingCmdImpl extends com.ibm.websphere.command.CacheableCommandImpl implements BusinessObjectDocumentCmd
This business object document command leverages the messaging mapping feature to invoke an existing Name-Value pair WebSphere Commerce command and build the response object. The message mapping configuration controls the command to invoke and converts the business object document into a set of name value pairs to pass to the WebSphere Commerce NVP controller command. TheresponseCommand
orerrorCommand
found in the control parameters returned by the message mapping configuration points to the code to create the response message.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
BUSINESS_OBJECT_DOCUMENT_REQUEST_CONTROL_PARAMETERS
The property name used to place the request control parameters into the request properties.static java.lang.String
BUSINESS_OBJECT_DOCUMENT_REQUEST_OBJECT
The property name used to place the request business object document into the request properties.static java.lang.String
COMPONENT_SERVICES_MESSAGE_MAPPER
The Message Mapper Name for component services
-
Constructor Summary
Constructors Constructor and Description MessageMappingCmdImpl()
Creates an instance of the message mapping command to invoke classic commerce controller commands using the message mapping feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description BusinessObjectDocumentType
getResultBusinessObjectDocument()
This method returns the response business object document for the request.void
handleException(java.lang.Exception exception)
A final method that for internal use only in MessageMappingCmdImpl In order to add Exception Handling for SOI command, use "errorCommand" approach to define a command to generate the error response.boolean
isReadyToCallExecute()
This method always indicates the command is ready to execute.void
performExecute()
This method will execute the change command by callingvalidateAction
andperformAction
.void
setRequestBusinessObjectDocument(BusinessObjectDocumentType businessObjectDocument)
Sets the request business object document.-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
execute, executeFromCache, getCaller, getEntryInfo, getId, getObjectSize, getSharingPolicy, postExecute, preExecute, reset, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
-
-
-
Field Detail
-
COMPONENT_SERVICES_MESSAGE_MAPPER
public static final java.lang.String COMPONENT_SERVICES_MESSAGE_MAPPER
The Message Mapper Name for component services- See Also:
- Constant Field Values
-
BUSINESS_OBJECT_DOCUMENT_REQUEST_OBJECT
public static final java.lang.String BUSINESS_OBJECT_DOCUMENT_REQUEST_OBJECT
The property name used to place the request business object document into the request properties.- See Also:
- Constant Field Values
-
BUSINESS_OBJECT_DOCUMENT_REQUEST_CONTROL_PARAMETERS
public static final java.lang.String BUSINESS_OBJECT_DOCUMENT_REQUEST_CONTROL_PARAMETERS
The property name used to place the request control parameters into the request properties.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageMappingCmdImpl
public MessageMappingCmdImpl()
Creates an instance of the message mapping command to invoke classic commerce controller commands using the message mapping feature.
-
-
Method Detail
-
isReadyToCallExecute
public boolean isReadyToCallExecute()
This method always indicates the command is ready to execute.- Specified by:
isReadyToCallExecute
in interfacecom.ibm.websphere.command.Command
- Specified by:
isReadyToCallExecute
in classcom.ibm.websphere.command.TargetableCommandImpl
- Returns:
- Always true.
- See Also:
Command.isReadyToCallExecute()
-
performExecute
public final void performExecute() throws java.lang.Exception
This method will execute the change command by callingvalidateAction
andperformAction
. This method controls the steps required when executing the change verb.- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Specified by:
performExecute
in classcom.ibm.websphere.command.TargetableCommandImpl
- Throws:
java.lang.Exception
- Can occur if the validation of the business object document fails or a problem occur when performing the action.- See Also:
TargetableCommand.performExecute()
-
getResultBusinessObjectDocument
public BusinessObjectDocumentType getResultBusinessObjectDocument()
This method returns the response business object document for the request. The response business object document was generated by theresponseCommand
orerrorCommand
that is found in the message mapping configuration.- Specified by:
getResultBusinessObjectDocument
in interfaceBusinessObjectDocumentCmd
- Returns:
- The response business object document.
- See Also:
BusinessObjectDocumentCmd.getResultBusinessObjectDocument()
-
setRequestBusinessObjectDocument
public void setRequestBusinessObjectDocument(BusinessObjectDocumentType businessObjectDocument)
Sets the request business object document. This is the request that is converted into a set of name value pairs and determine the classic commerce controller command to execute.- Specified by:
setRequestBusinessObjectDocument
in interfaceBusinessObjectDocumentCmd
- Parameters:
businessObjectDocument
- The request business object document.- See Also:
BusinessObjectDocumentCmd.setRequestBusinessObjectDocument(com.ibm.commerce.oagis9.datatypes.BusinessObjectDocumentType)
-
handleException
public final void handleException(java.lang.Exception exception)
A final method that for internal use only in MessageMappingCmdImpl In order to add Exception Handling for SOI command, use "errorCommand" approach to define a command to generate the error response.- Specified by:
handleException
in interfaceBusinessObjectDocumentCmd
- Parameters:
exception
- The exception is being thrown
-
-