public class ElectronicFulfiller extends FulfillerSystem
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
static java.lang.String |
DEFAULT_GIFT_CERTIFICATE_EMAIL_TEMPLATE
default gift certificate email template
|
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 recipient
|
mModifyOrderNotificationPort, mModifyOrderPort, NUCLEUS_NAME
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
ElectronicFulfiller() |
Modifier and Type | Method and Description |
---|---|
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.
|
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
sendCommerceMessage
beforeSendMessage, getDefaultMessageSourceName, getDelayOnSendRetry, getLimboDeliveryDelay, getMessageSourceContext, getMessageSourceName, getTransactionManager, isAllowMessageSending, sendObjectMessage, setAllowMessageSending, setDelayOnSendRetry, setLimboDeliveryDelay, setMessageSourceContext, setMessageSourceName, setTransactionManager, startMessageSource, stopMessageSource
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final java.lang.String PURCHASER_PARAM_NAME
public static final java.lang.String GIFT_CERTIFICATE_PARAM_NAME
public static final java.lang.String QUANTITY_PARAM_NAME
public static final java.lang.String RECIPIENT_EMAIL_PARAM_NAME
public static final java.lang.String DEFAULT_GIFT_CERTIFICATE_EMAIL_TEMPLATE
public void setProfileRepository(Repository pProfileRepository)
public Repository getProfileRepository()
public void setDefaultProfileType(java.lang.String pDefaultProfileType)
public java.lang.String getDefaultProfileType()
public void setUseTemplateEmailSender(boolean pUseTemplateEmailSender)
public boolean isUseTemplateEmailSender()
public void setTemplateEmailSender(TemplateEmailSender pTemplateEmailSender)
public TemplateEmailSender getTemplateEmailSender()
public void setSeparateEmailThread(boolean pSeparateEmailThread)
public boolean isSeparateEmailThread()
public void setPersistEmails(boolean pPersistEmails)
public boolean isPersistEmails()
true
will have no effect.public void setDefaultTemplateEmailInfo(TemplateEmailInfo pDefaultTemplateEmailInfo)
public TemplateEmailInfo getDefaultTemplateEmailInfo()
is false.
public void setGiftCertificateEmailTemplate(java.lang.String pGiftCertificateEmailTemplate)
public java.lang.String getGiftCertificateEmailTemplate()
is false.
public void setPurchaserParamName(java.lang.String pPurchaserParamName)
public java.lang.String getPurchaserParamName()
public void setGiftCertificateParamName(java.lang.String pGiftCertificateParamName)
public java.lang.String getGiftCertificateParamName()
public void setQuantityParamName(java.lang.String pQuantityParamName)
public java.lang.String getQuantityParamName()
public void setRecipientEmailParamName(java.lang.String pRecipientEmailParamName)
public java.lang.String getRecipientEmailParamName()
public void setDefaultFromAddress(java.lang.String pDefaultFromAddress)
is true.
public java.lang.String getDefaultFromAddress()
is true.
public void setDefaultSubject(java.lang.String pDefaultSubject)
is true.
public java.lang.String getDefaultSubject()
is true.
public void setDefaultMessageBody(java.lang.String pDefaultMessageBody)
is true.
public java.lang.String getDefaultMessageBody()
is true.
public void addEmailListener(EmailListener pEmailListener)
pEmailListener
- the email listener to addpublic void removeEmailListener(EmailListener pEmailListener)
pEmailListener
- the email listener to remove from the listpublic java.util.List getEmailListeners()
public void setClaimableManager(ClaimableManager pClaimableManager)
public ClaimableManager getClaimableManager()
public void setGiftCertificateAmountProperty(java.lang.String pGiftCertificateAmountProperty)
public java.lang.String getGiftCertificateAmountProperty()
public java.util.Properties getChainToRunMap()
public void setChainToRunMap(java.util.Properties pChainToRunMap)
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:
ElectronicFulfiller can be extended to handle extra types of messages by overriding the handleNewMessageType method.
handleMessage
in class FulfillerSystem
pPortName
- The port that this message was received from.pMessage
- The message that was just received.javax.jms.JMSException
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)
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.
pPortName
- The port from which this message was received.pMessage
- The message that was received.javax.jms.JMSException
ModifyOrder
,
IdTargetModification.getTargetType()
,
Modification
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.
pPortName
- The port from which this message was received.pMessage
- The message that was received.javax.jms.JMSException
ModifyOrderNotification
,
ShippingGroupUpdate
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
pPortName
- The port from which the FulfillOrderFragment was received.pMessage
- The message that was received.javax.jms.JMSException
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)
public java.io.Serializable getKeyForMessage(javax.jms.ObjectMessage oMessage) throws javax.jms.JMSException
getKeyForMessage
in class FulfillerSystem
pMessage
- the ObjectMessage containing the CommerceMessage.javax.jms.JMSException
protected java.io.Serializable getOrderIdFromMessage(FulfillOrderFragment cMessage)
public boolean processMultipleShippingGroups(Order pOrder, java.lang.String[] pShippingGroupIds, java.util.List pPerformedModifications) throws CommerceException
pOrder
- The order containing the shipping groups.pShippingGroupIds
- The array of shipping group ids to process.pPerformedModifications
- A place to store all new modifications.CommerceException
protected boolean processShippingGroup(Order pOrder, ShippingGroup pShippingGroup, java.util.List pModificationList)
After this is done, the state of the ShippingGroupCommerceItem relationship will be set to DELIVERED.
pOrder
- a value of type 'Order'pShippingGroup
- a value of type 'ShippingGroup'pModificationList
- a value of type 'List'public Order loadOrder(java.lang.String pId) throws CommerceException
pId
- the id of the order to be retrievedCommerceException
protected RepositoryItem createElectronicGood(java.lang.Double pAmount, java.lang.Double pAmountRemaining, java.lang.String pPurchaserId, java.util.Date pPurchaseDate) throws CommerceException
pAmount
- the amount of the gift certificatepAmountRemaining
- the amount left on a gift certificatepPurchaserId
- profile id of the person who purchased the gift certificatepPurchaseDate
- the date the gift certificate was purchasedCommerceException
- if an error occursprotected void deliverElectronicGood(Order pOrder, ShippingGroup pShippingGroup, RepositoryItem pElectronicClaimable, long pQuantity) throws CommerceException
pOrder
- The order used to purchase the gift certificatepShippingGroup
- The shipping group used to ship the gift certificatepElectronicClaimable
- The claimable itempQuantity
- The number of gift certificatesCommerceException
protected void deliverElectronicGood(java.lang.String pRecipientEmailAddress, java.lang.String pClaimCode) throws EmailException
pRecipientEmailAddress
- the address that will receive the emailpClaimCode
- the code that is used to obtain something from the Claimable RepositoryEmailException
- if an error occurs, or emailListeners is size 0protected EmailEvent createEmailObject(java.lang.String pRecipientEmailAddress, java.lang.String pClaimCode)
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.
pRecipientEmailAddress
- email address that this email will be sent topClaimCode
- code to claim something from the ClaimableRepositoryprotected java.lang.String createEmailMessageBody(java.lang.String pClaimCode)
pClaimCode
- code that is used to claim things from the ClaimbleRepositorypublic void updateOrder(Order pOrder) throws CommerceException
pOrder
- - the order to be savedCommerceException