use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredNotificationEvent in project cloudbreak by hortonworks.
the class CloudbreakEventHandler method accept.
@Override
public void accept(Event<StructuredNotificationEvent> cloudbreakEvent) {
StructuredNotificationEvent structuredNotificationEvent = cloudbreakEvent.getData();
structuredEventClient.sendStructuredEvent(structuredNotificationEvent);
CloudbreakEventsJson cloudbreakEventsJson = conversionService.convert(structuredNotificationEvent, CloudbreakEventsJson.class);
notificationSender.send(notificationAssemblingService.createNotification(cloudbreakEventsJson));
}
use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredNotificationEvent in project cloudbreak by hortonworks.
the class DefaultCloudbreakEventService method fireCloudbreakInstanceGroupEvent.
@Override
public void fireCloudbreakInstanceGroupEvent(Long stackId, String eventType, String eventMessage, String instanceGroupName) {
StructuredNotificationEvent eventData = structuredFlowEventFactory.createStructuredNotificationEvent(stackId, eventType, eventMessage, instanceGroupName);
LOGGER.info("Firing Cloudbreak event: stackId: {}, type: {}, message: {}, instancegroup: {}", stackId, eventType, eventMessage, instanceGroupName);
reactor.notify(CLOUDBREAK_EVENT, eventFactory.createEvent(eventData));
}
use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredNotificationEvent in project cloudbreak by hortonworks.
the class DefaultCloudbreakEventService method fireCloudbreakEvent.
@Override
public void fireCloudbreakEvent(Long entityId, String eventType, String eventMessage) {
StructuredNotificationEvent eventData = structuredFlowEventFactory.createStructuredNotificationEvent(entityId, eventType, eventMessage, null);
LOGGER.info("Firing Cloudbreak event: entityId: {}, type: {}, message: {}", entityId, eventType, eventMessage);
reactor.notify(CLOUDBREAK_EVENT, eventFactory.createEvent(eventData));
}
use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredNotificationEvent in project cloudbreak by hortonworks.
the class ServiceTestUtils method createEvent.
public static StructuredNotificationEvent createEvent(Long stackId, int nodeCount, String eventStatus, Date eventTimestamp) {
OperationDetails operation = new OperationDetails(eventTimestamp.getTime(), "NOTIFICATION", "STACK", stackId, "account", "userid", "username", "cbId", "cbVersion");
NotificationDetails notification = new NotificationDetails();
notification.setNotificationType(eventStatus);
notification.setNodeCount(nodeCount);
return new StructuredNotificationEvent(operation, notification);
}
use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredNotificationEvent in project cloudbreak by hortonworks.
the class StructuredNotificationEventToCloudbreakEventJsonConverterTest method createSource.
@Override
public StructuredNotificationEvent createSource() {
OperationDetails operation = new OperationDetails(Calendar.getInstance().getTimeInMillis(), "NOTIFICATION", "STACK", 1L, "account", "owner", "userName", "cbId", "cbVersion");
NotificationDetails notification = new NotificationDetails();
notification.setInstanceGroup("master");
notification.setRegion("us");
notification.setStackName("usagestack");
notification.setStackId(1L);
notification.setNotification("message");
notification.setNotificationType("eventType");
notification.setCloud(GCP);
notification.setBlueprintName("blueprintName");
notification.setBlueprintId(1L);
notification.setStackStatus(AVAILABLE.name());
notification.setNodeCount(1);
notification.setClusterStatus(AVAILABLE.name());
notification.setClusterId(1L);
notification.setClusterName("test");
return new StructuredNotificationEvent(operation, notification);
}
Aggregations