use of com.sequenceiq.cloudbreak.structuredevent.event.cdp.consumption.CDPConsumptionStructuredFlowEvent in project cloudbreak by hortonworks.
the class ConsumptionStructuredFlowEventFactory method createStructuredFlowEvent.
@Override
public CDPStructuredFlowEvent createStructuredFlowEvent(Long resourceId, FlowDetails flowDetails, Exception exception) {
Consumption consumption = consumptionService.findConsumptionById(resourceId);
CDPOperationDetails operationDetails = new CDPOperationDetails(clock.getCurrentTimeMillis(), FLOW, CloudbreakEventService.CONSUMPTION_RESOURCE_TYPE, consumption.getId(), consumption.getName(), nodeConfig.getId(), serviceVersion, consumption.getAccountId(), consumption.getResourceCrn(), ThreadBasedUserCrnProvider.getUserCrn(), null, null);
CDPConsumptionStructuredFlowEvent event = new CDPConsumptionStructuredFlowEvent(operationDetails, flowDetails, null, null, null);
if (exception != null) {
event.setException(ExceptionUtils.getStackTrace(exception));
}
return event;
}
Aggregations