Search in sources :

Example 1 with CDPConsumptionStructuredFlowEvent

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;
}
Also used : Consumption(com.sequenceiq.consumption.domain.Consumption) CDPConsumptionStructuredFlowEvent(com.sequenceiq.cloudbreak.structuredevent.event.cdp.consumption.CDPConsumptionStructuredFlowEvent) CDPOperationDetails(com.sequenceiq.cloudbreak.structuredevent.event.cdp.CDPOperationDetails)

Aggregations

CDPOperationDetails (com.sequenceiq.cloudbreak.structuredevent.event.cdp.CDPOperationDetails)1 CDPConsumptionStructuredFlowEvent (com.sequenceiq.cloudbreak.structuredevent.event.cdp.consumption.CDPConsumptionStructuredFlowEvent)1 Consumption (com.sequenceiq.consumption.domain.Consumption)1