Development and Pipeline

Development and Pipeline

Development and Pipeline

Connecting mainframe application developers to discuss efficiently creating and maintaining z/OS applications

 View Only

New Remote Capabilities for Java Developers in IBM Developer for z/OS

By Dave McKnight posted Fri October 21, 2022 05:21 PM

  

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.

Thereafter, the Java project will support use of the Java SDK for RSEAPI library to write code that talks to your mainframes.  You can take advantage of rich editing support, including content assist, auto-complete, hover help, code templates and refactoring, among other things.  The following sample prints a sorted list of address spaces. 
Sample Application Using the Java SDK for RSEAPI


Once you're ready to test your application, running or debugging is just a couple clicks away.

It's that easy!   Now you can see the output in the console view, step through code, use breakpoints, inspect variables and take advantage of other features provided by the Java Application debugger for analyzing your application.
Debugging a sample application with the SDK

Keep watching this community for a more in-depth look at the Java SDK for RSEAPI.

Common Properties Subsystem

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.

After adding various favorites, users will want to be able to see what's been added.  PrintRememberedAction.java retrieves the list of remembered resources from Common Properties and writes them to the console.

From the host context menu, a user can run the "Print Remembered" action.
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!

  




0 comments
59 views

Permalink