Skip to content
Sergey Fedosenko edited this page Feb 16, 2016 · 6 revisions

Installation

If you use Maven or Gradle, you can simply add the CLC SDK as a dependency.

Maven:

<dependencies>
    <dependency>
        <groupId>com.centurylink.cloud</groupId>
        <artifactId>spring-clc-sdk</artifactId>
        <version>1.2.2</version>
    </dependency>
</dependencies>

Gradle:

compile 'com.centurylink.cloud:spring-clc-sdk:1.2.2'

Spring Adapter

To use spring adapter you need:

  1. Import sdk-spring-adapter.jar in your project
  2. Provide Spring configuration using @EnableClcSdk annotation
@Configuration
@EnableClcSdk
class MyConfig {

    @Bean
    public CredentialsProvider clcCredentialsProvider() {
        return new StaticCredentialsProvider("john.doe", "strong_password");
    }

    @Bean
    public SdkConfiguration clcSdkConfig() {
        return new SdkConfigurationBuilder().build();
    }

}

To see all available credentials providers and configuration properties, please see SDK configuration section.
Then you can autowire necessary sdk services

@Autowired
ServerService clcServerService;

@Autowired
GroupService clcGroupService;

Or get them from spring context directly