Connecting to an integration node from a custom integration application
Connect an application that uses the IBM® Integration API to an integration node, to send requests about its status and its resources.
Before you begin
You must complete the steps in Configuring an environment for developing and running custom integration applications.
About this task
Review the following example application, IntegrationNodeStateChecker.java
,
which demonstrates how to use the IBM Integration
API classes:
import com.ibm.integration.admin.proxy.*;
public class IntegrationNodeStateChecker {
public static void main(String[] args) {
// The IP address of where the integration node is running
// and the web administration port number of the integration node.
displayNodeRunState("localhost", 4414);
}
public static void displayNodeRunState(String hostname, int port) {
IntegrationNodeProxy node = new IntegrationNodeProxy(hostname,port,"","",false);
try {
String nodeName = node.getName();
System.out.println("Integration node '"+nodeName+
"' is available!");
} catch (IntegrationAdminException ex) {
System.out.println("Integration node is NOT available"+
" because "+ex);
}
}
}
This example application connects to a remote integration node.
Review each part of the application that uses the IBM Integration API to understand what is required to connect to an integration node. Use the following steps to assist you in creating your own custom integration applications.
Procedure
The first line of code inside the try
block
of the displayNodeRunState() method instantiates
an IntegrationNodeProxy
object. IntegrationNodeProxy
is
an interface that states that implementing classes are able to provide
the parameters to connect to an integration node.
- The host name of the computer that the integration node is running on.
- The web administration port (the default is 4414). For more information about port numbers for an integration node, see Configuring the IBM App Connect Enterprise web user interface.
IntegrationNodeConnectionParameters node = new IntegrationNodeConnectionParameters(hostname,port,"userid","password",false);
Results
You can create a custom integration application that can connect to an integration node.