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
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);
}
}
}