com.ibm.db2.tools.repl.publication
Class Msg

java.lang.Object
  |
  +--com.ibm.db2.tools.repl.publication.Msg
Direct Known Subclasses:
DataMsg, InformationalMsg

public abstract class Msg
extends java.lang.Object

The Msg class is the base class for the hierarchy of XML publication messages. All messages are a subclass of this class. Generally, you need to cast the object to the correct subclass.


Field Summary
protected  java.lang.String dbName
           
protected  javax.jms.Message jmsMsg
           
protected static java.lang.String topicHeader
           
 
Constructor Summary
Msg()
           
 
Method Summary
 java.lang.String getDbName()
          This allows access to the dbName attribute of the xml message
 javax.jms.Message getJMSMessage()
          Access the navite JMS MQ message.
 java.lang.Object getObjectProperty(java.lang.String propertyName)
          Access a specific property in the native MQ message.
 java.util.Enumeration getPropertyNames()
          Access all the property names that are in the native MQ message.
 java.lang.String getTopic(boolean stripHeader)
          Access the name of the topic that was specified during the definition of the xml publication.
 void setDbName(java.lang.String dbName)
          This method has no effect when used by a PublicationListener.
 void setJMSMessage(javax.jms.Message m)
          This method has no effect when used by a PublicationListener.
 java.lang.String toString()
          Override so we can print the values in a nice textual format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

topicHeader

protected static final java.lang.String topicHeader
See Also:
Constant Field Values

dbName

protected java.lang.String dbName

jmsMsg

protected javax.jms.Message jmsMsg
Constructor Detail

Msg

public Msg()
Method Detail

getDbName

public java.lang.String getDbName()
This allows access to the dbName attribute of the xml message

Returns:
String The database name

getTopic

public java.lang.String getTopic(boolean stripHeader)
Access the name of the topic that was specified during the definition of the xml publication. Note that the topic name in JMS has a header attached. If you want to see the topic string exactly as it was given when defining the publication, you need to pass "true" so the header is removed.

Parameters:
stripHeader - True: Remove the "topic://" header. False: Return complete JMS topic name
Returns:
String The name of the topic. Null if not specified.

getPropertyNames

public java.util.Enumeration getPropertyNames()
Access all the property names that are in the native MQ message.

Returns:
Eumeration A set of all the valid property names.

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String propertyName)
Access a specific property in the native MQ message.

Returns:
Object The value of the property, or null if not defined.

getJMSMessage

public javax.jms.Message getJMSMessage()
Access the navite JMS MQ message.

Returns:
Message The message

setDbName

public void setDbName(java.lang.String dbName)
This method has no effect when used by a PublicationListener.

Parameters:
dbName - The name of the db

setJMSMessage

public void setJMSMessage(javax.jms.Message m)
This method has no effect when used by a PublicationListener.

Parameters:
m - The JMS message

toString

public java.lang.String toString()
Override so we can print the values in a nice textual format.

Overrides:
toString in class java.lang.Object
Returns:
String Formatted output of all the instance variables.