org.cloudfoundry.client.lib.adapters.RawCloudServiceBroker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudfoundry-client-lib Show documentation
Show all versions of cloudfoundry-client-lib Show documentation
A Cloud Foundry client library for Java
The newest version!
package org.cloudfoundry.client.lib.adapters;
import org.cloudfoundry.client.lib.domain.CloudServiceBroker;
import org.cloudfoundry.client.lib.domain.ImmutableCloudServiceBroker;
import org.cloudfoundry.client.v2.Resource;
import org.cloudfoundry.client.v2.servicebrokers.ServiceBrokerEntity;
import org.immutables.value.Value;
@Value.Immutable
public abstract class RawCloudServiceBroker extends RawCloudEntity {
@Value.Parameter
public abstract Resource getResource();
@Override
public CloudServiceBroker derive() {
Resource resource = getResource();
ServiceBrokerEntity entity = resource.getEntity();
return ImmutableCloudServiceBroker.builder()
.metadata(parseResourceMetadata(resource))
.name(entity.getName())
// The password is not returned by the CF controller.
.password(null)
.username(entity.getAuthenticationUsername())
.url(entity.getBrokerUrl())
.spaceGuid(entity.getSpaceId())
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy