Integrating z/OS applications with the rest of the world

Many mainframe applications were built in an era where little integration with other applications was needed. Where integrations were needed, this was mostly done through the exchange of files. For example, for the exchange of information between organizations. In the 1990s the dominance of the mainframe applications ended and client-server applications emerged. These new applications required more extensive and real-time integrations with existing mainframe applications. In this period many special integration tools and facilities were built to make it possible to integrate z/OS applications and new client-server applications. In this chapter I will highlight categories of these integration tools that are available on z/OS, from screen-scraping tools to modern integrations supporting the latest REST API interfaces. File interfaces The mainframe was designed for batch processing. Therefore integration via files is traditionally well catered for and straightforward. You can use multiple options to exchange files between applications on z/OS and other platforms. Network File System Network File System (NFS) is a common protocol that you can use to create a shared space where you can share files between applications. Although it was originally mostly used with Unix operating systems, it is now built into most other operating systems, including z/OS. NFS solutions however are usually not a preferred option due to security and availability challenges. FTP The File Transfer Protocol (FTP) is a common protocol to send files over a TCP/IP network to a receiving party, and it is also supported on z/OS. With FTP a script or program can be written to automatically transfer a file as part of an automated process. FTP can be made very secure with cryptographic facilities. FTP is built into most operating systems, including z/OS. Managed File Transfer Managed file transfer is also a facility to send files over a network, but the “Managed” in the category means a number of additional features are added. Managed file transfer solutions make file transfers more reliable and manageable. A number of additional operational tasks and security functions related to file exchange are automated. Managed file transfer tools provide enhanced encryption facilities, some form of strong authentications, integration with existing security repositories, handling of failed transfers with resend functionality, reporting of file transfer operations, and more extensive API’s. On z/OS a number of managed file transfer tools are available as separate products: IBM has Connect:Direct and MQ-FTE, CA/Broadcom has Netmaster file transfer and XCOM, BMC provides Control-M  and there are other less commonly known tools. Message queueing Message queuing is a generic manner for applications to communicate with each other in a point-to-point manner. With message queuing applications remain de-coupled, so they are less dependent on each other’s availability and response times. Applications can be running at different times and communicate over networks and systems that may be temporarily down. As we will see in the next section, when using alternative point-to-point protocols like web services, both applications and intermediate infrastructures must be available for successful application communications. The basic notion of message queuing is that an application…

IBM Integration Bus / Message Broker operations with IBM Integration API aka CMP

IBM provides the IBM Integration API, also known under the less accurate and descriptive name Configuration Manager Proxy (CPM), through which you can write your applications to control IBM Integration Bus components. The Java code below provices a working example of this API. The code presented revolves around a BrokerManager class. In the code below only one method on this class has been implemented, but it can easily be extended with other methods.  The code uses a z/OS specific way to connect to a broker. On z/OS we do not connect through the network but locally. This needs a slightly different approach using the getLocalInstance method on the Broker Proxy API. The main() method in this sample implements the instantiation and invocation of the BrokerManager, implementing a command line solution, but the same code could be used in different contexts seamlessly. The documentation of the API can be found in the IBM Integration Bus Knowledge Center. Information for the App Connect enterprise version can be found through this link. I have not tried that version. package com.your.company.package.broker; import com.ibm.broker.config.proxy.AdministeredObject; import com.ibm.broker.config.proxy.AdministeredObjectListener; import com.ibm.broker.config.proxy.ApplicationProxy; import com.ibm.broker.config.proxy.AttributeConstants; import com.ibm.broker.config.proxy.BrokerConnectionParameters; import com.ibm.broker.config.proxy.BrokerProxy; import com.ibm.broker.config.proxy.CompletionCodeType; import com.ibm.broker.config.proxy.ConfigManagerProxyException; import com.ibm.broker.config.proxy.ConfigManagerProxyLoggedException; import com.ibm.broker.config.proxy.ConfigManagerProxyPropertyNotInitializedException; import com.ibm.broker.config.proxy.ExecutionGroupProxy; import com.ibm.broker.config.proxy.LogEntry; import com.ibm.broker.config.proxy.MQBrokerConnectionParameters; import com.ibm.broker.config.proxy.MQPropertyFileBrokerConnectionParameters; import com.ibm.broker.config.proxy.MessageFlowProxy; import com.ibm.mq.MQException; import java.util.Enumeration; public class BrokerManager {     private BrokerProxy bp;     private String bn;     private String qm;     private String hn;     private int port;     BrokerManager(String broker, String host, String qmgr, int port) {         this.bn = broker;         this.qm = qmgr;         this.hn = host;         this.port = port;         System.out.println("Creating Broker Manager " + this.bn);     }     public boolean connect() {         BrokerConnectionParameters bcp;         boolean brokerIsResponding = false;         // bcp = new MQBrokerConnectionParameters(this.hn, this.port, this.qm);         // Not for z/OS         // bcp = new MQBrokerConnectionParameters("", this.port, this.qm); but we will use         // getLocalInstance for z/OS below         try {             this.bp = BrokerProxy.getLocalInstance(this.bn);             // alternative this.bp = BrokerProxy.getInstance(bcp);             // Ensure the broker is actually talking to us.             brokerIsResponding = bp.hasBeenPopulatedByBroker(true);             if (brokerIsResponding) {                 System.out.println("Broker" + this.hn + " broker " + this.bn + "is responding");             } else {                 System.err.println("Broker" + this.bn + "is not responding");                 this.bp.disconnect();                 this.bp = null;             }         } catch (ConfigManagerProxyLoggedException e) {             System.err.println("Broker" + this.bn + " CONNECT failed" + e.toString());         }         return brokerIsResponding;     }     public boolean setStartMode(String exg, String sm) {         // Set startmode for all flows in given execution group         //         // AttributeConstants.STARTMODE_MAINTAINED which means at deploy time or         // restart the message flow will start based on its isRunEnabled value.         // AttributeConstants.STARTMODE_MANUAL which means at deploy time or         // restart the message flow will be stopped.         // AttributeConstants.STARTMODE_AUTOMATIC         this.bp.setSynchronous(15000);         boolean result = false;         try {             Enumeration<ExecutionGroupProxy> listEG = this.bp.getExecutionGroups(null);             while (listEG.hasMoreElements()) {                 ExecutionGroupProxy eg = listEG.nextElement();                 if (eg.getName().equalsIgnoreCase(exg)) {                     System.out.println("Connected to execution group " + exg );                     Enumeration<MessageFlowProxy> listMsgFlow = eg.getMessageFlows(null);                     while (listMsgFlow.hasMoreElements()) {                         MessageFlowProxy flow = listMsgFlow.nextElement();                         if (sm.equalsIgnoreCase("maintained")) {                             flow.setStartMode(AttributeConstants.STARTMODE_MAINTAINED);                         } else if (sm.equalsIgnoreCase("manual")) {                             flow.setStartMode(AttributeConstants.STARTMODE_MANUAL);                         } else if (sm.equalsIgnoreCase("automatic")) {                             flow.setStartMode(AttributeConstants.STARTMODE_AUTOMATIC);                         }                         System.out.println(flow.getName() + " startmode set to " + sm);                     }                 }             }         } catch (Exception e) {             System.err.println("Error " + e.toString() +…