private State getState(String requirementId) { Requirement requirement = requirementManageService.get(requirementId); if (null == requirement) { throw new IllegalArgumentException(String.format("Requirement[%s] not found", requirementId)); } State targetState = stateMapping.get(requirement.getStatus()); if (null == targetState) { throw new IllegalArgumentException( String.format( "Requirement[%s] status[%s] not support", requirementId, requirement.getStatus())); } return targetState; }
@Override public void disable(String requirementId) { requirementManageService.compareAndSetStatus( requirementId, this.status(requirementId), IntegrateStatus.DISABLED.status()); }
@Override public void action(String requirementId) { requirementManageService.compareAndSetStatus( requirementId, this.status(requirementId), IntegrateStatus.COMMITED.status()); }