org.cloudfoundry.doppler.DopplerClient Java Examples

The following examples show how to use org.cloudfoundry.doppler.DopplerClient. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CloudControllerRestClientImpl.java    From cf-java-client-sap with Apache License 2.0 6 votes vote down vote up
public CloudControllerRestClientImpl(URL controllerUrl, CloudCredentials credentials, RestTemplate restTemplate,
                                     OAuthClient oAuthClient, CloudFoundryClient delegate, DopplerClient dopplerClient,
                                     CloudSpace target) {
    Assert.notNull(controllerUrl, "CloudControllerUrl cannot be null");
    Assert.notNull(restTemplate, "RestTemplate cannot be null");
    Assert.notNull(oAuthClient, "OAuthClient cannot be null");

    this.controllerUrl = controllerUrl;
    this.credentials = credentials;
    this.restTemplate = restTemplate;
    this.oAuthClient = oAuthClient;
    this.target = target;

    this.delegate = delegate;
    this.dopplerClient = dopplerClient;
}
 
Example #2
Source File: CloudFoundryAppDeployerAutoConfiguration.java    From spring-cloud-app-broker with Apache License 2.0 5 votes vote down vote up
/**
 * Provide a {@link CloudFoundryOperations} bean
 *
 * @param properties the CloudFoundryTargetProperties bean
 * @param client the CloudFoundryClient bean
 * @param dopplerClient the DopplerClient bean
 * @param uaaClient the UaaClient bean
 * @return the bean
 */
@Bean
public CloudFoundryOperations cloudFoundryOperations(CloudFoundryTargetProperties properties,
	CloudFoundryClient client, DopplerClient dopplerClient, @UaaClientQualifier UaaClient uaaClient) {
	return DefaultCloudFoundryOperations.builder()
		.cloudFoundryClient(client)
		.dopplerClient(dopplerClient)
		.uaaClient(uaaClient)
		.organization(properties.getDefaultOrg())
		.space(properties.getDefaultSpace())
		.build();
}
 
Example #3
Source File: DopplerLogStreamPublisher.java    From spring-cloud-app-broker with Apache License 2.0 5 votes vote down vote up
public DopplerLogStreamPublisher(
	CloudFoundryClient client,
	DopplerClient dopplerClient,
	ApplicationIdsProvider applicationIdsProvider
) {
	this.client = client;
	this.dopplerClient = dopplerClient;
	this.applicationIdsProvider = applicationIdsProvider;
}
 
Example #4
Source File: CloudFoundryClientConfiguration.java    From spring-cloud-app-broker with Apache License 2.0 5 votes vote down vote up
@Bean
protected CloudFoundryOperations cloudFoundryOperations(CloudFoundryProperties properties,
	CloudFoundryClient client,
	DopplerClient dopplerClient,
	UaaClient uaaClient) {
	return DefaultCloudFoundryOperations.builder()
		.cloudFoundryClient(client)
		.dopplerClient(dopplerClient)
		.uaaClient(uaaClient)
		.organization(properties.getDefaultOrg())
		.space(properties.getDefaultSpace())
		.build();
}
 
Example #5
Source File: CloudFoundryClientConfiguration.java    From spring-cloud-app-broker with Apache License 2.0 5 votes vote down vote up
@Bean
protected DopplerClient dopplerClient(ConnectionContext connectionContext,
	@Qualifier("userCredentials") TokenProvider tokenProvider) {
	return ReactorDopplerClient.builder()
		.connectionContext(connectionContext)
		.tokenProvider(tokenProvider)
		.build();
}
 
Example #6
Source File: CloudControllerRestClientFactory.java    From cf-java-client-sap with Apache License 2.0 5 votes vote down vote up
public CloudControllerRestClient createClient(URL controllerUrl, CloudCredentials credentials, CloudSpace target,
                                              OAuthClient oAuthClient) {
    RestTemplate restTemplate = createAuthorizationSettingRestTemplate(credentials, oAuthClient);
    CloudFoundryClient delegate = getCloudFoundryClientFactory().createClient(controllerUrl, oAuthClient);
    DopplerClient dopplerClient = getCloudFoundryClientFactory().createDopplerClient(controllerUrl, oAuthClient);

    return new CloudControllerRestClientImpl(controllerUrl, credentials, restTemplate, oAuthClient, delegate, dopplerClient, target);
}
 
Example #7
Source File: CfConfiguration.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@Bean
DefaultCloudFoundryOperations defaultCloudFoundryOperations(
		CloudFoundryClient cloudFoundryClient, DopplerClient dopplerClient,
		UaaClient uaaClient, @Value("${cf.organization}") String organizationId,
		@Value("${cf.space}") String spaceId) {
	return DefaultCloudFoundryOperations.builder()
			.cloudFoundryClient(cloudFoundryClient).dopplerClient(dopplerClient)
			.uaaClient(uaaClient).organization(organizationId).space(spaceId).build();
}
 
Example #8
Source File: CloudFoundryClientAutoConfiguration.java    From spring-cloud-cloudfoundry with Apache License 2.0 5 votes vote down vote up
@Bean
@Lazy
@ConditionalOnMissingBean
public DefaultCloudFoundryOperations cloudFoundryOperations(
		CloudFoundryClient cloudFoundryClient, DopplerClient dopplerClient,
		RoutingClient routingClient, UaaClient uaaClient) {
	String organization = this.cloudFoundryProperties.getOrg();
	String space = this.cloudFoundryProperties.getSpace();
	return DefaultCloudFoundryOperations.builder()
			.cloudFoundryClient(cloudFoundryClient).dopplerClient(dopplerClient)
			.routingClient(routingClient).uaaClient(uaaClient)
			.organization(organization).space(space).build();
}
 
Example #9
Source File: CloudFoundryClientAutoConfiguration.java    From spring-cloud-cloudfoundry with Apache License 2.0 5 votes vote down vote up
@Bean
@Lazy
@ConditionalOnMissingBean
public DopplerClient dopplerClient(ConnectionContext connectionContext,
		TokenProvider tokenProvider) {
	return ReactorDopplerClient.builder().connectionContext(connectionContext)
			.tokenProvider(tokenProvider).build();
}
 
Example #10
Source File: CloudFoundryClientAutoConfigurationTest.java    From spring-cloud-cloudfoundry with Apache License 2.0 5 votes vote down vote up
private void assertCloudFoundryClientBeansPresent(
		AssertableApplicationContext context) {
	assertThat(context).hasSingleBean(ReactorCloudFoundryClient.class);
	assertThat(context).hasSingleBean(DefaultCloudFoundryOperations.class);
	assertThat(context).hasSingleBean(DefaultConnectionContext.class);
	assertThat(context).hasSingleBean(DopplerClient.class);
	assertThat(context).hasSingleBean(RoutingClient.class);
	assertThat(context).hasSingleBean(PasswordGrantTokenProvider.class);
	assertThat(context).hasSingleBean(ReactorUaaClient.class);
}
 
Example #11
Source File: ServiceInstanceLogStreamAutoConfiguration.java    From spring-cloud-app-broker with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public LogStreamPublisher<Envelope> streamLogsPublisher(CloudFoundryClient cloudFoundryClient,
	DopplerClient dopplerClient, ApplicationIdsProvider applicationIdsProvider) {
	return new DopplerLogStreamPublisher(cloudFoundryClient, dopplerClient, applicationIdsProvider);
}
 
Example #12
Source File: ServiceInstanceRecentLogsAutoConfiguration.java    From spring-cloud-app-broker with Apache License 2.0 4 votes vote down vote up
@Bean
public RecentLogsProvider recentLogsProvider(CloudFoundryClient cloudFoundryClient, DopplerClient dopplerClient,
	ApplicationIdsProvider applicationIdsProvider) {
	return new ApplicationRecentLogsProvider(cloudFoundryClient, dopplerClient, applicationIdsProvider);
}
 
Example #13
Source File: ApplicationRecentLogsProvider.java    From spring-cloud-app-broker with Apache License 2.0 4 votes vote down vote up
public ApplicationRecentLogsProvider(CloudFoundryClient client, DopplerClient dopplerClient,
	ApplicationIdsProvider applicationIdsProvider) {
	this.client = client;
	this.dopplerClient = dopplerClient;
	this.applicationIdsProvider = applicationIdsProvider;
}
 
Example #14
Source File: CloudFoundryClientFactory.java    From cf-java-client-sap with Apache License 2.0 4 votes vote down vote up
public DopplerClient createDopplerClient(URL controllerUrl, OAuthClient oAuthClient) {
    return ReactorDopplerClient.builder()
                               .connectionContext(getOrCreateConnectionContext(controllerUrl.getHost()))
                               .tokenProvider(oAuthClient.getTokenProvider())
                               .build();
}