Search in sources :

Example 1 with FlexSubscriptionResponse

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

the class FlexSubscriptionToJsonConverter method convert.

@Override
public FlexSubscriptionResponse convert(FlexSubscription source) {
    FlexSubscriptionResponse json = new FlexSubscriptionResponse();
    json.setId(source.getId());
    json.setName(source.getName());
    json.setOwner(source.getOwner());
    json.setAccount(source.getAccount());
    json.setPublicInAccount(source.isPublicInAccount());
    json.setSubscriptionId(source.getSubscriptionId());
    json.setSmartSenseSubscriptionId(source.getSmartSenseSubscription().getId());
    SmartSenseSubscriptionJson smartSenseSubscriptionJson = smartSenseSubscriptionToSmartSenseSubscriptionJsonConverter.convert(source.getSmartSenseSubscription());
    json.setSmartSenseSubscription(smartSenseSubscriptionJson);
    json.setUsedAsDefault(source.isDefault());
    json.setUsedForController(source.isUsedForController());
    return json;
}
Also used : FlexSubscriptionResponse(com.sequenceiq.cloudbreak.api.model.FlexSubscriptionResponse) SmartSenseSubscriptionJson(com.sequenceiq.cloudbreak.api.model.SmartSenseSubscriptionJson)

Example 2 with FlexSubscriptionResponse

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

the class StackToStackResponseConverter method addFlexSubscription.

private void addFlexSubscription(StackResponse stackJson, Stack source) {
    if (source.getFlexSubscription() != null) {
        try {
            FlexSubscriptionResponse flexSubscription = getConversionService().convert(source.getFlexSubscription(), FlexSubscriptionResponse.class);
            stackJson.setFlexSubscription(flexSubscription);
        } catch (Exception ex) {
            LOGGER.warn("Flex subscription could not be added to stack response.", ex);
        }
    }
}
Also used : FlexSubscriptionResponse(com.sequenceiq.cloudbreak.api.model.FlexSubscriptionResponse) CloudbreakImageNotFoundException(com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)

Aggregations

FlexSubscriptionResponse (com.sequenceiq.cloudbreak.api.model.FlexSubscriptionResponse)2 SmartSenseSubscriptionJson (com.sequenceiq.cloudbreak.api.model.SmartSenseSubscriptionJson)1 CloudbreakImageNotFoundException (com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)1