atg.commerce.fulfillment
Class ElectronicFulfiller

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.messaging.SourceSinkTemplate
              extended by atg.commerce.fulfillment.FulfillerSystem
                  extended by atg.commerce.fulfillment.ElectronicFulfiller
All Implemented Interfaces:
MessageSink, MessageSource, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ElectronicFulfiller
extends FulfillerSystem

This fulfiller is used to fulfill shipping groups that contain electronic goods. In the out of the box implementation this means gift certificates. The two messages that are supported are

See Also:
FulfillOrderFragment, ModifyOrder, ModifyOrderNotification

Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String DEFAULT_GIFT_CERTIFICATE_EMAIL_TEMPLATE
          Name of template email parameter containing the quantity
static java.lang.String GIFT_CERTIFICATE_PARAM_NAME
          Name of template email parameter containing the gift certificate bean
static java.lang.String PURCHASER_PARAM_NAME
          Name of template email parameter containing the profile bean of the purchaser
static java.lang.String QUANTITY_PARAM_NAME
          Name of template email parameter containing the quantity
static java.lang.String RECIPIENT_EMAIL_PARAM_NAME
          Name of template email parameter containing the quantity
 
Fields inherited from class atg.commerce.fulfillment.FulfillerSystem
mModifyOrderNotificationPort, mModifyOrderPort, NUCLEUS_NAME
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ElectronicFulfiller()
           
 
Method Summary
 void addEmailListener(EmailListener pEmailListener)
          The list of email listeners to whom this fulfiller will attempt delivery of the specific electronic good.
protected  RepositoryItem createElectronicGood(java.lang.Double pAmount, java.lang.Double pAmountRemaining, java.lang.String pPurchaserId, java.util.Date pPurchaseDate)
          Deprecated. Replaced by the pipeline processor
protected  java.lang.String createEmailMessageBody(java.lang.String pClaimCode)
          Deprecated. Replaced by the pipeline processor
protected  EmailEvent createEmailObject(java.lang.String pRecipientEmailAddress, java.lang.String pClaimCode)
          Deprecated. Replaced by the pipeline processor
protected  void deliverElectronicGood(Order pOrder, ShippingGroup pShippingGroup, RepositoryItem pElectronicClaimable, long pQuantity)
          Deprecated. Replaced by the pipeline processor
protected  void deliverElectronicGood(java.lang.String pRecipientEmailAddress, java.lang.String pClaimCode)
          Deprecated. Replaced by the pipeline processor
 java.util.Properties getChainToRunMap()
           
 ClaimableManager getClaimableManager()
          Return the ClaimableManager property.
 java.lang.String getDefaultFromAddress()
          Return the DefaultFromAddress property.
 java.lang.String getDefaultMessageBody()
          Return the DefaultMessageBody property.
 java.lang.String getDefaultProfileType()
          The default profile repository view that is used in retrieving profiles.
 java.lang.String getDefaultSubject()
          Return the DefaultSubject property.
 TemplateEmailInfo getDefaultTemplateEmailInfo()
          The default information used for templated email.
 java.util.List getEmailListeners()
          Return the lis of email listeners that will attempt delivery.
 java.lang.String getGiftCertificateAmountProperty()
          The name of the property in the sku to be used for the gift certificate amount.
 java.lang.String getGiftCertificateEmailTemplate()
          The url to the email template used for gift certificate emails.
 java.lang.String getGiftCertificateParamName()
          The name of the parameter passed into the email template for the gift certificate Defaults to "giftCertificate"
 java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage)
          This method will return the key to be used for locking out other messages with the same key while a thread is handling this message.
protected  java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
          This is called only for the FulfillOrderFragment messages
 Repository getProfileRepository()
          The profile repository used to retrieve profile information.
 java.lang.String getPurchaserParamName()
          The name of the parameter passed into the email template for the purchaser Defaults to "purchaser"
 java.lang.String getQuantityParamName()
          The name of the parameter passed into the email template for the quantity Defaults to "quantity"
 java.lang.String getRecipientEmailParamName()
          The name of the parameter passed into the email template for the email address of the recipient.
 TemplateEmailSender getTemplateEmailSender()
          The TemplateEmailSender to use for sending email to a single recipient.
 void handleFulfillOrderFragment(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type FulfillOrderFragment.
protected  boolean handleMessage(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This is called to handle a newly received message.
 void handleModifyOrder(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type ModifyOrder.
 void handleModifyOrderNotification(java.lang.String pPortName, javax.jms.ObjectMessage pMessage)
           This method is called to handle all messages of type ModifyOrderNotification.
 boolean isPersistEmails()
          If true, emails will be persisted.
 boolean isSeparateEmailThread()
          If true, email will be send through a separate email thread.
 boolean isUseTemplateEmailSender()
          If true, is the templateEmailSender, otherwise just use the EmailListener default is true
 Order loadOrder(java.lang.String pId)
          This method will return the Order from the order repository with the given id.
 boolean processMultipleShippingGroups(Order pOrder, java.lang.String[] pShippingGroupIds, java.util.List pPerformedModifications)
          This method will process each shipping group in the given array.
protected  boolean processShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
          Deprecated. Replaced by the pipeline processor
 void removeEmailListener(EmailListener pEmailListener)
          Removes the email listener from the list of listeners that will attempt to deliver the electronic good on.
 void setChainToRunMap(java.util.Properties pChainToRunMap)
           
 void setClaimableManager(ClaimableManager pClaimableManager)
          Set the ClaimableManager property.
 void setDefaultFromAddress(java.lang.String pDefaultFromAddress)
          Set the DefaultFromAddress property.
 void setDefaultMessageBody(java.lang.String pDefaultMessageBody)
          Set the DefaultMessageBody property.
 void setDefaultProfileType(java.lang.String pDefaultProfileType)
           
 void setDefaultSubject(java.lang.String pDefaultSubject)
          Set the DefaultSubject property.
 void setDefaultTemplateEmailInfo(TemplateEmailInfo pDefaultTemplateEmailInfo)
           
 void setGiftCertificateAmountProperty(java.lang.String pGiftCertificateAmountProperty)
           
 void setGiftCertificateEmailTemplate(java.lang.String pGiftCertificateEmailTemplate)
           
 void setGiftCertificateParamName(java.lang.String pGiftCertificateParamName)
           
 void setPersistEmails(boolean pPersistEmails)
           
 void setProfileRepository(Repository pProfileRepository)
           
 void setPurchaserParamName(java.lang.String pPurchaserParamName)
           
 void setQuantityParamName(java.lang.String pQuantityParamName)
           
 void setRecipientEmailParamName(java.lang.String pRecipientEmailParamName)
           
 void setSeparateEmailThread(boolean pSeparateEmailThread)
           
 void setTemplateEmailSender(TemplateEmailSender pTemplateEmailSender)
           
 void setUseTemplateEmailSender(boolean pUseTemplateEmailSender)
           
 void updateOrder(Order pOrder)
          This method will save the order passed in to the repository that is being used.
 
Methods inherited from class atg.commerce.fulfillment.FulfillerSystem
doStartService, getClientLockManager, getCommerceItemStates, getFulfillmentPipelineManager, getLookUpOrderIdFromMessage, getLookUpOrderIdFromOrder, getModifyOrderNotificationPort, getModifyOrderPort, getOrderFulfillmentTools, getOrderManager, getOrderStates, getPaymentGroupStates, getPaymentManager, getShipItemRelationshipStates, getShippingGroupStates, handleNewMessageType, receiveMessage, setClientLockManager, setCommerceItemStates, setFulfillmentPipelineManager, setLookUpOrderIdFromMessage, setLookUpOrderIdFromOrder, setModifyOrderNotificationPort, setModifyOrderPort, setOrderFulfillmentTools, setOrderManager, setOrderStates, setPaymentGroupStates, setPaymentManager, setShipItemRelationshipStates, setShippingGroupStates
 
Methods inherited from class atg.commerce.messaging.SourceSinkTemplate
getDelayOnSendRetry, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, sendCommerceMessage, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

PURCHASER_PARAM_NAME

public static final java.lang.String PURCHASER_PARAM_NAME
Name of template email parameter containing the profile bean of the purchaser

See Also:
Constant Field Values

GIFT_CERTIFICATE_PARAM_NAME

public static final java.lang.String GIFT_CERTIFICATE_PARAM_NAME
Name of template email parameter containing the gift certificate bean

See Also:
Constant Field Values

QUANTITY_PARAM_NAME

public static final java.lang.String QUANTITY_PARAM_NAME
Name of template email parameter containing the quantity

See Also:
Constant Field Values

RECIPIENT_EMAIL_PARAM_NAME

public static final java.lang.String RECIPIENT_EMAIL_PARAM_NAME
Name of template email parameter containing the quantity

See Also:
Constant Field Values

DEFAULT_GIFT_CERTIFICATE_EMAIL_TEMPLATE

public static final java.lang.String DEFAULT_GIFT_CERTIFICATE_EMAIL_TEMPLATE
Name of template email parameter containing the quantity

See Also:
Constant Field Values
Constructor Detail

ElectronicFulfiller

public ElectronicFulfiller()
Method Detail

setProfileRepository

public void setProfileRepository(Repository pProfileRepository)

getProfileRepository

public Repository getProfileRepository()
The profile repository used to retrieve profile information.


setDefaultProfileType

public void setDefaultProfileType(java.lang.String pDefaultProfileType)

getDefaultProfileType

public java.lang.String getDefaultProfileType()
The default profile repository view that is used in retrieving profiles.


setUseTemplateEmailSender

public void setUseTemplateEmailSender(boolean pUseTemplateEmailSender)

isUseTemplateEmailSender

public boolean isUseTemplateEmailSender()
If true, is the templateEmailSender, otherwise just use the EmailListener default is true


setTemplateEmailSender

public void setTemplateEmailSender(TemplateEmailSender pTemplateEmailSender)

getTemplateEmailSender

public TemplateEmailSender getTemplateEmailSender()
The TemplateEmailSender to use for sending email to a single recipient.


setSeparateEmailThread

public void setSeparateEmailThread(boolean pSeparateEmailThread)

isSeparateEmailThread

public boolean isSeparateEmailThread()
If true, email will be send through a separate email thread. (true by default)


setPersistEmails

public void setPersistEmails(boolean pPersistEmails)

isPersistEmails

public boolean isPersistEmails()
If true, emails will be persisted. (false by default) Note: Currently, the TemplateEmailSender does not support email persistence unless the recipient is a profile. ElectronicFulfiller sends directly to an email address. Therefore, until support is added to the TemplateEmailSender, setting this flag to true will have no effect.


setDefaultTemplateEmailInfo

public void setDefaultTemplateEmailInfo(TemplateEmailInfo pDefaultTemplateEmailInfo)

getDefaultTemplateEmailInfo

public TemplateEmailInfo getDefaultTemplateEmailInfo()
The default information used for templated email. This property is ignore if is false.


setGiftCertificateEmailTemplate

public void setGiftCertificateEmailTemplate(java.lang.String pGiftCertificateEmailTemplate)

getGiftCertificateEmailTemplate

public java.lang.String getGiftCertificateEmailTemplate()
The url to the email template used for gift certificate emails. This property is ignore if is false.


setPurchaserParamName

public void setPurchaserParamName(java.lang.String pPurchaserParamName)

getPurchaserParamName

public java.lang.String getPurchaserParamName()
The name of the parameter passed into the email template for the purchaser Defaults to "purchaser"


setGiftCertificateParamName

public void setGiftCertificateParamName(java.lang.String pGiftCertificateParamName)

getGiftCertificateParamName

public java.lang.String getGiftCertificateParamName()
The name of the parameter passed into the email template for the gift certificate Defaults to "giftCertificate"


setQuantityParamName

public void setQuantityParamName(java.lang.String pQuantityParamName)

getQuantityParamName

public java.lang.String getQuantityParamName()
The name of the parameter passed into the email template for the quantity Defaults to "quantity"


setRecipientEmailParamName

public void setRecipientEmailParamName(java.lang.String pRecipientEmailParamName)

getRecipientEmailParamName

public java.lang.String getRecipientEmailParamName()
The name of the parameter passed into the email template for the email address of the recipient. Defaults to "recipient"


setDefaultFromAddress

public void setDefaultFromAddress(java.lang.String pDefaultFromAddress)
Set the DefaultFromAddress property. This property is ignore if is true.


getDefaultFromAddress

public java.lang.String getDefaultFromAddress()
Return the DefaultFromAddress property. This property is ignore if is true.


setDefaultSubject

public void setDefaultSubject(java.lang.String pDefaultSubject)
Set the DefaultSubject property. This property is ignore if is true.


getDefaultSubject

public java.lang.String getDefaultSubject()
Return the DefaultSubject property. This property is ignore if is true.


setDefaultMessageBody

public void setDefaultMessageBody(java.lang.String pDefaultMessageBody)
Set the DefaultMessageBody property. This property is ignore if is true.


getDefaultMessageBody

public java.lang.String getDefaultMessageBody()
Return the DefaultMessageBody property. This property is ignore if is true.


addEmailListener

public void addEmailListener(EmailListener pEmailListener)
The list of email listeners to whom this fulfiller will attempt delivery of the specific electronic good. This will add the pEmailListener to the list.

Parameters:
pEmailListener - the email listener to add

removeEmailListener

public void removeEmailListener(EmailListener pEmailListener)
Removes the email listener from the list of listeners that will attempt to deliver the electronic good on.

Parameters:
pEmailListener - the email listener to remove from the list

getEmailListeners

public java.util.List getEmailListeners()
Return the lis of email listeners that will attempt delivery.

Returns:
the list of email listeners

setClaimableManager

public void setClaimableManager(ClaimableManager pClaimableManager)
Set the ClaimableManager property.


getClaimableManager

public ClaimableManager getClaimableManager()
Return the ClaimableManager property.


setGiftCertificateAmountProperty

public void setGiftCertificateAmountProperty(java.lang.String pGiftCertificateAmountProperty)

getGiftCertificateAmountProperty

public java.lang.String getGiftCertificateAmountProperty()
The name of the property in the sku to be used for the gift certificate amount. Defaults to "listPrice"


getChainToRunMap

public java.util.Properties getChainToRunMap()

setChainToRunMap

public void setChainToRunMap(java.util.Properties pChainToRunMap)

handleMessage

protected boolean handleMessage(java.lang.String pPortName,
                                javax.jms.ObjectMessage pMessage)
                         throws javax.jms.JMSException

This is called to handle a newly received message. Before this method is called, the message is subjected to basic validity checks, a transaction is established, and an exclusive lock is acquired for the message's key.

ElectronicFulfiller handles the following types of messages:

  • FulfillOrderFragment - handleFulfillOrderFragment - This is sent to the fulfiller with a list of all the shipping groups that this fulfiller is responsible for.
  • ModifyOrder - this will call the handleModifyOrder method
  • ModifyOrderNotification - this will call the handleModifyOrderNotification method
  • If an unknown message type comes in, handleNewMessageType is called.

ElectronicFulfiller can be extended to handle extra types of messages by overriding the handleNewMessageType method.

Overrides:
handleMessage in class FulfillerSystem
Parameters:
pPortName - The port that this message was received from.
pMessage - The message that was just received.
Throws:
javax.jms.JMSException
See Also:
FulfillOrderFragment, handleFulfillOrderFragment(java.lang.String, javax.jms.ObjectMessage), ModifyOrder, handleModifyOrder(java.lang.String, javax.jms.ObjectMessage), ModifyOrderNotification, handleModifyOrderNotification(java.lang.String, javax.jms.ObjectMessage), FulfillerSystem#receive, FulfillerSystem.handleNewMessageType(java.lang.String, javax.jms.ObjectMessage)

handleModifyOrder

public void handleModifyOrder(java.lang.String pPortName,
                              javax.jms.ObjectMessage pMessage)
                       throws javax.jms.JMSException

This method is called to handle all messages of type ModifyOrder. Should developers wish to change the behavior of the ElectronicFulfiller class on handling a ModifyOrder message this method should be overridden. This method calls various methods to respond to the ModifyOrder requests. Modifications on orders are ignored since the ElectronicFulfiller does not have the authority to edit orders.

Currently, all Modifications will be marked as failed with a MODIFICATION_NOT_SUPPORTED message and then sent out.

Parameters:
pPortName - The port from which this message was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
ModifyOrder, IdTargetModification.getTargetType(), Modification

handleModifyOrderNotification

public void handleModifyOrderNotification(java.lang.String pPortName,
                                          javax.jms.ObjectMessage pMessage)
                                   throws javax.jms.JMSException

This method is called to handle all messages of type ModifyOrderNotification. Should developers wish to change the behavior of the ElectronicFulfiller class on handling a ModifyOrderNotification message this method should be overridden. Currently only one modification type is handled by this method. If the type of modification passed in the Modify Order Notification message is a shipping group update, processMultipleShippingGroups method will be called with the list of shipping group ids from the shipping group update.

Parameters:
pPortName - The port from which this message was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
ModifyOrderNotification, ShippingGroupUpdate

handleFulfillOrderFragment

public void handleFulfillOrderFragment(java.lang.String pPortName,
                                       javax.jms.ObjectMessage pMessage)
                                throws javax.jms.JMSException

This method is called to handle all messages of type FulfillOrderFragment. Should developers wish to change the behavior of the ElectronicFulfiller class in handling a FulfillOrderFragment message this method should be overriden. It first saves the order with updateOrder, then calls processShippingGroup for each shipping group in the message. When processing has finished, it calls updateOrder and sends all the changes that were made using OrderFulfillmentTools.sendModifyOrderNotification

Parameters:
pPortName - The port from which the FulfillOrderFragment was received.
pMessage - The message that was received.
Throws:
javax.jms.JMSException
See Also:
FulfillOrderFragment, updateOrder(atg.commerce.order.Order), processShippingGroup(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, java.util.List), OrderFulfillmentTools.sendModifyOrderNotification(java.lang.String, java.util.List, atg.commerce.fulfillment.ModifyOrder, atg.commerce.messaging.SourceSinkTemplate, java.lang.String, atg.commerce.fulfillment.ModifyOrderNotification)

getKeyForMessage

public java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage)
                                      throws javax.jms.JMSException
This method will return the key to be used for locking out other messages with the same key while a thread is handling this message.

Overrides:
getKeyForMessage in class FulfillerSystem
Parameters:
pMessage - the ObjectMessage containing the CommerceMessage.
Returns:
an Object which serves as the key for the message
Throws:
javax.jms.JMSException

getOrderIdFromMessage

protected java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
This is called only for the FulfillOrderFragment messages

Returns:
an Object which serves as the key for the message

processMultipleShippingGroups

public boolean processMultipleShippingGroups(Order pOrder,
                                             java.lang.String[] pShippingGroupIds,
                                             java.util.List pPerformedModifications)
                                      throws CommerceException
This method will process each shipping group in the given array. This iterating through all shipping groups and calling processShippingGroup.

Parameters:
pOrder - The order containing the shipping groups.
pShippingGroupIds - The array of shipping group ids to process.
pPerformedModifications - A place to store all new modifications.
Returns:
true if everything processed fine, false otherwise.
Throws:
CommerceException

processShippingGroup

protected boolean processShippingGroup(Order pOrder,
                                       ShippingGroup pShippingGroup,
                                       java.util.List pModificationList)
Deprecated. Replaced by the pipeline processor

This method is called to process each shipping group. It will iterate through all of the commerce item relationships associated with each shipping group, and check the state of each of these relationships. If the state is not set to DELIVERED, it will attempt to do two things.

  • Extract out the profile id from the order, the amount of the electronic good and then call createElectronicGood.
  • Deliver the electronic good via the deliverElectronicGood method

After this is done, the state of the ShippingGroupCommerceItem relationship will be set to DELIVERED.

Parameters:
pOrder - a value of type 'Order'
pShippingGroup - a value of type 'ShippingGroup'
pModificationList - a value of type 'List'
Returns:
a value of type 'boolean'

loadOrder

public Order loadOrder(java.lang.String pId)
                throws CommerceException
This method will return the Order from the order repository with the given id. In the standard implementation this will call the OrderManager and load the order.

Parameters:
pId - the id of the order to be retrieved
Returns:
the order corresponding to the id passed in
Throws:
CommerceException

createElectronicGood

protected RepositoryItem createElectronicGood(java.lang.Double pAmount,
                                              java.lang.Double pAmountRemaining,
                                              java.lang.String pPurchaserId,
                                              java.util.Date pPurchaseDate)
                                       throws CommerceException
Deprecated. Replaced by the pipeline processor

This method is used to create the electronic good that is being fulfilled. In this implementation that means create a gift certificate in the claimable repository. The gift certificate will then be initialized with the specified amount, amountRemaining, purchaserId and date.

Parameters:
pAmount - the amount of the gift certificate
pAmountRemaining - the amount left on a gift certificate
pPurchaserId - profile id of the person who purchased the gift certificate
pPurchaseDate - the date the gift certificate was purchased
Returns:
the created electronic good
Throws:
CommerceException - if an error occurs

deliverElectronicGood

protected void deliverElectronicGood(Order pOrder,
                                     ShippingGroup pShippingGroup,
                                     RepositoryItem pElectronicClaimable,
                                     long pQuantity)
                              throws CommerceException
Deprecated. Replaced by the pipeline processor

Uses the TemplateEmailSender to send the gift certificate email This method is used to actually deliver the electronic good. In this implementation this means using the TemplateEmailSender

Parameters:
pOrder - The order used to purchase the gift certificate
pShippingGroup - The shipping group used to ship the gift certificate
pElectronicClaimable - The claimable item
pQuantity - The number of gift certificates
Throws:
CommerceException

deliverElectronicGood

protected void deliverElectronicGood(java.lang.String pRecipientEmailAddress,
                                     java.lang.String pClaimCode)
                              throws EmailException
Deprecated. Replaced by the pipeline processor

This method is used to actually deliver the electronic good. In this implementation this means creating an emailEvent using the createEmailObject method of this class and then for each emailListener that is configured in this class calling sendEmailEvent.

Parameters:
pRecipientEmailAddress - the address that will receive the email
pClaimCode - the code that is used to obtain something from the Claimable Repository
Throws:
EmailException - if an error occurs, or emailListeners is size 0

createEmailObject

protected EmailEvent createEmailObject(java.lang.String pRecipientEmailAddress,
                                       java.lang.String pClaimCode)
Deprecated. Replaced by the pipeline processor

This method will create an EmailEvent that corresponds to the message to send out. It will send the message to the supplied email address. Additionally, it can take a claim code which is tied to the claimable repository. That is, by default the claim code can be used to obtain something from the claimable repository.

The EmailEvent is created with the message body that is returned by the createEmailMessageBody method. Also, the from address is set to the defaultFromAddress property of this class.

Parameters:
pRecipientEmailAddress - email address that this email will be sent to
pClaimCode - code to claim something from the ClaimableRepository
Returns:
a value of type 'EmailEvent'

createEmailMessageBody

protected java.lang.String createEmailMessageBody(java.lang.String pClaimCode)
Deprecated. Replaced by the pipeline processor

Creates the email message body that will be put into the email. By default it just appends the claim code onto the defaultMessageBody property.

Parameters:
pClaimCode - code that is used to claim things from the ClaimbleRepository
Returns:
the email message body

updateOrder

public void updateOrder(Order pOrder)
                 throws CommerceException
This method will save the order passed in to the repository that is being used.

Parameters:
pOrder - - the order to be saved
Throws:
CommerceException