Libraries that lets application connect to cloud services and discover information about themselves.
The core concepts used in this project are:
- Cloud Connector: An interface that a cloud provider can implement to allow the rest of the library work with a Platform As a Service (PaaS) offering.
- Service Connector: An object, such as
javax.sql.DataSource
, that represent a connection to a service. - Service information: Information about the underlying service such as host, port, and credentials.
- Applicaiton information: Information about application and instance in which these libraries are embedded.
The project comprises of three subprojects:
- core: Core library that is cloud agnostic and Spring agnostic. Provides entry point for application developers that choose to programmatically access cloud services and application information. It also provides an extension mechanism to contribute cloud connectors and service connector creators.
- spring-service-connector: Library that provides service connectors creators for javax.sql.DataSource and various connection factories spring-data projects.
- cloudfoundry-connector: Cloud connector for Cloud Foundry.
- heroku-connector: Cloud connector for Heroku.
The following assumes that you are using Maven.
Add the Spring Maven repository to your pom.xml
<repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
Add the spring-service-connector
and one or more cloud connectors dependencies (it is okay to add more that one cloud connectors):
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-service-connector</artifactId>
<version>0.9.0</version>
</dependency>
<!-- If you intend to deploy the app on CloudFoundry, add the following -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>cloudfoundry-connector</artifactId>
<version>0.9.0</version>
</dependency>
<!-- If you intend to deploy the app on Heroku, add the following -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>heroku-connector</artifactId>
<version>0.9.0</version>
</dependency>
Then follow instructions on how you use the <cloud>
namespace. You can also follow the instructions on using the core API directly.
Add the core
and one or more cloud connectors dependencies (it is okay to add more that one cloud connectors):
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>core</artifactId>
<version>0.9.0</version>
</dependency>
<!-- If you intend to deploy the app on CloudFoundry, add the following -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>cloudfoundry-connector</artifactId>
<version>0.9.0</version>
</dependency>
<!-- If you intend to deploy the app on Heroku, add the following -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>heroku-connector</artifactId>
<version>0.9.0</version>
</dependency>
Then follow the insructions on using spring-cloud API.