use of com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageRequest in project cloudbreak by hortonworks.
the class FreeIpaUpscaleActions method validateFreeIpaCloudStorage.
@Bean(name = "UPSCALE_VALIDATING_CLOUD_STORAGE_STATE")
public Action<?, ?> validateFreeIpaCloudStorage() {
return new AbstractUpscaleAction<>(StackEvent.class) {
@Override
protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Validating cloud storage");
ValidateCloudStorageRequest request = new ValidateCloudStorageRequest(stack.getId());
sendEvent(context, request.selector(), request);
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageRequest 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;
}
Aggregations