Search in sources :

Example 1 with FreeIpaPollerObject

use of com.sequenceiq.environment.environment.flow.creation.handler.freeipa.FreeIpaPollerObject in project cloudbreak by hortonworks.

the class FreeIpaDeletionHandler method deleteFreeIpa.

private void deleteFreeIpa(Environment environment, boolean forced) {
    freeIpaService.delete(environment.getResourceCrn(), forced);
    ExtendedPollingResult result = freeIpaPollingService.pollWithTimeout(new FreeIpaDeletionRetrievalTask(freeIpaService), new FreeIpaPollerObject(environment.getId(), environment.getResourceCrn()), FreeIpaDeletionRetrievalTask.FREEIPA_RETRYING_INTERVAL, FreeIpaDeletionRetrievalTask.FREEIPA_RETRYING_COUNT, FreeIpaDeletionRetrievalTask.FREEIPA_FAILURE_COUNT);
    if (!result.isSuccess()) {
        String message = "Failed to delete FreeIpa! (" + result.getPollingResult().name() + ") " + getIfNotNull(result.getException(), Throwable::getMessage);
        LOGGER.info(message);
        throw new FreeIpaOperationFailedException(message);
    }
}
Also used : FreeIpaOperationFailedException(com.sequenceiq.environment.exception.FreeIpaOperationFailedException) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) FreeIpaPollerObject(com.sequenceiq.environment.environment.flow.creation.handler.freeipa.FreeIpaPollerObject)

Aggregations

ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)1 FreeIpaPollerObject (com.sequenceiq.environment.environment.flow.creation.handler.freeipa.FreeIpaPollerObject)1 FreeIpaOperationFailedException (com.sequenceiq.environment.exception.FreeIpaOperationFailedException)1