com.ibm.commerce.me.commands
Class CreateShippingBillingAddressCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.me.commands.CreateShippingBillingAddressCmdImpl
All Implemented Interfaces:
CreateShippingBillingAddressCmd, ECCommand, ECTargetableCommand, TaskCommand

public class CreateShippingBillingAddressCmdImpl
extends TaskCommandImpl
implements CreateShippingBillingAddressCmd

This command creates a shipping or billing address based on the memberId provided. This is called by BatchOrderRequestCmd during batch processing of a new order. 1. validateParameters checks whether the addressType equals to "S" or "B" and set checkParametersOk to true 2. performExecute returns with INVALID_ADDRESS_TYPE if checkParameters is not true 3. performExecute retrieves from the ADDRESS table based on the member_id and user name in the Address (billTo/shipTo) class. This is done using ejb AddressAccessBean. 4. If no matching entry is found, the task command creates a new one based on the information.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.me.commands. CreateShippingBillingAddressCmd
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
CreateShippingBillingAddressCmdImpl()
          ShipBillToAddressCmdImpl default constructor
 
Method Summary
 java.lang.Long getAddressId()
          Gets AddressId
 int getErrorCode()
          Gets the errorCode
 void performExecute()
          The business logic for this task command.
 void setAddressId(java.lang.Long addressId)
          Sets Address Id
 void setAddressType(java.lang.String addressType)
          Sets Address Type to either shipping or billing
 void setBillToAddress( Address billToAddress)
          Updates local variable sbToAddress (Please note that this set method updates the same variable as setShipToAddress)
 void setMemberId(java.lang.Long memberId)
          Sets member Id
 void setShipToAddress( Address shipToAddress)
          Updates local variable sbToAddress (Please note that this set method updates the same variable as setBillToAddress)
 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

CreateShippingBillingAddressCmdImpl

public CreateShippingBillingAddressCmdImpl()
ShipBillToAddressCmdImpl default constructor
Method Detail

getAddressId

public java.lang.Long getAddressId()
Gets AddressId
Specified by:
getAddressId in interface CreateShippingBillingAddressCmd
Returns:
the address Id for the new address

getErrorCode

public int getErrorCode()
Gets the errorCode
Specified by:
getErrorCode in interface CreateShippingBillingAddressCmd
Returns:
a code indicating the execution result of this command

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 interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - Raised with message _ERR_GENERIC, _ERR_REMOTE_EXCEPTION if AddressAccessBean or AddressBookAccessBean raised any ejb related exceptions

setAddressId

public void setAddressId(java.lang.Long addressId)
Sets Address Id
Parameters:
addressId - Id identifing a unique address

setAddressType

public void setAddressType(java.lang.String addressType)
Sets Address Type to either shipping or billing
Specified by:
setAddressType in interface CreateShippingBillingAddressCmd
Parameters:
addressType - code indicates the type of address "S" represents a shipping address "B" represents a billing address

setBillToAddress

public void setBillToAddress(Address billToAddress)
Updates local variable sbToAddress (Please note that this set method updates the same variable as setShipToAddress)
Specified by:
setBillToAddress in interface CreateShippingBillingAddressCmd
Parameters:
billToAddress - The new billing address

setMemberId

public void setMemberId(java.lang.Long memberId)
Sets member Id
Specified by:
setMemberId in interface CreateShippingBillingAddressCmd
Parameters:
memberId - Id used to identifying the organization

setShipToAddress

public void setShipToAddress(Address shipToAddress)
Updates local variable sbToAddress (Please note that this set method updates the same variable as setBillToAddress)
Specified by:
setShipToAddress in interface CreateShippingBillingAddressCmd
Parameters:
shipToAddress - The new shipping address

validateParameters

public void validateParameters()
                        throws ECException
Check whether all the required parameters are available authentication. To see which all parameters are required for each authentication level see the comment for the class. This method checks whether the addressType equals to "S" or "B", and sets checkParametersOk to true.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException