use of com.sequenceiq.cloudbreak.structuredevent.event.cdp.CDPStructuredNotificationEvent in project cloudbreak by hortonworks.
the class EventSenderService method createStructureEventForMissingEnvironment.
private CDPStructuredNotificationEvent createStructureEventForMissingEnvironment(BaseNamedFlowEvent payload, ResourceEvent resourceEvent, String userCrn) {
String resourceType = payload.getClass().getSimpleName().toLowerCase();
String resourceCrn = payload.getResourceCrn();
CDPOperationDetails operationDetails = new CDPOperationDetails(System.currentTimeMillis(), NOTIFICATION, resourceType, payload.getResourceId(), payload.getResourceName(), nodeConfig.getId(), serviceVersion, null, resourceCrn, userCrn, resourceCrn, resourceEvent.name());
CDPStructuredNotificationDetails notificationDetails = getNotificationDetails(resourceEvent, resourceCrn, resourceType, payload);
String message = cloudbreakMessagesService.getMessage(resourceEvent.getMessage());
return new CDPStructuredNotificationEvent(operationDetails, notificationDetails, resourceEvent.name(), message);
}
Aggregations