public static AccessCertificationCampaignStateType fromValue(String v) { for (AccessCertificationCampaignStateType c: AccessCertificationCampaignStateType.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
@SuppressWarnings("unused") public static boolean isCampaignClosed(AccessCertificationCampaignType campaign) { int currentStage = campaign.getStageNumber(); int stages = getNumberOfStages(campaign); return CLOSED.equals(campaign.getState()) || currentStage > stages; }
final AccessCertificationCampaignStateType state = campaign.getState(); LOGGER.trace("openNextStage: iteration={}, currentStageNumber={}, stages={}, state={}", norm(campaign.getIteration()), currentStageNumber, stages, state); if (IN_REVIEW_STAGE.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the stage " + currentStageNumber + " is currently open."); } else if (IN_REMEDIATION.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the campaign is currently in the remediation phase."); } else if (CLOSED.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the campaign is already closed."); } else if (!REVIEW_STAGE_DONE.equals(state) && !CREATED.equals(state)) { throw new IllegalStateException("Unexpected campaign state: " + state); } else if (currentStageNumber >= stages) {
public static AccessCertificationCampaignStateType fromValue(String v) { for (AccessCertificationCampaignStateType c: AccessCertificationCampaignStateType.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
LOGGER.trace("closeCurrentStage: currentStageNumber={}, stages={}, state={}", currentStageNumber, stages, state); if (!IN_REVIEW_STAGE.equals(state)) { result.recordFatalError("Couldn't close the current review stage as it is currently not open"); } else {
public static AccessCertificationCampaignStateType fromValue(String v) { for (AccessCertificationCampaignStateType c: AccessCertificationCampaignStateType.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); }
} else if (!REVIEW_STAGE_DONE.equals(state)) { result.recordFatalError("Couldn't start the remediation as the last stage was not properly closed."); } else {