public void addProgressStatusToSupplementalCommand(SupplementalCommand supplemental) { if (commandProgress == null || supplemental == null) { return; } if (progressForMainCommand != null && progressMirroring == null) { throw new IllegalStateException("Suplmenetal commands must be filled with ProgressStatus before main command!"); } if (replicationCount < 0) { throw new IllegalStateException("Replication count must be provided first"); } if (supplemental.getProgressAnnotation() != null) { if (progressMirroring == null) { commandProgress.setTotalStepCount(replicationCount + 1); progressMirroring = commandProgress.createMirroringChild(1); progressForMainCommand = progressMirroring.createChild(null, 0, progressAnnotation.totalStepCount()); } supplemental.setProgressStatus(progressMirroring.createChild(supplemental.getProgressAnnotation().name(), 0, supplemental.getProgressAnnotation().totalStepCount())); } }