Search in sources :

Example 1 with InstanceGroupDetails

use of com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails in project cloudbreak by hortonworks.

the class InstanceGroupToInstanceGroupDetailsConverter method convert.

@Override
public InstanceGroupDetails convert(InstanceGroup source) {
    InstanceGroupDetails instanceGroupDetails = new InstanceGroupDetails();
    instanceGroupDetails.setGroupName(source.getGroupName());
    instanceGroupDetails.setGroupType(source.getInstanceGroupType().name());
    instanceGroupDetails.setNodeCount(source.getNodeCount());
    Template template = source.getTemplate();
    if (template != null) {
        instanceGroupDetails.setInstanceType(source.getTemplate().getInstanceType());
        instanceGroupDetails.setVolumeType(source.getTemplate().getVolumeType());
        instanceGroupDetails.setVolumeSize(source.getTemplate().getVolumeSize());
        instanceGroupDetails.setVolumeCount(source.getTemplate().getVolumeCount());
    }
    instanceGroupDetails.setSecurityGroup(conversionService.convert(source.getSecurityGroup(), SecurityGroupDetails.class));
    return instanceGroupDetails;
}
Also used : InstanceGroupDetails(com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails) SecurityGroupDetails(com.sequenceiq.cloudbreak.structuredevent.event.SecurityGroupDetails) Template(com.sequenceiq.cloudbreak.domain.Template)

Example 2 with InstanceGroupDetails

use of com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails in project cloudbreak by hortonworks.

the class StackToStackDetailsConverter method convert.

@Override
public StackDetails convert(Stack source) {
    StackDetails stackDetails = new StackDetails();
    stackDetails.setId(source.getId());
    stackDetails.setName(source.getName());
    stackDetails.setRegion(source.getRegion());
    stackDetails.setAvailabilityZone(source.getAvailabilityZone());
    stackDetails.setDescription(source.getDescription());
    stackDetails.setCloudPlatform(source.cloudPlatform());
    stackDetails.setPlatformVariant(source.getPlatformVariant());
    stackDetails.setStatus(source.getStatus().name());
    stackDetails.setDetailedStatus(source.getStackStatus().getDetailedStackStatus().name());
    stackDetails.setStatusReason(source.getStatusReason());
    stackDetails.setInstanceGroups((List<InstanceGroupDetails>) conversionService.convert(source.getInstanceGroups(), TypeDescriptor.forObject(source.getInstanceGroups()), TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(InstanceGroupDetails.class))));
    convertComponents(stackDetails, source);
    convertNetwork(stackDetails, source.getNetwork(), source.cloudPlatform());
    return stackDetails;
}
Also used : InstanceGroupDetails(com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails) StackDetails(com.sequenceiq.cloudbreak.structuredevent.event.StackDetails) List(java.util.List)

Aggregations

InstanceGroupDetails (com.sequenceiq.cloudbreak.structuredevent.event.InstanceGroupDetails)2 Template (com.sequenceiq.cloudbreak.domain.Template)1 SecurityGroupDetails (com.sequenceiq.cloudbreak.structuredevent.event.SecurityGroupDetails)1 StackDetails (com.sequenceiq.cloudbreak.structuredevent.event.StackDetails)1 List (java.util.List)1