Today we announce a new release of Cloud Foundry Integration for Eclipse which features the ability to open a tunnel to any Cloud Foundry data service. Now Eclipse users can use familiar client applications to directly analyze, manipulate, or port the data contained in their Cloud Foundry applications.
The Cloud Foundry Data Tunneling service can be created from the Services table in the Cloud Foundry Eclipse server editor. The new integration (version 1.1.0) allows users to create data tunneling (also known as ‘Caldecott‘) from within Eclipse Indigo JEE or SpringSource Tool Suite (STS) version 2.9.0 or higher.
Follow the documented instructions to install the Cloud Foundry Integration for Eclipse. If you had previously installed the Cloud Foundry plugin in Eclipse or STS, the update will be automatically detected or you can manually check for updates in the IDE.
Creating a Tunnel
You can create a tunnel to connect to any running service in your Cloud Foundry account. Go to the Applications tab in the Cloud Foundry Server view. There is a listing of existing services under the Services section. Creating a tunnel is performed by simply right-clicking on a service in the table and selecting “Open Caldecott Tunnel” menu action:
This will automatically publish a tunneling application to your account, if one isn’t already published, and start or restart the application as necessary. This tunneling application will appear in the list of published applications as Caldecott. Cloud Foundry will also automatically bind the selected service to the Caldecott application prior to opening a tunnel.
The process of creating a tunnel requires services to be bound to the tunneling application. Cloud Foundry will automatically stop a running Caldecott application, bind the service, and restart the application to create the tunnel. Therefore, existing tunnels may be closed when a new tunnel is created, if the desired service was not previously bound to the tunneling application. Multiple tunnels can be opened to different services in your account at the same time, as long as all the related services are already bound to the Caldecott application prior to creating the data tunnels.
In general, any operation that requires the tunneling application to be stopped, restarted or removed will result in all existing tunnels being disconnected. Manually unbinding a service from the Caldecott application through the Services table will also result in the associated tunnel being disconnected.
Once a tunnel is successfully created, a dialogue will open displaying the data service tunnel information necessary to use a tool like the Eclipse Data Source Explorer to connect to a data service in a Cloud Foundry server. The information displayed includes a username, password, and local port number:
As URLs are needed for database connections in tools like the Eclipse Data Source Explorer, they are automatically constructed for certain data services like MySQL and PostgreSQL. That way, users do not need to manually construct them when creating a database connection.
Right-clicking on the tunnel entry in the tunnel dialogue will display several context menu actions to copy field values to the clipboard. The menu action to copy the URL appears if the service is of MySQL or PostgreSQL type:
Once a tunnel is opened, it can be managed from the Services table in the Cloud Foundry server editor. A sortable “Tunnel” column indicates which services have an open tunnel:
Right-clicking on a service allows users to either disconnect the tunnel or show the tunnel information.
Data tunnels can also be managed in the Servers view by right-clicking on a server instance and options will be presented to manage individual tunnels via wizard flow or disconnecting all existing tunnels:
These Servers view context menu actions are only displayed if the server has at least one active tunnel.
Creating Database Connections
Using the service tunnel information, database connections can then be created with the Eclipse Data Source Explorer, which is available by default in STS and Eclipse Indigo JEE installations:
Once a database connection is established, the database can be accessed through the Data Source Explorer:
To disconnect the tunnel, all data service connections must be disconnected. Therefore, active data service connections created by tools, such as the Data Source Explorer, must be terminated prior to disconnecting the tunnel from the Services table.
Cloud Foundry Integration for Eclipse 1.1.0 can be installed or updated from the official update site:
- The Cloud Foundry Team
Don’t have a Cloud Foundry account yet? Signup for free today
About the Author
BiographyMore Content by Nieraj Singh