net.sf.xbus.base.journal
Class Journal

java.lang.Object
  extended by net.sf.xbus.base.journal.Journal

public class Journal
extends java.lang.Object

Journal writes information about the activities of the middleware.

Configuration:

Chapter Section Key Content
Journal Write system.getName().Send true, if sending data to this system shall be written.
Journal Write system.getName().Receive true, if receiving data from this system shall be written.
Journal Implementation Class Name of the Java-class that shall do the writing.
Journal MessageLength Bytes Maximum number of bytes for request- and response-message.


Constructor Summary
Journal()
           
 
Method Summary
 void commit()
          Commits the database.
static java.lang.String formatDate(java.util.Date in)
          The given Date is converted to a string.
static java.lang.String formatText(Message message, XBUSSystem system, boolean request)
          Shortens either the request-message or the response-message to a length specified in the Configuration.
static void initialize()
           
 void log(char type, XBUSSystem system, Message message)
          Writes a middleware-activity.
static java.lang.String removeLinefeeds(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Journal

public Journal()
Method Detail

log

public void log(char type,
                XBUSSystem system,
                Message message)
         throws XException
Writes a middleware-activity. An activity can be:

The Configuration stores, which activities are written. All other activities are ignored.

Parameters:
type - R: message has been received, S: message has been send
system - The name of the system, from which the message has been received or where the message has been sent to.
message - The Message-object that represents the data of the message.
Throws:
XException

commit

public void commit()
            throws XException
Commits the database.

Throws:
XException

formatDate

public static java.lang.String formatDate(java.util.Date in)
The given Date is converted to a string. The format of the string is specified in Constants.DATE_FORMAT.


formatText

public static java.lang.String formatText(Message message,
                                          XBUSSystem system,
                                          boolean request)
                                   throws XException
Shortens either the request-message or the response-message to a length specified in the Configuration.

Parameters:
message - The Message-object that contains the data of the message.
system - The name of the system, from which the message has been received or where the message has been sent to.
request - true: the request-message will be shortened, false: the response-message will be shortened.
Returns:
the shortened message
Throws:
XException

initialize

public static void initialize()
                       throws XException
Throws:
XException

removeLinefeeds

public static java.lang.String removeLinefeeds(java.lang.String text)