raccoon.tibco.tibrv.message
Class RvTracking

java.lang.Object
  extended by com.tibco.tibrv.TibrvMsgField
      extended by raccoon.tibco.tibrv.message.RvTracking
All Implemented Interfaces:
ITracking

public class RvTracking
extends com.tibco.tibrv.TibrvMsgField
implements ITracking

The purpose of RvTracking is to provide support for end to end tracability of documents or messages throughout the system. It encapsulates information which is initiated by the first component to send a message (for example, a publishing adapter) and enriched by intermediate components (for example, TIBCO Integration Manager or receiving adapters).

RvTracking information allows first to track a message back to its source when an error occured in any given component, and second to provide status information about the progress of a business process distributed among multiple components.

The tracking information includes :

  1. A unique TrackingID used to uniquely identify a single message throughout it's lifecycle.
  2. Application information that may enriched progressively.
Bean generated by the Raccoon Framework, complies to the Raccoon specification of a java bean. The source code of this bean was generated using XML String named "Core TibTracking Elements" This class refers to the following classes: - java.util.ArrayList and was automatically generated by Raccoon v0.5.5

Since:
Raccoon v0.7 refactored in v1.0
Version:
$Id:$
Author:
Cedric ROUVRAIS

Field Summary
static java.lang.String TRACKING_FIELD_NAME
          The string used to name this element within a message
static java.lang.String TRACKING_ID_NAME
          The string used to indentify the tracking id
 
Fields inherited from class com.tibco.tibrv.TibrvMsgField
data, id, name, type
 
Constructor Summary
RvTracking()
          Default constructor, assigns the name to this instace.
RvTracking(boolean pCreateNewID)
          Generates a new Tracking ID if required.
RvTracking(IField pField)
          Convenient copy constructor
 
Method Summary
 void addApplicationInfo(java.lang.String pApplicationInfo)
          Adder method for applicationInfo
 java.util.Iterator applicationInfo()
          Iterator on the elements within the collection applicationInfo
 java.lang.String applicationInfoAt(int pIndex)
          Retrieves the application information at the specified position
 int applicationInfoSize()
          Retrieves the number of elements within the collection applicationInfo
 void assignAppInfo(java.util.Collection pApplicationInfo)
          Assigns to this instance the application information
 boolean fromNative(IBusMessage pMessage)
          Parses the contents of the given IBusMessage instance and assigns it to this message.
 boolean fromNative(IField pField)
          Parses the contents of the given IField instance and assigns it to this message.
 boolean fromNative(java.lang.Object pNativeTracking)
          Extracts from the native message the tracking information fills in the fields of this object
 boolean fromNative(com.tibco.tibrv.TibrvMsg pTibrvMsg)
          Assigns to this instance the tracking information contained in the provided message.
 java.util.ArrayList getApplicationInfo()
          Getter method for applicationInfo
 java.lang.String getTrackingId()
          The global identifier that is unique.
 void setApplicationInfo(java.util.ArrayList pApplicationInfo)
          Defines the application information belonging to this instance
 void setTrackingId(java.lang.String pTrackingId)
          Defines the string the uniquely identifies this element.
 java.lang.Object toNative()
          Converts this instance to the native representation used by the messaging layer
 java.lang.String toString()
          Generates the String representation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRACKING_ID_NAME

public static final java.lang.String TRACKING_ID_NAME
The string used to indentify the tracking id

See Also:
Constant Field Values

TRACKING_FIELD_NAME

public static final java.lang.String TRACKING_FIELD_NAME
The string used to name this element within a message

See Also:
Constant Field Values
Constructor Detail

RvTracking

public RvTracking()
Default constructor, assigns the name to this instace.


RvTracking

public RvTracking(boolean pCreateNewID)
Generates a new Tracking ID if required. TODO Remove dependency upon TIB/Adapter SDK.

Parameters:
pCreateNewID - create a new tracking id ?

RvTracking

public RvTracking(IField pField)
Convenient copy constructor

Parameters:
pField - the tracking message from which the data is to be extracted
Method Detail

setTrackingId

public void setTrackingId(java.lang.String pTrackingId)
                   throws java.lang.IllegalArgumentException
Defines the string the uniquely identifies this element.

If the tracking id is null or if it contains only spaces then this method will throw an IllegalArgumentException exception.

To check if this given tracking id contains only spaces this method uses trim()

Specified by:
setTrackingId in interface ITracking
Parameters:
pTrackingId - a unique string
Throws:
java.lang.IllegalArgumentException - if the tracking id is null or contains only spaces.

getTrackingId

public java.lang.String getTrackingId()
                               throws java.lang.InternalError
The global identifier that is unique.

Specified by:
getTrackingId in interface ITracking
Returns:
the value of TrackingId, null if not defined.
Throws:
java.lang.InternalError - if the contents of the tracking id are corrupted.

assignAppInfo

public void assignAppInfo(java.util.Collection pApplicationInfo)
                   throws java.lang.IllegalArgumentException
Assigns to this instance the application information

Specified by:
assignAppInfo in interface ITracking
Parameters:
pApplicationInfo - a collection of string elements
Throws:
java.lang.IllegalArgumentException - if an element of the collection isn't a string instance.

setApplicationInfo

public void setApplicationInfo(java.util.ArrayList pApplicationInfo)
                        throws java.lang.IllegalArgumentException
Defines the application information belonging to this instance

Specified by:
setApplicationInfo in interface ITracking
Parameters:
pApplicationInfo - the new value for this property, an array of string
Throws:
java.lang.IllegalArgumentException - if an element of the collection isn't a string instance.

getApplicationInfo

public java.util.ArrayList getApplicationInfo()
Getter method for applicationInfo

Specified by:
getApplicationInfo in interface ITracking
Returns:
the value of ApplicationInfo

applicationInfo

public java.util.Iterator applicationInfo()
Iterator on the elements within the collection applicationInfo

Specified by:
applicationInfo in interface ITracking
Returns:
the iterator of ApplicationInfo
See Also:
List.iterator()

applicationInfoSize

public int applicationInfoSize()
Retrieves the number of elements within the collection applicationInfo

Specified by:
applicationInfoSize in interface ITracking
Returns:
the size of ApplicationInfo

applicationInfoAt

public java.lang.String applicationInfoAt(int pIndex)
                                   throws java.lang.IndexOutOfBoundsException
Retrieves the application information at the specified position

Specified by:
applicationInfoAt in interface ITracking
Parameters:
pIndex - the position of the application information. Must be a value between 1 and applicationInfoSize()
Returns:
the string corresponding to the index.
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of bounds
See Also:
applicationInfoSize()

addApplicationInfo

public void addApplicationInfo(java.lang.String pApplicationInfo)
Adder method for applicationInfo

Specified by:
addApplicationInfo in interface ITracking
Parameters:
pApplicationInfo - the element to add to the collection
See Also:
List.add(java.lang.Object)

toNative

public java.lang.Object toNative()
                          throws RaccoonException
Converts this instance to the native representation used by the messaging layer

Specified by:
toNative in interface ITracking
Returns:
the messaging layer object used to transmit tracking information
Throws:
RaccoonException - if the process fails to convert this element to a native tracking element.
RaccoonException - if the tracking id isn't assigned.

fromNative

public boolean fromNative(java.lang.Object pNativeTracking)
                   throws java.lang.IllegalArgumentException
Extracts from the native message the tracking information fills in the fields of this object

Specified by:
fromNative in interface ITracking
Parameters:
pNativeTracking - the native message containing the tracking element or the tracking element.
Returns:
true if the conversion was successful.
Throws:
java.lang.IllegalArgumentException - if the tracking id is null or contains only spaces.

fromNative

public boolean fromNative(com.tibco.tibrv.TibrvMsg pTibrvMsg)
                   throws java.lang.IllegalArgumentException
Assigns to this instance the tracking information contained in the provided message.

This method retrieves, if possible, the TibrvMsg that is named ^tracking^. Whether it can find this field or not it will carry on.
From that message it then searches for a field named ^id^, if it can't find this field the invocation returns false.

Parameters:
pTibrvMsg - the TIB/Rendezvous message that contains the tracking information.
Returns:
true if the conversion was successful, false otherwise.
Throws:
java.lang.IllegalArgumentException - if the tracking id is null or contains only spaces.

fromNative

public boolean fromNative(IBusMessage pMessage)
                   throws java.lang.IllegalArgumentException
Parses the contents of the given IBusMessage instance and assigns it to this message.

Parameters:
pMessage - the message from which the tracking contents are to be retrieved
Returns:
true if the conversion was successful, false otherwise.
Throws:
java.lang.IllegalArgumentException - if the tracking id is null or contains only spaces.

fromNative

public boolean fromNative(IField pField)
                   throws java.lang.IllegalArgumentException
Parses the contents of the given IField instance and assigns it to this message.

Parameters:
pField - the message from which the tracking contents are to be retrieved
Returns:
true if the conversion was successful, false otherwise.
Throws:
java.lang.IllegalArgumentException - if pField is null or contains only spaces.

toString

public java.lang.String toString()
Generates the String representation of this instance.

The result should be something like this: ITracking[id="$TrackingId$", appInfo[id=1]="Some application info"]]

Specified by:
toString in interface ITracking
Overrides:
toString in class com.tibco.tibrv.TibrvMsgField
Returns:
the string representation of this object


Copyright null null. All Rights Reserved.