Search in sources :

Example 1 with CloudbreakFlexUsageJson

use of com.sequenceiq.cloudbreak.api.model.flex.CloudbreakFlexUsageJson in project cloudbreak by hortonworks.

the class FlexUsageGenerator method getUsages.

public CloudbreakFlexUsageJson getUsages(List<CloudbreakUsage> usages, Long fromDate) {
    LOGGER.info("Generating Cloudbreak Flex related usages.");
    CloudbreakFlexUsageJson result = new CloudbreakFlexUsageJson();
    Optional<CloudbreakUsage> aUsage = usages.stream().findFirst();
    result.setController(getFlexUsageControllerJson(usages, aUsage));
    result.setProducts(Collections.emptyList());
    if (controllerCreated == null || isValidFrom(fromDate)) {
        result.setProducts(getFlexUsageProductJsons(usages, fromDate));
    }
    return result;
}
Also used : CloudbreakFlexUsageJson(com.sequenceiq.cloudbreak.api.model.flex.CloudbreakFlexUsageJson) CloudbreakUsage(com.sequenceiq.cloudbreak.domain.CloudbreakUsage)

Aggregations

CloudbreakFlexUsageJson (com.sequenceiq.cloudbreak.api.model.flex.CloudbreakFlexUsageJson)1 CloudbreakUsage (com.sequenceiq.cloudbreak.domain.CloudbreakUsage)1