X

Geertjan's Blog

  • December 22, 2014

Integrating Cloud Providers into NetBeans IDE (Part 6)

Geertjan Wielenga
Product Manager

A mistake I made in part 3 was to assume that the user of a Cloud provider plugin would, when creating a new application to be deployed to the Cloud, use one of the standard NetBeans IDE project templates as a starting point. Instead of that, however, it is much more likely that the user will want to use one of the templates that the Cloud provider itself makes available.

In the case of OpenShift by Red Hat, those templates are called "cartridges". Let's enable the user of OpenShift in NetBeans IDE to select one or more cartridges made available via the OpenShift Java Client.

But before actually using the OpenShift Java Client to create new applications via OpenShift cartridges, there are three nitpicky areas to focus on, to make the life of the user a lot better than it would otherwise be—(1) validation of entries in the GUI in NetBeans for creating new OpenShift applications, (2) handling of long running tasks, and (3) handling of exceptions thrown by the OpenShift Java Client.

For the first item in the list, below you see the result, the Simple Validation API by Tim Boudreau married with the validation mechanism in the NetBeans Wizard API, thanks to page 580 and onwards (and earlier) in Paul and Gails' JavaFX Rich Client Programming on the NetBeans Platform:

Next, a rather tricky problem arises because, after filling out the above wizard step, one clicks Next, at which point a long running task starts up because the OpenShift Java Client needs to access and display the available cartridges, as well as other information, such as the available domains. That's the second item in the list above, my solution being an implementation of a solution from Chet and Romain's Filthy Rich Client book, as discussed by me here some years ago.

Once the above process completes, the available domains and cartridges are displayed, while the same validation techniques are used to switch on/off the Finish button, based on whether the Simple Validation API code has done its job.

The third problem, around exception handling of OpenShift exceptions, e.g., if the connection fails or if the password is wrong, or many other ifs, will be handled in a next part of this series.

When the exception handling is completed and the business logic is added for actually creating new OpenShift applications when Finish is clicked above, the NetBeans/OpenShift plugin should be ready to be used, since it's already possible to view the deployed applications in the Services window and access the related Git sources, as described in previous entries in this series over the past few days.

Join the discussion

Comments ( 1 )
  • guest Thursday, March 12, 2015

    Hi Geertjan

    Thank you for this netbeans extension.

    We have deployed a "local" openshift solution within our network in my company.

    Is it possible to point the extension to our server instead of OpenShift by Red Hat cloud service with some hacks ?


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.