本文整理汇总了Java中org.cloudfoundry.reactor.client.ReactorCloudFoundryClient类的典型用法代码示例。如果您正苦于以下问题:Java ReactorCloudFoundryClient类的具体用法?Java ReactorCloudFoundryClient怎么用?Java ReactorCloudFoundryClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReactorCloudFoundryClient类属于org.cloudfoundry.reactor.client包,在下文中一共展示了ReactorCloudFoundryClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCloudFoundryOperations
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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.client.ReactorCloudFoundryClient; //导入依赖的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.client.ReactorCloudFoundryClient; //导入依赖的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));
}
示例4: getCfOperations
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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;
}
示例5: getClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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;
}
示例6: setup
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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]);
}
示例7: accumulateV2Apps
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
private void accumulateV2Apps(ReactorCloudFoundryClient client, String appName, List<String> matchingApps) {
ApplicationsV2 applicationsV2 = client.applicationsV2();
ListApplicationsRequest listApplicationsRequest = ListApplicationsRequest.builder()
.build();
Mono<ListApplicationsResponse> responseMono = applicationsV2.list(listApplicationsRequest);
ListApplicationsResponse response = responseMono.block();
if (response.getTotalResults() > 0) {
System.out.println(response.getTotalResults());
response.getResources().forEach(app ->
{
if (app.getEntity().getName().equals(appName)) {
matchingApps.add(appName);
}
});
}
}
示例8: accumulateV3Apps
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
private void accumulateV3Apps(ReactorCloudFoundryClient client, String appName, List<String> matchingApps) {
ApplicationsV3 applicationsV3 = client.applicationsV3();
org.cloudfoundry.client.v3.applications.ListApplicationsRequest listApplicationsRequest =
org.cloudfoundry.client.v3.applications.ListApplicationsRequest.builder()
.build();
Mono<org.cloudfoundry.client.v3.applications.ListApplicationsResponse> responseMono = applicationsV3.list(listApplicationsRequest);
org.cloudfoundry.client.v3.applications.ListApplicationsResponse response = responseMono.block();
response.getResources().forEach(app ->
{
if (app.getName().equals(appName)) {
matchingApps.add(app.getName());
}
});
}
示例9: producesAllBeans
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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
示例10: cloudFoundryClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
@Bean
public ReactorCloudFoundryClient cloudFoundryClient(
ConnectionContext connectionContext,
TokenProvider tokenProvider) {
return ReactorCloudFoundryClient
.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider).build();
}
开发者ID:applied-continuous-delivery-livelessons,项目名称:testing-101,代码行数:10,代码来源:CloudFoundryClientConfiguration.java
示例11: cloudFoundryClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
@Bean
ReactorCloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
}
示例12: cloudFoundryClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
@Bean
CloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider)
{
return ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
}
示例13: cloudFoundryClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
@Bean(initMethod = "checkCompatibility")
ReactorCloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
}
开发者ID:orange-cloudfoundry,项目名称:sec-group-broker-filter,代码行数:8,代码来源:IntegrationTestConfiguration.java
示例14: cloudFoundryClient
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的package包/类
@Bean
ReactorCloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
}
示例15: getAppDetailTests
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient; //导入依赖的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);
}