Search in sources :

Example 1 with ValidateCloudStorageSuccess

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageSuccess in project cloudbreak by hortonworks.

the class ValidateCloudStorageHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<ValidateCloudStorageRequest> event) {
    ValidateCloudStorageRequest request = event.getData();
    Selectable response;
    try {
        Stack stack = stackService.getByIdWithListsInTransaction(request.getResourceId());
        freeIpaCloudStorageValidationService.validate(stack);
        response = new ValidateCloudStorageSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("FreeIPA cloud storage validation failed", e);
        response = new ValidateCloudStorageFailed(request.getResourceId(), e);
    }
    return response;
}
Also used : ValidateCloudStorageRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageRequest) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ValidateCloudStorageFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageFailed) ValidateCloudStorageSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageSuccess) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 Stack (com.sequenceiq.freeipa.entity.Stack)1 ValidateCloudStorageFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageFailed)1 ValidateCloudStorageRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageRequest)1 ValidateCloudStorageSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageSuccess)1