@Test void testExitPollingWhenFreeIpaClusterIsInCreateInProgressState() { EnvironmentInMemoryStateStore.put(ENV_ID, PollGroup.CANCELLED); FreeIpaPollerObject freeIpaPollerObject = new FreeIpaPollerObject(ENV_ID, ENV_CRN); boolean result = underTest.exitPolling(freeIpaPollerObject); assertTrue(result); }
@Override public boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject) { PollGroup environmentPollGroup = EnvironmentInMemoryStateStore.get(freeIpaPollerObject.getEnvironmentId()); if (environmentPollGroup == null || environmentPollGroup.isCancelled()) { LOGGER.info("Cancelling the polling of environment's '{}' FreeIpa cluster creation, because a delete operation has already been " + "started on the environment", freeIpaPollerObject.getEnvironmentCrn()); return true; } return false; }
FreeIpaCreationRetrievalTask extends SimpleStatusCheckerTask<FreeIpaPollerObject> { @Override public boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject) { PollGroup environmentPollGroup = EnvironmentInMemoryStateStore.get(freeIpaPollerObject.getEnvironmentId()); if (environmentPollGroup == null || environmentPollGroup.isCancelled()) { LOGGER.info("Cancelling the polling of environment's '{}' FreeIpa cluster creation, because a delete operation has already been " + "started on the environment", freeIpaPollerObject.getEnvironmentCrn()); return true; } return false; } }
FreeIpaCreationRetrievalTask extends SimpleStatusCheckerTask<FreeIpaPollerObject> { @Override public boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject) { PollGroup environmentPollGroup = EnvironmentInMemoryStateStore.get(freeIpaPollerObject.getEnvironmentId()); if (environmentPollGroup == null || environmentPollGroup.isCancelled()) { LOGGER.info("Cancelling the polling of environment's '{}' FreeIpa cluster creation, because a delete operation has already been " + "started on the environment", freeIpaPollerObject.getEnvironmentCrn()); return true; } return false; } FreeIpaCreationRetrievalTask(FreeIpaService freeIpaService); }
FreeIpaCreationRetrievalTask extends SimpleStatusCheckerTask<FreeIpaPollerObject> { @Override public boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject) { PollGroup environmentPollGroup = EnvironmentInMemoryStateStore.get(freeIpaPollerObject.getEnvironmentId()); if (environmentPollGroup == null || environmentPollGroup.isCancelled()) { LOGGER.info("Cancelling the polling of environment's '{}' FreeIpa cluster creation, because a delete operation has already been " + "started on the environment", freeIpaPollerObject.getEnvironmentCrn()); return true; } return false; } FreeIpaCreationRetrievalTask(FreeIpaService freeIpaService); @Override boolean checkStatus(FreeIpaPollerObject freeIpaPollerObject); @Override void handleTimeout(FreeIpaPollerObject freeIpaPollerObject); @Override String successMessage(FreeIpaPollerObject freeIpaPollerObject); @Override boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject); }
FreeIpaCreationRetrievalTask extends SimpleStatusCheckerTask<FreeIpaPollerObject> { @Override public boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject) { PollGroup environmentPollGroup = EnvironmentInMemoryStateStore.get(freeIpaPollerObject.getEnvironmentId()); if (environmentPollGroup == null || environmentPollGroup.isCancelled()) { LOGGER.info("Cancelling the polling of environment's '{}' FreeIpa cluster creation, because a delete operation has already been " + "started on the environment", freeIpaPollerObject.getEnvironmentCrn()); return true; } return false; } FreeIpaCreationRetrievalTask(FreeIpaService freeIpaService); @Override boolean checkStatus(FreeIpaPollerObject freeIpaPollerObject); @Override void handleTimeout(FreeIpaPollerObject freeIpaPollerObject); @Override String successMessage(FreeIpaPollerObject freeIpaPollerObject); @Override boolean exitPolling(FreeIpaPollerObject freeIpaPollerObject); static final int FREEIPA_RETRYING_INTERVAL; static final int FREEIPA_RETRYING_COUNT; static final int FREEIPA_FAILURE_COUNT; }