java.lang.Object com.ibm.broker.plugin.MbNode
public class MbNode
extends Object
MbNode provides utility methods allowing a plugin node to interact with the broker. The skeleton code for a plugin node is shown on the MbNodeInterface page.
Constructor | Description |
---|---|
MbNode() | Default constructor |
Method | Description |
---|---|
MbInputTerminal createInputTerminal(String) | Creates an input terminal on the node with the specified name. |
MbOutputTerminal createOutputTerminal(String) | Creates an output terminal on the node with the specified name. |
MbSQLStatement createSQLStatement(String, String) | Creates an MbSQLStatement object described in createSQLStatement The transaction type defaults to MbSQLStatement.SQL_TRANSACTION_AUTO |
MbSQLStatement createSQLStatement(String, String, int) | Creates an SQL expression object representing the statement specified by the statement argument, using the syntax as defined for the compute message flow processing node. |
String getAttribute(String) | Gets the value of an attribute on a specific node instance. |
MbBroker getBroker() | Returns an MbBroker object reflecting the broker state associated with this MbNode. |
MbExecutionGroup getExecutionGroup() | Returns an MbExecutionGroup object reflecting the broker state associated with this MbNode. |
MbInputTerminal getInputTerminal(String) | Returns an MbInputTerminal matching the name passed as an argument, or null if the terminal does not exist. |
Vector getInputTerminals() | Returns a Vector containing the input terminals associated with this node. |
MbMessageFlow getMessageFlow() | Returns an MbMessageFlow object reflecting the broker state associated with this MbNode. |
String getName() | Returns the name (label) of the node. |
MbOutputTerminal getOutputTerminal(String) | Returns an MbOutputTerminal matching the name passed as an argument, or null if the terminal does not exist. |
Vector getOutputTerminals() | Returns a Vector containing the output terminals associated with this node. |
void setAttribute(String, String) | Sets the value of an attribute on a specific node instance. |
String toString() | Returns a String representation of the MbNode. |
public MbNode()Default constructor
public MbInputTerminal createInputTerminal(String name) throws MbExceptionCreates an input terminal on the node with the specified name. This must only be called in the node's constructor. Calling this anywhere else will cause MbTerminalCreationException to be thrown.
- Parameters
- name - The name of the terminal.
- Returns
- The new input terminal.
- Throws
public MbOutputTerminal createOutputTerminal(String name) throws MbExceptionCreates an output terminal on the node with the specified name. This must only be called in the node's constructor. Calling this anywhere else will cause MbTerminalCreationException to be thrown.
- Parameters
- name - The name of the terminal.
- Returns
- The new output terminal.
- Throws
public MbSQLStatement createSQLStatement(String dataSourceName, String statement) throws MbExceptionCreates an MbSQLStatement object described in createSQLStatement The transaction type defaults to MbSQLStatement.SQL_TRANSACTION_AUTO
- Parameters
- dataSourceName - The ODBC data source name to be used if the statement references an external database.
- statement - Specifies the SQL expression to be created, using the syntax defined for the compute message flow processing node.
- Returns
- The new SQL expression object
- Throws
public MbSQLStatement createSQLStatement(String dataSourceName, String statement, int transactionType) throws MbExceptionCreates an SQL expression object representing the statement specified by the statement argument, using the syntax as defined for the compute message flow processing node. The MbSQLStatement object returned can be used to execute the statement using its execute or select method. Multiple SQL expression objects can be create in a single message flow processing node. Although these objects can be created at any time, they will be typically created when the node is instantiated, within the node constructor or within an attribute set method if the statement is to be passed in as a node attribute.
- Parameters
- dataSourceName - The ODBC data source name to be used if the statement references an external database.
- statement - Specifies the SQL expression to be created, using the syntax defined for the compute message flow processing node.
- transactionType - Specifies whether a database commit will be performed after the statement is executed. Valid values are:
The former value specifies that a database commit will be performed at the completion of the message flow (that is, as a fully globally coordinated or partially globally coordinated transaction). The latter value specifies that a commit will be performed atfer execution of the statement, and within the execute or select method (that is, the message flow is partially broker coordinated).
- MbSQLStatement.SQL_TRANSACTION_AUTO
- MbSQLStatement.SQL_TRANSACTION_COMMIT
- Returns
- The new SQL expression object
- Throws
- See Also
public String getAttribute(String attributeName) throws MbExceptionGets the value of an attribute on a specific node instance. This can be used to get the values of default broker attributes for the node. User attributes should be declared using standard JavaBean property get/set methods as described in MbNodeInterface. This method should not be called in the node constructor.
- Parameters
- attributeName - The name of the attribute.
- Returns
- The value associated with the attribute represented as a String.
- Throws
public MbBroker getBroker() throws MbExceptionReturns an MbBroker object reflecting the broker state associated with this MbNode. NOTE: This is a snap-shot at the time of the call.
- Returns
- The MbBroker object.
- Throws
public MbExecutionGroup getExecutionGroup() throws MbExceptionReturns an MbExecutionGroup object reflecting the broker state associated with this MbNode. NOTE: This is a snap-shot at the time of the call.
- Returns
- The MbExecutionGroup object.
- Throws
public MbInputTerminal getInputTerminal(String terminalName)Returns an MbInputTerminal matching the name passed as an argument, or null if the terminal does not exist.
- Parameters
- terminalName - The name of the input terminal.
- Returns
- The MbInputTerminal associcated with the name, or null if one does not exist in this node.
public Vector getInputTerminals()Returns a Vector containing the input terminals associated with this node.
- Returns
- Vector containing MbInputTerminal objects.
public MbMessageFlow getMessageFlow() throws MbExceptionReturns an MbMessageFlow object reflecting the broker state associated with this MbNode. NOTE: This is a snap-shot at the time of the call.
- Returns
- The MbMessageFlow object.
- Throws
public String getName()Returns the name (label) of the node. The label is not assigned until the message flow configuration is complete. This method should not be called in the node constructor.
- Returns
- The name of the node
public MbOutputTerminal getOutputTerminal(String terminalName)Returns an MbOutputTerminal matching the name passed as an argument, or null if the terminal does not exist.
- Parameters
- terminalName - The name of the output terminal.
- Returns
- The MbOutputTerminal associcated with the name, or null if one does not exist in this node.
public Vector getOutputTerminals()Returns a Vector containing the output terminals associated with this node.
- Returns
- Vector containing MbOutputTerminal objects.
public void setAttribute(String attributeName, String attributeValue) throws MbExceptionSets the value of an attribute on a specific node instance. This can be used to set the values of default broker attributes for the node. User attributes should be declared using standard JavaBean property get/set methods as described in MbNodeInterface. This method should not be called in the node constructor.
- Parameters
- attributeName - The name of the attribute.
- attributeValue - The new value of the attribute.
- Throws
public String toString()Returns a String representation of the MbNode.
- Returns
- The String representation of the MbNode.
- Overrides
- toString in class Object