use of com.sequenceiq.cloudbreak.structuredevent.event.ClusterDetails in project cloudbreak by hortonworks.
the class ClusterToClusterDetailsConverter method convert.
@Override
public ClusterDetails convert(Cluster source) {
ClusterDetails clusterDetails = new ClusterDetails();
clusterDetails.setId(source.getId());
clusterDetails.setName(source.getName());
clusterDetails.setDescription(source.getDescription());
clusterDetails.setStatus(source.getStatus().toString());
clusterDetails.setStatusReason(source.getStatusReason());
convertKerberosConfig(clusterDetails, source);
convertGatewayProperties(clusterDetails, source.getGateway());
convertFileSystemProperties(clusterDetails, source.getFileSystem());
convertComponents(clusterDetails, source);
addDatabaseInfo(clusterDetails, source);
return clusterDetails;
}
use of com.sequenceiq.cloudbreak.structuredevent.event.ClusterDetails in project cloudbreak by hortonworks.
the class StructuredFlowEventFactory method createStucturedFlowEvent.
public StructuredFlowEvent createStucturedFlowEvent(Long stackId, FlowDetails flowDetails, Boolean detailed, Exception exception) {
Stack stack = stackService.getById(stackId);
UserProfile userProfile = userProfileService.get(stack.getAccount(), stack.getOwner());
OperationDetails operationDetails = new OperationDetails("FLOW", "STACK", stackId, stack.getAccount(), stack.getOwner(), userProfile.getUserName(), cloudbreakNodeConfig.getId(), cbVersion);
StackDetails stackDetails = null;
ClusterDetails clusterDetails = null;
BlueprintDetails blueprintDetails = null;
if (detailed) {
stackDetails = conversionService.convert(stack, StackDetails.class);
Cluster cluster = stack.getCluster();
if (cluster != null) {
clusterDetails = conversionService.convert(cluster, ClusterDetails.class);
blueprintDetails = conversionService.convert(cluster.getBlueprint(), BlueprintDetails.class);
}
}
return exception != null ? new StructuredFlowErrorEvent(operationDetails, flowDetails, stackDetails, clusterDetails, blueprintDetails, ExceptionUtils.getStackTrace(exception)) : new StructuredFlowEvent(operationDetails, flowDetails, stackDetails, clusterDetails, blueprintDetails);
}
Aggregations