本文整理汇总了Java中org.cloudfoundry.reactor.DefaultConnectionContext类的典型用法代码示例。如果您正苦于以下问题:Java DefaultConnectionContext类的具体用法?Java DefaultConnectionContext怎么用?Java DefaultConnectionContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultConnectionContext类属于org.cloudfoundry.reactor包,在下文中一共展示了DefaultConnectionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCloudFoundryOperations
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
private CloudFoundryOperations createCloudFoundryOperations() {
DefaultConnectionContext connectionContext = DefaultConnectionContext.builder()
.apiHost(apiHost)
.build();
TokenProvider tokenProvider = PasswordGrantTokenProvider.builder()
.password(password)
.username(userName)
.build();
ReactorCloudFoundryClient reactorClient = ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
CloudFoundryOperations cloudFoundryOperations = DefaultCloudFoundryOperations.builder()
.cloudFoundryClient(reactorClient)
.organization(organization)
.space(space)
.build();
return cloudFoundryOperations;
}
示例2: setup
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Before
public void setup()
{
String host = System.getenv("CF_HOST");
String username = System.getenv("CF_USERNAME");
String password = System.getenv("CF_PASSWORD");
if(host == null || username == null || password == null)
{
throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
}
DefaultConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
PasswordGrantTokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();
cfClient = ReactorCloudFoundryClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
ModifyingUserOps createUserOps = new ModifyingUserOps(connectionContext, connectionContext.getRoot(), tokenProvider);
facade = new ReactorCfClientFacade(cfClient, createUserOps);
String orgName = "converger-test-"+UUID.randomUUID().toString();
orgId = facade.createOrg(orgName);
}
示例3: setup
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Before
public void setup()
{
String host = System.getenv("CF_HOST");
String username = System.getenv("CF_USERNAME");
String password = System.getenv("CF_PASSWORD");
if(host == null || username == null || password == null)
{
throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
}
ConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
TokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();
ReactorUaaClient uaaClient = ReactorUaaClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
uaa = new ReactorUaaClientFacade(uaaClient);
}
示例4: setup
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Before
public void setup()
{
String host = System.getenv("CF_HOST");
String username = System.getenv("CF_USERNAME");
String password = System.getenv("CF_PASSWORD");
if(host == null || username == null || password == null)
{
throw new RuntimeException("CF_HOST, CF_USERNAME and CF_PASSWORD must be set");
}
ConnectionContext connectionContext = DefaultConnectionContext.builder().apiHost(host).skipSslValidation(true).build();
TokenProvider tokenProvider = PasswordGrantTokenProvider.builder().username(username).password(password).build();
cfClient = ReactorCloudFoundryClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
cfOps = DefaultCloudFoundryOperations.builder().cloudFoundryClient(cfClient).build();
facade = new ReactorCfClientFacade(cfClient, mock(ModifyingUserOps.class));
}
示例5: getCfOperations
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
protected CloudFoundryOperations getCfOperations() {
CfProperties cfAppProperties = this.cfPropertiesMapper.getProperties();
ConnectionContext connectionContext = DefaultConnectionContext.builder()
.apiHost(cfAppProperties.ccHost())
.skipSslValidation(true)
.proxyConfiguration(tryGetProxyConfiguration(cfAppProperties))
.build();
TokenProvider tokenProvider = getTokenProvider(cfAppProperties);
CloudFoundryClient cfClient = ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
CloudFoundryOperations cfOperations = DefaultCloudFoundryOperations.builder()
.cloudFoundryClient(cfClient)
.organization(cfAppProperties.org())
.space(cfAppProperties.space())
.build();
return cfOperations;
}
示例6: getClient
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
private CloudFoundryClient getClient(RepositoryConfiguration repositoryConfiguration) {
String api = repositoryConfiguration.get("REPO_URL").getValue();
String username = repositoryConfiguration.get("USERNAME").getValue();
String password = repositoryConfiguration.get("PASSWORD").getValue();
LOGGER.debug("Cloud Foundry connection details: api: " + api + ", username " + username);
ConnectionContext connectionContext = DefaultConnectionContext.builder()
.apiHost(api)
.skipSslValidation(true)
.build();
ReactorCloudFoundryClient client = ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(PasswordGrantTokenProvider.builder()
.username(username)
.password(password)
.build())
.build();
return client;
}
示例7: setup
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Before
public void setup() {
ConnectionContext connectionContext = DefaultConnectionContext.builder()
.apiHost("api.local.pcfdev.io")
.skipSslValidation(true)
.build();
String username = "user";
String password = "pass";
client = ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(PasswordGrantTokenProvider.builder()
.password(password)
.username(username)
.build())
.build();
Mono<GetInfoResponse> getInfoResponseMono = client.info().get(GetInfoRequest.builder().build());
GetInfoResponse response = getInfoResponseMono.block(Duration.ofSeconds(5L));
String apiVersion = response.getApiVersion();
assertThat(apiVersion, is(notNullValue()));
majorApiVersion = Integer.parseInt(apiVersion.split("\\.")[0]);
}
示例8: producesAllBeans
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Test
public void producesAllBeans() {
Assume.assumeTrue(configExists());
ApplicationContext ctx = new SpringApplicationBuilder()
.sources(MyConfig.class)
.properties(defaultConfig())
.run();
Class[] tags = {ReactorCloudFoundryClient.class, DefaultCloudFoundryOperations.class,
DefaultConnectionContext.class, DopplerClient.class, RoutingClient.class, PasswordGrantTokenProvider.class,
ReactorUaaClient.class};
for (Class<?> c : tags) {
Assertions.assertThat(ctx.getBean(c)).isNotNull();
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-cloudfoundry,代码行数:18,代码来源:CloudFoundryClientAutoConfigurationTest.java
示例9: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Bean
public DefaultConnectionContext connectionContext(
@Value("${cf.api}") String apiHost,
@Value("${cf.skip-ssl-validation:false}") boolean skipSsl) {
if (apiHost.contains("://")) {
apiHost = apiHost.split("://")[1];
}
return DefaultConnectionContext
.builder()
.skipSslValidation(skipSsl)
.apiHost(apiHost)
.build();
}
开发者ID:applied-continuous-delivery-livelessons,项目名称:testing-101,代码行数:14,代码来源:CloudFoundryClientConfiguration.java
示例10: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
private ConnectionContext connectionContext(URL apiEndpoint) {
return DefaultConnectionContext.builder()
.apiHost(apiEndpoint.getHost())
.skipSslValidation(true)
.sslHandshakeTimeout(Duration.ofSeconds(120))
.build();
}
示例11: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Bean
DefaultConnectionContext connectionContext(@Value("${cf.host}") String apiHost) {
return DefaultConnectionContext.builder()
.apiHost(apiHost)
.skipSslValidation(true)
.build();
}
示例12: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Bean
DefaultConnectionContext connectionContext(@Value("${test.apiHost}") String apiHost,
@Value("${test.proxy.host:}") String proxyHost,
@Value("${test.proxy.password:}") String proxyPassword,
@Value("${test.proxy.port:8080}") Integer proxyPort,
@Value("${test.proxy.username:}") String proxyUsername,
@Value("${test.skipSslValidation:false}") Boolean skipSslValidation) {
return DefaultConnectionContext.builder()
.apiHost(apiHost)
//.problemHandler(new FailingDeserializationProblemHandler()) // Test-only problem handler
.skipSslValidation(skipSslValidation)
.build();
}
开发者ID:orange-cloudfoundry,项目名称:sec-group-broker-filter,代码行数:15,代码来源:IntegrationTestConfiguration.java
示例13: getAppDetailTests
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Test
public void getAppDetailTests() {
ConnectionContext connectionContext = DefaultConnectionContext.builder()
.apiHost("api.local.pcfdev.io")
.skipSslValidation(true)
.build();
TokenProvider tokenProvider = PasswordGrantTokenProvider.builder()
.password("admin")
.username("admin")
.build();
CloudFoundryClient cfClient = ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
CloudFoundryOperations cfOperations = DefaultCloudFoundryOperations.builder()
.cloudFoundryClient(cfClient)
.organization("pcfdev-org")
.space("pcfdev-space")
.build();
CfAppDetailsDelegate appDetailsTaskDelegate = new CfAppDetailsDelegate();
CfProperties cfAppProps = envDetails();
Mono<Optional<ApplicationDetail>> applicationDetailMono = appDetailsTaskDelegate
.getAppDetails(cfOperations, cfAppProps);
// Mono<Void> resp = applicationDetailMono.then(applicationDetail -> Mono.fromSupplier(() -> {
// return 1;
// })).then();
//
// resp.block();
// ApplicationDetail applicationDetail = applicationDetailMono.block(Duration.ofMillis(5000));
// System.out.println("applicationDetail = " + applicationDetail);
}
示例14: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ConnectionContext connectionContext(CloudFoundryConnectionProperties properties) {
return DefaultConnectionContext.builder()
.apiHost(properties.getUrl().getHost())
.skipSslValidation(properties.isSkipSslValidation())
.build();
}
开发者ID:spring-cloud,项目名称:spring-cloud-deployer-cloudfoundry,代码行数:9,代码来源:CloudFoundryDeployerAutoConfiguration.java
示例15: connectionContext
import org.cloudfoundry.reactor.DefaultConnectionContext; //导入依赖的package包/类
@Bean
public ConnectionContext connectionContext(CloudFoundryConnectionProperties properties) {
return DefaultConnectionContext.builder()
.apiHost(properties.getUrl().getHost())
.skipSslValidation(properties.isSkipSslValidation())
.build();
}