org.openeai.implementations.services.els.commands
Class LoggedMessage


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.implementations.services.els.commands.LoggedMessage


public class LoggedMessage
extends OpenEaiObject

This is a utility class used by the EnterpriseSyncLoggerCommand which is part of the "Enterprise Logging Service". It is used to actually log the consumed synchronization message to a repository.

Version:
#
Author:
Alan Schuele and Jeff Heckel

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
LoggedMessage()
          Constructor
 
Method Summary
 java.lang.String getAction()
          Gets the action
 java.lang.String getCategory()
          Gets the category
 java.util.Date getDateTime()
          Gets the dateTime
 java.lang.String getLogConsumerId()
          Gets the Log Consumer ID
 java.lang.String getMessage()
          Gets the message
 java.lang.String getObject()
          Gets the object
 java.lang.String getPriority()
          Gets the priority
 java.lang.String getProducerId()
          Gets the ProducerId
 java.lang.String getRelease()
          Gets the release
 java.lang.String getSenderAppId()
          Gets the Sender App Id
 java.lang.String getSequence()
          Gets the sequence
 java.lang.String getTargetAppName()
          Gets the target app name
 java.lang.String getType()
          Gets the type
 boolean insertRow(java.sql.Connection conn)
          Inserts the current contents of this object into the database (T_LOGGED_MESSAGE).
 void setAction(java.lang.String action)
          Sets the action
 void setCategory(java.lang.String category)
          Sets the category
 void setDateTime(java.util.Date dateTime)
          Sets the DateTime
 void setLogConsumerId(java.lang.String logConsumerId)
          Sets the Log Consumer ID
 void setMessage(java.lang.String message)
          Sets the message
 void setObject(java.lang.String object)
          Sets the object
 void setPriority(java.lang.String priority)
          Sets the priority
 void setProducerId(java.lang.String producerId)
          Sets the ProducerId
 void setRelease(java.lang.String release)
          Sets the release
 void setSenderAppId(java.lang.String senderAppId)
          Sets the Sender App Id
 void setSequence(java.lang.String sequence)
          Sets the sequence
 void setTargetAppName(java.lang.String appName)
          Sets the targetAppName
 void setType(java.lang.String type)
          Sets the type
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggedMessage


public LoggedMessage()
Constructor

Method Detail

setTargetAppName


public void setTargetAppName(java.lang.String appName)
Sets the targetAppName

Parameters:
appName - - Logged Message target app name

getTargetAppName


public java.lang.String getTargetAppName()
Gets the target app name

Returns:
appName - Logged Message target app name

setCategory


public void setCategory(java.lang.String category)
Sets the category

Parameters:
category - - Logged Message category

getCategory


public java.lang.String getCategory()
Gets the category

Returns:
category - Logged Message Category

setObject


public void setObject(java.lang.String object)
Sets the object

Parameters:
object - - Logged Message object

getObject


public java.lang.String getObject()
Gets the object

Returns:
object - Logged Message object

setAction


public void setAction(java.lang.String action)
Sets the action

Parameters:
action - - Logged Message action

getAction


public java.lang.String getAction()
Gets the action

Returns:
action - Logged Message action

setType


public void setType(java.lang.String type)
Sets the type

Parameters:
type - - Logged Message type

getType


public java.lang.String getType()
Gets the type

Returns:
type - Logged Message type

setRelease


public void setRelease(java.lang.String release)
Sets the release

Parameters:
release - - Logged Message release

getRelease


public java.lang.String getRelease()
Gets the release

Returns:
release - Logged Message release

setPriority


public void setPriority(java.lang.String priority)
Sets the priority

Parameters:
priority - - Logged Message priority

getPriority


public java.lang.String getPriority()
Gets the priority

Returns:
priority - Logged Message priority

setSenderAppId


public void setSenderAppId(java.lang.String senderAppId)
Sets the Sender App Id

Parameters:
senderAppId - - Logged Message senderAppId

getSenderAppId


public java.lang.String getSenderAppId()
Gets the Sender App Id

Returns:
sendorAppId - Logged Message sendorAppId

setProducerId


public void setProducerId(java.lang.String producerId)
Sets the ProducerId

Parameters:
producerId - - Logged Message producerId

getProducerId


public java.lang.String getProducerId()
Gets the ProducerId

Returns:
producerId - Logged Message producerId

setSequence


public void setSequence(java.lang.String sequence)
Sets the sequence

Parameters:
sequence - - Logged Message sequence

getSequence


public java.lang.String getSequence()
Gets the sequence

Returns:
sequence - Logged Message sequence

setMessage


public void setMessage(java.lang.String message)
Sets the message

Parameters:
message - - Logged Message message

getMessage


public java.lang.String getMessage()
Gets the message

Returns:
message - Logged Message message

setLogConsumerId


public void setLogConsumerId(java.lang.String logConsumerId)
Sets the Log Consumer ID

Parameters:
logConsumerId - - Logged Message logConsumerId

getLogConsumerId


public java.lang.String getLogConsumerId()
Gets the Log Consumer ID

Returns:
logConsumerId - Logged Message logConsumerId

setDateTime


public void setDateTime(java.util.Date dateTime)
Sets the DateTime


getDateTime


public java.util.Date getDateTime()
Gets the dateTime

Returns:
dateTime - Logged Message Category

insertRow


public boolean insertRow(java.sql.Connection conn)
                  throws java.sql.SQLException
Inserts the current contents of this object into the database (T_LOGGED_MESSAGE). The object was populated by the calling command (EnterpriseSyncLoggerCommand) and the java.sql.Connection object was retrieved from the Database Connection Pool object associated to that command.

This method not only logs the appropriate ControlArea information into the T_LOGGED_MESSAGE table but it breaks the actual message into segments if the message body is larger than 3900 bytes. This implementation was originally developed for an Oracle database and VARCHAR2 fields can be a maximum of 4000 characters. This is why the message body is broken into segments. Depending on the database implementation being used, this number may be different. The class could also be written to either allow this setting to be configurable or to break the message body into a universal segment that would work for any database. These individual segments are stored in the T_MESSAGE_SEGMENT table.

The ControlArea information (metadata) is inserted into the T_LOGGED_MESSAGE table. The information is pulled from the ControlArea of the message and inserted into the T_LOGGED_MESSAGE table:

ControlArea Element Column Description
ControlAreaSync@messageCategory MESSAGE_CATEGORY Message category associated to the sync message consumed.
ControlAreaSync@messageObject MESSAGE_OBJECT Message object name associated to the sync message consumed.
ControlAreaSync@messageAction MESSAGE_ACTION Message action associated to the sync message consumed.
ControlAreaSync@messageType MESSAGE_TYPE Message type associated to the sync message consumed.
ControlAreaSync@messageRelease MESSAGE_RELEASE Message release associated to the sync message consumed.
ControlAreaSync@messagePriority MESSAGE_PRIORITY Message priority associated to the sync message consumed.
ControlAreaSync/Sender/MessageId/SenderAppId SENDER_APPL_NAME SenderAppId of the gateway or application that published the message.
ControlAreaSync/Sender/MessageId/ProducerId PRODUCER_ID ProducerId associated to the gateway or application that published the message.
ControlAreaSync/Sender/MessageId/MessageSequence MESSAGE_SEQ MessageSequence associated to the gateay or application that published the message.
ControlAreaSync/Datetime MESSAGE_DATETIME The time the business event occurred that caused the message to be published.
ControlAreaSync/TargetInfo/AppName TARGET_APP_NAME The name of the intended target to which this message was routed.
N/A LOG_CONSUMER_ID The name of the application logging the message ("SyncLogConsumer" in this case).

The segments of the message are broken into smaller chunks and correlated to this metadata by the LOGGED_MESSAGE_ID. The segments are stored as follows:

Column Description
LOGGED_MESSAGE_ID The message id that correlates to the metadata that was inserted into T_LOGGED_MESSAGE.
MESSAGE_SEGMENT_SEQ A segment counter (starting at 1) that indicates which segment of the message body this segment is. This allows the segments to be reconstituted into their full form later.
MESSAGE_SEGMENT A segment of the entire message body. This implementation breaks the segments into chunks of 3900 characters so it will fit in an Oracle VARCHAR2(4000) column.

Throws:
java.sql.SQLException - if errors occur inserting the information into the table.


Copyright © 2002, OpenEAI Software Foundation