Websphere MQ Everyplace

com.ibm.mqe.trace
Class MQeTraceRenderer

java.lang.Object
  |
  +--com.ibm.mqe.trace.MQeTraceRenderer

public class MQeTraceRenderer
extends java.lang.Object

Provides a programmatic way of managing a collection of tracePointGroups and tracePoints information.

It provides methods to add or remove tracePointGroups, individual tracePoints to and from the collection of tracePointGroups and collection of tracePoints.


Constructor Summary
MQeTraceRenderer()
          Simple constructor to construct a renderer object with predefined list of tracePoints and tracePointGroups.
 
Method Summary
 boolean addGroup(MQeTracePointGroup newGroup)
          Adds a tracePoint sub-group to this renderer.
static java.lang.String getBuildName()
          Provides the version details (build name) of the data used by this class.
static short[] getBuildVersion()
          Provides the version details (product release number) of the data used by this class.
static MQeTracePointGroup getGroup(java.lang.String key)
          Retrieves a single tracePointGroup.
static MQeTracePointGroup[] getGroups()
          Retrieves a list of all the logical tracePointGroups.
 java.lang.String getMessage(short msgNumber, java.lang.Object[] args)
          Given a message number and a collection of object references, returns a readable English string.
 MQeTracePoint getTracePoint(short msgNumber)
          Retrieves information about a particular tracePoint if it exists in any of the available tracePointGroup lists.
 void loadResourceTable()
          A method which actually loads the resource file, creats a new tracePoint for each of the keys present in this resource file and adds it to the collection of tracePoints.
 boolean removeGroup(MQeTracePointGroup group)
          Removes a tracePointGroup from this renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQeTraceRenderer

public MQeTraceRenderer()
Simple constructor to construct a renderer object with predefined list of tracePoints and tracePointGroups.

Method Detail

loadResourceTable

public void loadResourceTable()
A method which actually loads the resource file, creats a new tracePoint for each of the keys present in this resource file and adds it to the collection of tracePoints.

Returns:
void

addGroup

public boolean addGroup(MQeTracePointGroup newGroup)
Adds a tracePoint sub-group to this renderer.

Parameters:
newGroup - An MQeTracePointGroup object that may contain its member tracePoints.
Returns:
True, if group can be added, False otherwise.

removeGroup

public boolean removeGroup(MQeTracePointGroup group)
Removes a tracePointGroup from this renderer.

Parameters:
group - An MQeTracePointGroup object that is to be removed.
Returns:
True, if the removal operation is successful, False otherwise.

getGroups

public static MQeTracePointGroup[] getGroups()
Retrieves a list of all the logical tracePointGroups.

Returns:
A list of all tracePointGroups currently contained within the renderer object.

getGroup

public static MQeTracePointGroup getGroup(java.lang.String key)
Retrieves a single tracePointGroup.

Returns:
An MQeTracePointGroup Object

getTracePoint

public MQeTracePoint getTracePoint(short msgNumber)
Retrieves information about a particular tracePoint if it exists in any of the available tracePointGroup lists.

Parameters:
msgNumber - A short integer indicating the message number of the tracePoint object to be rendered.
Returns:
An MQeTracePoint object

getMessage

public java.lang.String getMessage(short msgNumber,
                                   java.lang.Object[] args)
                            throws java.lang.Exception
Given a message number and a collection of object references, returns a readable English string.

This will work for any tracePoint which is a member of any of the tracePointGroups added to this renderer.

The object array passed will be used to insert strings into the trace message. For example, if the trace string is "Here. name=#0 age=#1 weight=#2" and an array { "mike" , "36!" , "not telling" } is supplied then output of "Here. name=mike age=36! weight=not telling" would be returned.

Extra parameters supplied, without matching #'s in the trace message are ignored.

If not enough parameters are supplied, and the number of #'s exceed the elements of the object array passed, then those elements supplied will be substituted for, and those #'s left over will remain as # characters.

During the course of rendering to a single string result, the toString() method of each element of the args array. If any throwable problem results, then the name of the exception will be substituted for the # character, and it will continue.

If null is returned from any of the toString() method calls, then the # character will be substituted for "null".

If the args object is null, then it is treated as if there are no substitutions to perform on the messaqe template.

Parameters:
msgNumber - A short value relating to a tracePoint.
args - A java.lang.Object Contains an array of objects. Each object reference provides parameters for substitution.
Returns:
The resultant String, or null if the msgNumber does not relate to a valid trace point.
java.lang.Exception

getBuildName

public static java.lang.String getBuildName()
Provides the version details (build name) of the data used by this class.

Note that this information pertains to the data which this class manipulates and returns, not to the version of trace data you are decoding, or the version of the TracePoint class itself.

To obtain the best results from the trace mechanism, we recommend that you try to match this number with that provided by the readme of the product.

Returns:
a java.lang.String containing the build level. For example, "la000_L020223_P" or null if the data is not derived from an official IBM build of the product.

getBuildVersion

public static short[] getBuildVersion()
Provides the version details (product release number) of the data used by this class.

Note that this information pertains to the data which this class manipulates and returns, not to the version of trace data you are decoding, or the version of the TracePoint class itself.

Returns:
an array of shorts. result[0] contains the major version number of the product.

Websphere MQ Everyplace