atg.commerce.messaging
Class CommerceMessageImpl

java.lang.Object
  extended by atg.commerce.messaging.CommerceMessageImpl
All Implemented Interfaces:
CommerceMessage, java.io.Serializable
Direct Known Subclasses:
ApprovalMessage, ApprovalRequiredMessage, FulfillOrderFragment, GiftPurchased, ModifyOrder, ModifyOrderNotification, OrderAbandoned, PromotionClosenessMessage, PromotionUsed, ScheduledOrderMessage, SubmitOrder, TransientOrderEvent, UpdateInventoryImpl

public class CommerceMessageImpl
extends java.lang.Object
implements CommerceMessage

This is an implementation of the CommerceMessage interface. It is here to simplify the matter of implementing this interface.

See Also:
CommerceMessage, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
CommerceMessageImpl()
          Initializes the sessionId and parentSessionId properties of this message when this message is fired in context of HTTP request.
 
Method Summary
protected  java.lang.String appendBaseToString(java.lang.StringBuffer pBuf)
          Returns readable string appending the contents of this Message with the parameter pBuf passed.
 java.lang.String getId()
          This method returns the id of this message in an unspecified format.
 java.lang.String getOriginalId()
          Get the original message id as it came from the originalSource, if there is one.
 java.lang.String getOriginalSource()
          This is the original source of data for this message, if there is one.
 java.lang.String getOriginalUserId()
          This method returns the id of the end user whose action initiated this request, associated with originalSource and originalId.
 java.lang.String getParentSessionId()
          Returns the parent session id.
 java.lang.String getSessionId()
          Returns the current session id associated with the request when this message is sent in the context of an HTTP request.
 java.lang.String getSiteId()
          Returns the site id associated with the event
 java.lang.String getSource()
          This method returns an arbitrary string that identifies the source of the the message.
 java.lang.String getType()
          return the TYPE of the message
 java.lang.String getUserId()
          This method returns the id of the most recent end user who acted on this message, if there was one.
 void setId(java.lang.String pId)
          Set the id of this message.
 void setOriginalId(java.lang.String pOriginalId)
           
 void setOriginalSource(java.lang.String pOriginalSource)
           
 void setOriginalUserId(java.lang.String pOriginalUserId)
           
 void setParentSessionId(java.lang.String pParentSessionId)
          Sets the parent session id.
 void setSessionId(java.lang.String pSessionId)
          Sets the session id
 void setSiteId(java.lang.String pSiteId)
          The site id associated with the event
 void setSource(java.lang.String pSource)
          Set the source of this message.
 void setUserId(java.lang.String pUserId)
          Set the user id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CommerceMessageImpl

public CommerceMessageImpl()
Initializes the sessionId and parentSessionId properties of this message when this message is fired in context of HTTP request.

Method Detail

getSource

public java.lang.String getSource()
This method returns an arbitrary string that identifies the source of the the message. The source combined with the message id must uniquely identify a message. An example of a meaningfull source would be 'CSRUI@host.domain', this tells what software system issued the message and the host it was running on. A message with a null value for it's source is considered invalid. If the recipient of this message passes it on it must set the source to a string identifying itself and generate an Id that keeps this combination unique. This is particularly important when a message is fragmented. The user id should be either set to null or set to the id of the user that is associated with the action performed by the recipient.

Specified by:
getSource in interface CommerceMessage

setSource

public void setSource(java.lang.String pSource)
Set the source of this message.

Specified by:
setSource in interface CommerceMessage

getId

public java.lang.String getId()
This method returns the id of this message in an unspecified format. The combination of this id and the source of this messages must be unique. A message with a null value for it's id is considered invalid.

Specified by:
getId in interface CommerceMessage

setId

public void setId(java.lang.String pId)
Set the id of this message.

Specified by:
setId in interface CommerceMessage

getUserId

public java.lang.String getUserId()
This method returns the id of the most recent end user who acted on this message, if there was one. This field can be null and the message will still be considered valid.

Specified by:
getUserId in interface CommerceMessage

setUserId

public void setUserId(java.lang.String pUserId)
Set the user id.

Specified by:
setUserId in interface CommerceMessage

getOriginalSource

public java.lang.String getOriginalSource()
This is the original source of data for this message, if there is one. It is important to keep the original source and id so that later references to this request can be identified. For example, it is necessary to identify the original requester of a ModifyOrder message so it can be set in a ModifyOrderNotification message. Keep in mind that the combination of original source and original id may not be unique if the message has been fragmented. This field is not used to identify what message this message is a response to, but to identify what message this message is a fragment of or a routed copy of.

Specified by:
getOriginalSource in interface CommerceMessage

setOriginalSource

public void setOriginalSource(java.lang.String pOriginalSource)

getOriginalId

public java.lang.String getOriginalId()
Get the original message id as it came from the originalSource, if there is one.

Specified by:
getOriginalId in interface CommerceMessage

setOriginalId

public void setOriginalId(java.lang.String pOriginalId)

getOriginalUserId

public java.lang.String getOriginalUserId()
This method returns the id of the end user whose action initiated this request, associated with originalSource and originalId. This field can be null and the message will still be considered valid.

Specified by:
getOriginalUserId in interface CommerceMessage

setOriginalUserId

public void setOriginalUserId(java.lang.String pOriginalUserId)

getType

public java.lang.String getType()
return the TYPE of the message

Specified by:
getType in interface CommerceMessage

getParentSessionId

public java.lang.String getParentSessionId()
Returns the parent session id. This may be different than the request's current session id on app servers which use a separate session id for each web application. This field can be null and the message will still be considered valid.

Specified by:
getParentSessionId in interface CommerceMessage

setParentSessionId

public void setParentSessionId(java.lang.String pParentSessionId)
Sets the parent session id.

Specified by:
setParentSessionId in interface CommerceMessage

getSessionId

public java.lang.String getSessionId()
Returns the current session id associated with the request when this message is sent in the context of an HTTP request. This field can be null and the message will still be considered valid.

Specified by:
getSessionId in interface CommerceMessage

setSessionId

public void setSessionId(java.lang.String pSessionId)
Sets the session id

Specified by:
setSessionId in interface CommerceMessage

setSiteId

public void setSiteId(java.lang.String pSiteId)
The site id associated with the event

Parameters:
pSite - site id to set

getSiteId

public java.lang.String getSiteId()
Returns the site id associated with the event

Returns:
the site id associated with the event

appendBaseToString

protected java.lang.String appendBaseToString(java.lang.StringBuffer pBuf)
Returns readable string appending the contents of this Message with the parameter pBuf passed. This may be used by sub-classes of this class to append the contents of this base class to the sub-class's String form.