com.ibm.broker.config.proxy
Class MessageFlowProxy

java.lang.Object
  extended by com.ibm.broker.config.proxy.AdministeredObject
      extended by com.ibm.broker.config.proxy.MessageFlowProxy
All Implemented Interfaces:
DeployableObject, DeployedObject

public class MessageFlowProxy
extends AdministeredObject
implements DeployedObject

Represents a message flow that has been deployed to an execution group. In order to use MessageFlowProxy objects, applications must first obtain handles to them. Here is an example of how to do this:

     ConfigManagerConnectionParameters cmcp =
         new MQConfigManagerConnectionParameters("localhost", 1414, "QMGR");
     ConfigManagerProxy cmp = ConfigManagerProxy.getInstance(cmcp);
     TopologyProxy t = cmp.getTopology();
     BrokerProxy b = t.getBrokerByName("BROKER1");
     ExecutionGroupProxy e = b.getExecutionGroupByName("default");
     MessageFlowProxy m = e.getMessageFlowByName("mf1");
 

com.ibm.broker.config.proxy.MessageFlowProxy extends com.ibm.broker.config.proxy.AdministeredObject implements com.ibm.broker.config.proxy.DeployedObject

Responsibilities Represents the state of a message flow that has been deployed to an execution group.
Internal Collaborators None

 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 25103.8  2004-03-18  HDMPL           v6 Release
 45112.7  2007-07-30  HDMPL           v6.1 Release:
                                         Methods now return genericized types where relevant 
                                         Added getQueues()
                                         Added getNodeTypes()
                                         Added setAdditionalInstances(String)
                                         Added getPolicySetBindingNames(long)
                                         Added getPolicySetNames(long)
 

Version:
Config/com/ibm/broker/config/proxy/MessageFlowProxy.java, CMP, S000 1.50

Nested Class Summary
static class MessageFlowProxy.UserTrace
          A small structure that represents all the possible types of user trace.
 
Field Summary
 
Fields inherited from interface com.ibm.broker.config.proxy.DeployableObject
BARNAME_KEYWORD, VERSION_KEYWORD
 
Method Summary
 int getAdditionalInstances()
          Returns the value of the "AdditionalInstances" parameter as it was set when originally deployed in the Bar file.
 java.lang.String getBARFileName()
          Returns the name of the BAR file that was used to deploy the message flow to the execution group.
 int getCommitCount()
          Returns the value of the "CommitCount" parameter
 int getCommitInterval()
          Returns the value of the "CommitInterval" parameter
 ConfigurationObjectType getConfigurationObjectType()
          Returns the ConfigurationObjectType associated with this AdministeredObject type.
 ConfigurationObjectType getConfigurationObjectTypeOfParent()
          Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.
 boolean getCoordinatedTransaction()
          Returns the value of the "CoordinatedTransaction" parameter
 java.util.Date getDeployTime()
          Returns the time that the current message flow was last received by the Configuration Manager for deployment to the execution group.
 ExecutionGroupProxy getExecutionGroup()
          Returns a reference to the execution group on which this message flow was deployed.
 java.lang.String getFileExtension()
          Returns the file extension relevant to message flows.
 java.lang.String getFullName()
          Returns the name of the current deployable as it existed in the BAR file at deployment time- including any file extension but excluding any path information.
 java.lang.String[] getKeywords()
          Returns the set of keywords for this deployed object which were found embedded in the object at deploy time.
 java.lang.String getKeywordValue(java.lang.String keyword)
          Returns the value of the supplied keyword.
 java.util.Date getModifyTime()
          Returns the time that the current message flow was last modified, according to the file modification associated with the cmf file in the broker archive.
 java.lang.String[] getNodeTypes()
          Returns a list of the types of nodes used in this message flow.
 java.lang.String[] getPolicySetBindingNames(long timeToWaitMs)
          Asks the broker to return the names of the policy set bindings in use by this message flow.
 java.lang.String[] getPolicySetNames(long timeToWaitMs)
          Asks the broker to return the names of the policy sets in use by this message flow.
 java.lang.String[] getQueues()
          Returns a list of the MQ queues referenced by this message flow.
 MessageFlowProxy.UserTrace getUserTrace()
          Returns the current state of user trace for this message flow
 java.lang.String getVersion()
          Returns the version string associated with the current message flow.
 boolean isRunning()
          Returns true if the Message Flow is running.
 void setAdditionalInstances(int newValue)
          Attempts to ask the broker to directly set the value of the Additional Instances property for this message flow.
 void setUserTrace(MessageFlowProxy.UserTrace newTrace)
          Configures the user trace setting for the current flow.
 void start()
          Requests that the messageflow.runstate attribute be set to "running", which causes the message flow to start.
 void stop(boolean immediate)
          Requests that the messageflow.runstate attribute be set to "stopped", which causes the message flow to stop.
static java.util.Properties withName(java.lang.String name)
          Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used.
static java.util.Properties withUUID(java.lang.String uuid)
          Returns a new Properties object that has the UUID attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used.
 
Methods inherited from class com.ibm.broker.config.proxy.AdministeredObject
deregisterListener, deregisterListener, elements, getLastBIPMessages, getLastCompletionCode, getLastUpdateUser, getLongDescription, getManagedSubcomponent, getManagedSubcomponentFromStringRepresentation, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponents, getManagedSubcomponentsAsStrings, getManagedSubcomponentsAsStrings, getName, getNumberOfSubcomponents, getParent, getProperties, getProperty, getProperty, getProperty, getProperty, getRepositoryTimestamp, getShortDescription, getTimeOfLastCompletionCode, getTimeOfLastUpdate, getType, getUUID, hasBeenRestrictedByConfigManager, hasBeenRestrictedByConfigManager, hasBeenUpdatedByConfigManager, hasBeenUpdatedByConfigManager, isAwaitingSubmissionForCreation, isAwaitingSubmissionForDeletion, isDeployed, isShared, refresh, registerListener, registerListener, registerListener, setLongDescription, setName, setProperties, setShortDescription, toString, toVerboseString, unsubscribeFromConfigurationManagerUpdates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.broker.config.proxy.DeployableObject
getName
 

Method Detail

start

public void start()
           throws ConfigManagerProxyLoggedException

Requests that the messageflow.runstate attribute be set to "running", which causes the message flow to start.

Throws:
ConfigManagerProxyLoggedException - if the request to start the message flow could not be sent to the Configuration Manager

stop

public void stop(boolean immediate)
          throws ConfigManagerProxyLoggedException
Requests that the messageflow.runstate attribute be set to "stopped", which causes the message flow to stop.

Parameters:
immediate - True only if the 'immediate' flag should be used.
Throws:
ConfigManagerProxyLoggedException - if the request to start the message flow could not be sent to the Configuration Manager

getUserTrace

public MessageFlowProxy.UserTrace getUserTrace()
                                        throws ConfigManagerProxyPropertyNotInitializedException
Returns the current state of user trace for this message flow

Returns:
MessageFlowProxy.UserTrace One of:
  • MessageFlowProxy.UserTrace.normal means that normal user trace is enabled
  • MessageFlowProxy.UserTrace.debug means that debug user trace is enabled
  • MessageFlowProxy.UserTrace.none means that user trace is disabled
  • MessageFlowProxy.UserTrace.unknown means that user trace settings are unknown
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the value of the field could not be determined because the value has not yet been supplied to us from the Configuration Manager.

setUserTrace

public void setUserTrace(MessageFlowProxy.UserTrace newTrace)
                  throws ConfigManagerProxyLoggedException

Configures the user trace setting for the current flow.

Parameters:
newTrace - One of:
  • MessageFlowProxy.UserTrace.normal to enable normal user trace
  • MessageFlowProxy.UserTrace.debug to enable debug user trace
  • MessageFlowProxy.UserTrace.none to disable user trace
Throws:
ConfigManagerProxyLoggedException - if the request could not be sent to the Configuration Manager.

isRunning

public boolean isRunning()
                  throws ConfigManagerProxyPropertyNotInitializedException

Returns true if the Message Flow is running.

Returns:
boolean - True if and only if the flow is running.
Throws:
ConfigManagerProxyPropertyNotInitializedException - - if, due to the administered object not having been updated by the Configuration Manager yet, the value of the run state is unknown.

getAdditionalInstances

public int getAdditionalInstances()
                           throws ConfigManagerProxyPropertyNotInitializedException
Returns the value of the "AdditionalInstances" parameter as it was set when originally deployed in the Bar file. Any subsequent changes to this parameter (through setAdditionalInstances) are not reflected here.

Returns:
int AdditionalInstances parameter
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the value of the field could not be determined because the value has not yet been supplied to us from the Configuration Manager.

setAdditionalInstances

public void setAdditionalInstances(int newValue)
                            throws ConfigManagerProxyLoggedException
Attempts to ask the broker to directly set the value of the Additional Instances property for this message flow. Any changes to this the runtime property are not reflected in the getAdditionalInstances() return value, which only returns the value of the property as it was originally deployed.

Parameters:
newValue - New value to assign to the AdditionalInstances parameter.
Throws:
ConfigManagerProxyLoggedException - if a request could not be sent to the Configuration Manager

getCommitCount

public int getCommitCount()
                   throws ConfigManagerProxyPropertyNotInitializedException
Returns the value of the "CommitCount" parameter

Returns:
int CommitCount parameter
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the value of the field could not be determined because the value has not yet been supplied to us from the Configuration Manager.

getCommitInterval

public int getCommitInterval()
                      throws ConfigManagerProxyPropertyNotInitializedException
Returns the value of the "CommitInterval" parameter

Returns:
String CommitInterval parameter
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the value of the field could not be determined because the value has not yet been supplied to us from the Configuration Manager.

getCoordinatedTransaction

public boolean getCoordinatedTransaction()
                                  throws ConfigManagerProxyPropertyNotInitializedException
Returns the value of the "CoordinatedTransaction" parameter

Returns:
boolean CoordinatedTransaction parameter
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the value of the field could not be determined because the value has not yet been supplied to us from the Configuration Manager.

withUUID

public static java.util.Properties withUUID(java.lang.String uuid)
Returns a new Properties object that has the UUID attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get* calls. For example, broker1.getExecutionGroup(ExecutionGroup.withUUID("1234")); will return the Execution Group with UUID "1234" that exists in broker1.

Returns:
java.util.Properties - a new Properties object with the relevant key/value pairs set.

withName

public static java.util.Properties withName(java.lang.String name)
Returns a new Properties object that has the name attribute set to the supplied String, and the type attribute to be the name of the subclass of AdministeredObject being used. This provides an easy way of supplying filters to the get* calls. For example, broker1.getExecutionGroup(ExecutionGroup.withName("eg1")); will return the Execution Group with Name "eg1" that exists in broker1.

Returns:
java.util.Properties - a new Properties object with the relevant key/value pairs set.

getFileExtension

public java.lang.String getFileExtension()
Returns the file extension relevant to message flows. Currently, this is the constant string "cmf".

Specified by:
getFileExtension in interface DeployableObject
Returns:
String file extension
See Also:
DeployableObject.getFileExtension()

getFullName

public java.lang.String getFullName()
                             throws ConfigManagerProxyPropertyNotInitializedException
Returns the name of the current deployable as it existed in the BAR file at deployment time- including any file extension but excluding any path information.

Specified by:
getFullName in interface DeployableObject
Returns:
String name of the deployable
Throws:
ConfigManagerProxyPropertyNotInitializedException - If information on the name was not supplied by the Configuration Manager before a timeout occurred.

getDeployTime

public java.util.Date getDeployTime()
Returns the time that the current message flow was last received by the Configuration Manager for deployment to the execution group. This method will return null if the application is connected to a v5 Configuration Manager, or if the message flow was deployed using a v5 Configuration Manager.

Specified by:
getDeployTime in interface DeployedObject
Returns:
Date the time of the most recent deployment.
See Also:
DeployedObject.getDeployTime()

getModifyTime

public java.util.Date getModifyTime()
Returns the time that the current message flow was last modified, according to the file modification associated with the cmf file in the broker archive. This method will return null if the application is connected to a v5 Configuration Manager, or if the message flow was deployed using a v5 Configuration Manager.

Specified by:
getModifyTime in interface DeployableObject
Returns:
Date the time of the last modification.
See Also:
DeployableObject.getModifyTime()

getKeywords

public java.lang.String[] getKeywords()
                               throws ConfigManagerProxyPropertyNotInitializedException
Returns the set of keywords for this deployed object which were found embedded in the object at deploy time. Use DeployedObject.getKeywordValue() to look up the value of a given keyword.

See the DeployedObject class for an overview of how to associate keywords with deployed objects.

Specified by:
getKeywords in interface DeployableObject
Returns:
String[] the set of keywords that were found.
Throws:
ConfigManagerProxyPropertyNotInitializedException - If information on the set of keywords was not supplied by the Configuration Manager before a timeout occurred.
See Also:
DeployableObject.getKeywords()

getKeywordValue

public java.lang.String getKeywordValue(java.lang.String keyword)
                                 throws ConfigManagerProxyPropertyNotInitializedException
Returns the value of the supplied keyword. If the supplied keyword was not found during the deployment of this object, this method returns null.

See the DeployedObject class for an overview of how to associate keywords with deployed objects.

Specified by:
getKeywordValue in interface DeployableObject
Parameters:
keyword - The keyword to look up
Returns:
String value of the supplied keyword, or null if the keyword could not be found for the object.
Throws:
ConfigManagerProxyPropertyNotInitializedException - If information on the deployed object was not supplied by the Configuration Manager before a timeout occurred.
See Also:
DeployableObject.getKeywordValue(java.lang.String)

getVersion

public java.lang.String getVersion()
                            throws ConfigManagerProxyPropertyNotInitializedException
Returns the version string associated with the current message flow. If the version string was not set by the user the return value is not specified. If the application is connected to a v5 Configuration Manager, or if the message flow was deployed using a v5 Configuration Manager, the return value is null.

Specified by:
getVersion in interface DeployableObject
Returns:
String version information
Throws:
ConfigManagerProxyNotInitializedException - If information on this broker's queue manager has not yet been supplied by the Configuration Manager.
ConfigManagerProxyPropertyNotInitializedException - If information on the version was not supplied by the Configuration Manager before a timeout occurred.
See Also:
DeployableObject.getVersion()

getBARFileName

public java.lang.String getBARFileName()
                                throws ConfigManagerProxyPropertyNotInitializedException
Returns the name of the BAR file that was used to deploy the message flow to the execution group. This method will return null if:

Specified by:
getBARFileName in interface DeployedObject
Returns:
String name of the BAR file that deployed the message flow
Throws:
ConfigManagerProxyPropertyNotInitializedException - If information on the name was not supplied by the Configuration Manager before a timeout occurred.

getExecutionGroup

public ExecutionGroupProxy getExecutionGroup()
                                      throws ConfigManagerProxyLoggedException
Returns a reference to the execution group on which this message flow was deployed. This method is the same as calling getParent(), except that getExecutionGroup() returns an ExecutionGroupProxy object rather than an object of the parent AdministeredObject type.

Specified by:
getExecutionGroup in interface DeployedObject
Returns:
ExecutionGroup
Throws:
ConfigManagerProxyLoggedException - if the parent object is not immediately available and has to be requested from the Configuration Manager, but the request could not be sent to the Configuration Manager.
See Also:
DeployedObject.getExecutionGroup()

getConfigurationObjectType

public ConfigurationObjectType getConfigurationObjectType()
Returns the ConfigurationObjectType associated with this AdministeredObject type.

Specified by:
getConfigurationObjectType in class AdministeredObject
Returns:
ConfigurationObjectType associated with this class.

getConfigurationObjectTypeOfParent

public ConfigurationObjectType getConfigurationObjectTypeOfParent()
Returns the ConfigurationObjectType associated with the logical parent of this AdministeredObject type.

Specified by:
getConfigurationObjectTypeOfParent in class AdministeredObject
Returns:
ConfigurationObjectType associated with the logical parent of this class.

getPolicySetNames

public java.lang.String[] getPolicySetNames(long timeToWaitMs)
                                     throws ConfigManagerProxyPropertyNotInitializedException
Asks the broker to return the names of the policy sets in use by this message flow.

The property is discovered directly and synchronously from the broker runtime and will block until the broker has responded or the timeout condition set by the timeToWaitMs value is reached. The value is not cached on the Configuration Manager or within the Configuration Manager Proxy. Therefore, it is advisable to call this method sparingly.

Parameters:
timeToWaitMs - Maximum time (in milliseconds) to wait for the response from the broker to arrive. A value of -1 will cause the method to block indefinitely, until the broker responds.
Returns:
String[] the names of the policy sets
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the information has not yet been supplied by the Configuration manager.

getPolicySetBindingNames

public java.lang.String[] getPolicySetBindingNames(long timeToWaitMs)
                                            throws ConfigManagerProxyPropertyNotInitializedException
Asks the broker to return the names of the policy set bindings in use by this message flow.

The property is discovered directly and synchronously from the broker runtime and will block until the broker has responded or the timeout condition set by the timeToWaitMs value is reached. The value is not cached on the Configuration Manager or within the Configuration Manager Proxy. Therefore, it is advisable to call this method sparingly.

Parameters:
timeToWaitMs - Maximum time (in milliseconds) to wait for the response from the broker to arrive. A value of -1 will cause the method to block indefinitely, until the broker responds.
Returns:
String[] the names of the deployed policy set bindings
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the information has not yet been supplied by the Configuration manager.

getQueues

public java.lang.String[] getQueues()
                             throws ConfigManagerProxyPropertyNotInitializedException
Returns a list of the MQ queues referenced by this message flow. Only queues directly referenced by the following nodes are reported: Each element of the returned list contains any queue name parameter that was specified when the flow was deployed. If a queue manager name was also supplied this will be described in the same element, before the queue name and separated by a forward slash character ('/') - for example, "WBRK6_DEFAULT_QUEUE_MANAGER/TEST.QUEUE". The slash character is defined by the constant AttributeConstants.MESSAGEFLOW_QMGRQUEUE_DELIMITER.

This method will return an empty array if the connected Configuration Manager is of a version less than v6.1, or if the message flow was deployed through a Configuration Manager of a version earlier than v6.1.

Returns:
String[] the names of the queues that were specified during deployment
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the information has not yet been supplied by the Configuration manager.

getNodeTypes

public java.lang.String[] getNodeTypes()
                                throws ConfigManagerProxyPropertyNotInitializedException
Returns a list of the types of nodes used in this message flow. The names returned are the internal names, which are unique for every node type.

This method will return an empty array if the connected Configuration Manager is of a version less than v6.1, or if the message flow was deployed through a Configuration Manager of a version earlier than v6.1.

Returns:
String[] the names of the node types that were specified during deployment
Throws:
ConfigManagerProxyPropertyNotInitializedException - if the information has not yet been supplied by the Configuration manager.