Search in sources :

Example 1 with InteractiveCredentialCreationStatus

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));
}
Also used : InteractiveCredentialCreationStatus(com.sequenceiq.cloudbreak.cloud.event.credential.InteractiveCredentialCreationStatus)

Example 2 with 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));
}
Also used : InteractiveCredentialCreationStatus(com.sequenceiq.cloudbreak.cloud.event.credential.InteractiveCredentialCreationStatus) CloudbreakEventsJson(com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson) Date(java.util.Date)

Aggregations

InteractiveCredentialCreationStatus (com.sequenceiq.cloudbreak.cloud.event.credential.InteractiveCredentialCreationStatus)2 CloudbreakEventsJson (com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson)1 Date (java.util.Date)1