use of com.sequenceiq.cloudbreak.cloud.event.credential.InteractiveCredentialCreationStatus in project cloudbreak by hortonworks.
the class CredentialSender method sendStatusMessage.
@Override
public void sendStatusMessage(CloudContext cloudContext, ExtendedCloudCredential extendedCloudCredential, boolean error, String statusMessage) {
InteractiveCredentialCreationStatus interactiveCredentialCreationStatus = new InteractiveCredentialCreationStatus(error, statusMessage, cloudContext, extendedCloudCredential);
eventBus.notify(interactiveCredentialCreationStatus.selector(), eventFactory.createEvent(interactiveCredentialCreationStatus));
}
use of com.sequenceiq.cloudbreak.cloud.event.credential.InteractiveCredentialCreationStatus in project cloudbreak by hortonworks.
the class InteractiveCredentialCreationStatusHandler method accept.
@Override
public void accept(Event<InteractiveCredentialCreationStatus> interactiveCredentialCreationFailedEvent) {
InteractiveCredentialCreationStatus interactiveCredentialCreationStatus = interactiveCredentialCreationFailedEvent.getData();
String message = interactiveCredentialCreationStatus.getMessage();
CloudbreakEventsJson notification = new CloudbreakEventsJson();
if (interactiveCredentialCreationStatus.isError()) {
notification.setEventType("CREDENTIAL_CREATE_FAILED");
} else {
notification.setEventType("INTERACTIVE_CREDENTIAL_STATUS");
}
notification.setEventTimestamp(new Date().getTime());
notification.setEventMessage(message);
notification.setOwner(interactiveCredentialCreationStatus.getCloudContext().getOwner());
notification.setAccount(interactiveCredentialCreationStatus.getExtendedCloudCredential().getAccount());
notification.setCloud(interactiveCredentialCreationStatus.getExtendedCloudCredential().getCloudPlatform());
notificationSender.send(new Notification<>(notification));
}
Aggregations