org.cloudfoundry.client.lib.adapters.RawCloudRoute 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 java.util.List;
import org.cloudfoundry.client.lib.domain.CloudDomain;
import org.cloudfoundry.client.lib.domain.CloudRoute;
import org.cloudfoundry.client.lib.domain.Derivable;
import org.cloudfoundry.client.lib.domain.ImmutableCloudRoute;
import org.cloudfoundry.client.v2.Resource;
import org.cloudfoundry.client.v2.routemappings.RouteMappingEntity;
import org.cloudfoundry.client.v2.routes.RouteEntity;
import org.immutables.value.Value;
@Value.Immutable
public abstract class RawCloudRoute extends RawCloudEntity {
public abstract Resource getResource();
public abstract List> getRouteMappingResources();
public abstract Derivable getDomain();
@Override
public CloudRoute derive() {
Resource resource = getResource();
RouteEntity entity = resource.getEntity();
return ImmutableCloudRoute.builder()
.metadata(parseResourceMetadata(resource))
.appsUsingRoute(getRouteMappingResources().size())
.host(entity.getHost())
.domain(getDomain().derive())
.hasServiceUsingRoute(entity.getServiceInstanceId() != null)
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy