Deploying resources to an integration node by using a custom integration application

Deploy BAR files to the integration nodes in your integration node network by using a custom integration application.

About this task

You can also check the result of a deployment by using the IBM® Integration API.

To use the IBM Integration API to deploy files and check the results:

Procedure

  1. Connect to the integration node by clicking File > Connect to Local Integration node or File > Connect to Remote Integration node.
    This action opens the Connect to Integration node dialog.
  2. Enter the relevant connection parameters in the dialog.
    A hierarchical representation of the integration node and its resources is displayed.
  3. Complete one or more of the following operations:
    • Click an object in the tree to display the attributes of that object.
    • Right-click an object in the tree to call IBM Integration API methods that manipulate that object. For example, right-clicking an integration node opens a menu that includes the items Start user trace.
    • Use the log pane to view useful information that relates to the operation in progress.

Example

The following example custom integration application connects to an integration node that is running on the local computer. The integration node is listening for RestAdminListener requests on the web administration port (the default is 4414). The code deploys a BAR file that is called MyBAR.bar to an integration server called default that is running on the integration node, and displays the result.

import com.ibm.integration.admin.model.common.LogEntry;
import com.ibm.integration.admin.model.server.DeployResult;
import com.ibm.integration.admin.proxy.IntegrationAdminException;
import com.ibm.integration.admin.proxy.IntegrationNodeProxy;
import com.ibm.integration.admin.proxy.IntegrationServerProxy;


public class DeployExample {

	public static void main(String[] args) {
		IntegrationNodeProxy node = new IntegrationNodeProxy("localhost",4414,"","",false);
		try {
			IntegrationServerProxy server = node.getIntegrationServerByName("server1");
			DeployResult result  = server.deploy("C:\\temp\\mybarfile.bar"); 
			int deployStatus = server.getLastHttpResponse().getStatusCode(); 
			if (deployStatus >= 400)
			{
				System.out.println("Http response error: " + deployStatus );
			}
			else
			{	// deploy worked, check for any Log entries  
				LogEntry[] logEntries  = result.getLogEntry(); 
				if (logEntries != null)
				{
					for (LogEntry logEntry: logEntries)
					{
						System.out.println("Deploy log entry: "+logEntry.getDetailedText());  
					}
				}
			}	
		} catch (IntegrationAdminException e) {
			System.out.println("Error connecting: "+e);
		}
	}
}