|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.implementations.services.els.commands.LoggedMessage
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.
| 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 |
public LoggedMessage()
| Method Detail |
public void setTargetAppName(java.lang.String appName)
appName - - Logged Message target app namepublic java.lang.String getTargetAppName()
public void setCategory(java.lang.String category)
category - - Logged Message categorypublic java.lang.String getCategory()
public void setObject(java.lang.String object)
object - - Logged Message objectpublic java.lang.String getObject()
public void setAction(java.lang.String action)
action - - Logged Message actionpublic java.lang.String getAction()
public void setType(java.lang.String type)
type - - Logged Message typepublic java.lang.String getType()
public void setRelease(java.lang.String release)
release - - Logged Message releasepublic java.lang.String getRelease()
public void setPriority(java.lang.String priority)
priority - - Logged Message prioritypublic java.lang.String getPriority()
public void setSenderAppId(java.lang.String senderAppId)
senderAppId - - Logged Message senderAppIdpublic java.lang.String getSenderAppId()
public void setProducerId(java.lang.String producerId)
producerId - - Logged Message producerIdpublic java.lang.String getProducerId()
public void setSequence(java.lang.String sequence)
sequence - - Logged Message sequencepublic java.lang.String getSequence()
public void setMessage(java.lang.String message)
message - - Logged Message messagepublic java.lang.String getMessage()
public void setLogConsumerId(java.lang.String logConsumerId)
logConsumerId - - Logged Message logConsumerIdpublic java.lang.String getLogConsumerId()
public void setDateTime(java.util.Date dateTime)
public java.util.Date getDateTime()
public boolean insertRow(java.sql.Connection conn)
throws java.sql.SQLException
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. |
java.sql.SQLException - if errors occur inserting the information into the table.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||