/** * Returns a particular global step definition based on its ID. * <P> * Global step definitions are those defined in the {@code <step-definitions>} * section of the configuration file. * * @param stepID step's identifier * @return the SubmissionStepConfig representing the step * @throws SubmissionConfigReaderException if no default submission process configuration defined */ public SubmissionStepConfig getStepConfig(String stepID) throws SubmissionConfigReaderException { // We should already have the step definitions loaded if (stepDefns != null) { // retreive step info Map<String, String> stepInfo = stepDefns.get(stepID); if (stepInfo != null) { return new SubmissionStepConfig(stepInfo); } } return null; }
/** * Constructs a new Submission Configuration object, based on the XML * configuration file (item-submission.xml) * * @param submissionName the submission process name * @param steps the vector listing of step information to build * SubmissionStepConfig objects for this submission process */ public SubmissionConfig(boolean isDefault, String submissionName, List<Map<String, String>> steps) { this.submissionName = submissionName; this.defaultConf = isDefault; // initialize a vector of SubmissionStepConfig objects List<SubmissionStepConfig> stepConfigs = new ArrayList<SubmissionStepConfig>(); // loop through our steps, and create SubmissionStepConfig objects for (int stepNum = 0; stepNum < steps.size(); stepNum++) { Map<String, String> stepInfo = steps.get(stepNum); SubmissionStepConfig step = new SubmissionStepConfig(stepInfo); // set the number of the step (starts at 0) and add it step.setStepNumber(stepNum); stepConfigs.add(step); log.debug("Added step '" + step.getProcessingClassName() + "' as step #" + step.getStepNumber() + " of submission process " + submissionName); } // get steps as an array of Strings submissionSteps = stepConfigs .toArray(new SubmissionStepConfig[stepConfigs.size()]); }