X

Geertjan's Blog

  • December 18, 2014

Integrating Cloud Providers into NetBeans IDE (Part 2)

Geertjan Wielenga
Product Manager

The next step is to, whenever a new Cloud provider is registered and displayed under the Cloud node, automatically display a related node under the Servers node. In the example below, you see that the related node under the Servers node displays the resources deployed to the Cloud provider:

As with other Cloud providers integrated into NetBeans IDE, you want the node under the Cloud node to not have any children, while the node under the Servers node should be expandable, displaying resources that are made available by the Cloud provider.

When you look at the source code of similar plugins in the NetBeans source tree, i.e., for Oracle Cloud and for Amazon Beanstalk, you'll see how important it is to have clear naming conventions. After all, there are two nodes you need to provide and two of several other things, one for under the Cloud node and one for under the Servers node.

I also recommend keeping the Cloud-specific code as separated from the generic code as possible.

Above, you can see two ChildFactories right at the end, one implemented for OpenShift, the other empty for Cloud Foundry, where a connection is made to the Cloud and resources are retrieved. Right now, I have the OpenShiftChildFactory hooked into the FooServerInstanceImplementation, though if the other one were to be filled out it should be possible to directly swap it into the code.

All the code that you see above is found here:

https://java.net/projects/nb-api-samples/sources/api-samples/show/versions/8.0.2/cloud/part2

As before, the entry point for understanding the code that registers the node under the Servers node is in the layer.xml file, where you will find FooServerInstanceProvider is registered in the Servers folder.

Be the first to comment

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