New Remote Capabilities for Java Developers in IBM Developer for z/OS 16
With the release of IBM Developer for z/OS (IDz) 16.0.0 comes some exciting new remote capabilities for Java developers. Whether you're extending IDz to provide custom tooling or you're writing applications to run outside of Eclipse, these new capabilities help bring the mainframe to your fingertips!
IBM Java SDK for RSEAPI
The new Java SDK for Remote System Explorer API is available with IBM Developer for z/OS 16. Unlike with web-front-end-oriented languages such as JavaScript, writing Java REST clients can be fair a bit more involved. You have to bring in and manage open source libraries and figure out how to leverage that code in order to exchange data with servers. The Java SDK for RSEAPI takes the tedium out of writing Java clients that use RSEAPI. You can skip all the setup work and jump right into your application logic. With the Java SDK for RSEAPI, you can literally create a functioning z/OS client application from scratch in seconds.
To get started, when you create a Java Project, you can add the IBM RSE API SDK Toolkit Library to the Classpath using the following wizard.
RSE has a service for storing and retrieving data that first surfaced as part of RSE API 1.0.8. These APIs allow users to create and manipulate shared data pools on the mainframe so that you can programmatically get and set information within your applications. It's a little bit like a file-store database that uses JSON format but without the need for a separate installation, licenses and configuration. More background information can be found in
this blog.
In order to work with these APIs you need a configured server and a client. To learn how to configure your server(s), look for the Common Properties settings in the
host configuration docs. As for clients, some programming languages like JavaScript and Python make calling REST APIs easy, so accessing Common Properties over RSEAPI can be done with minimal work. Writing a Java client is a bit harder unless, of course, you're using the new Java SDK for RSEAPI.
How about if you're writing Eclipse plugins to extend IDz and you want to make use of your existing IDz z/OS RSE connections? As of IDz 16 you can use the new Common Properties subsystem. Unlike the MVS Files or the z/OS UNIX Files subsystem, you won't see Common Properties subsystem in any IDz views. It's hidden because it's surfaced as a supporting API for programmatically managing remote metadata.
In the following example, a new Eclipse plugin is used to contribute context menu actions to the Remote Systems views IDz. Below is the manifest used to configure this project.
Once the manifest is created, you can add action contributions to the plugin.xml file. In this example, two actions are contributed: one to remember a selected MVS resource and another to list the remembered resources in the Remote Console.
The "Remember" action takes a selected MVS resource, creates a JSON to represent it, then appends it to the list of favorites before writing it out to Common Properties. The access level is private, which means these properties are only accessible to a given end user.
When IDz is started with the new extension, a user can select a data set or a member and then run the "Remember" action to save the resource info.
Because the Remote Console knows how to identify file resources, the printed results have hyperlinks which could be clicked to navigate to the remembered resources.
Because Common Properties are persisted on the host, a user can retrieve the same information again in subsequent IDz sessions as well as in other workspaces that use the same Common Properties location.
Conclusion
We've shown you two new ways to extend and contribute new remote capabilities using Java. First, the Java SDK for RSEAPI makes it easy to write Java applications that access the mainframe. It can be used to extend IDz or to create applications that run outside of Eclipse. Second, the Common Properties Subsystem helps you write Java plugins for IDz that can leverage both private and public properties stores hosted on the mainframe. Stay tuned for more blog posts on these topics and happy tool writing!