private Properties initTopLevelJobProperties() { // Should this be in the spec (that Properties is never null)? Or is it already? Properties jobProperties = new Properties(); JSLProperties jslProperties = new JSLProperties(); if (jobNavigator.getRootModelElement() != null) { jslProperties = jobNavigator.getRootModelElement().getProperties(); } if (jslProperties != null) { // null if not job properties defined. for (Property property : jslProperties.getPropertyList()) { jobProperties.setProperty(property.getName(), property.getValue()); } } return jobProperties; }
public static JSLProperties cloneJSLProperties(JSLProperties jslProps) { if (jslProps == null) { return null; } JSLProperties newJSLProps = jslFactory.createJSLProperties(); newJSLProps.setPartition(jslProps.getPartition());; for(Property jslProp : jslProps.getPropertyList()) { Property newProperty = jslFactory.createProperty(); newProperty.setName(jslProp.getName()); newProperty.setValue(jslProp.getValue()); newJSLProps.getPropertyList().add(newProperty); } return newJSLProps; }
/** * Compare two <properties> elements and their contents. The properties need not * be in the same order. * @param jslprops1 first <properties> element, could be null * @param jslprops2 second <properties> element, could be null * @return whether JSLProperties contain the same property names/values */ public static boolean equals(JSLProperties jslprops1, JSLProperties jslprops2) { //TODO: test cases if(jslprops1 == null && jslprops2 == null) return true; if(jslprops1 == null || jslprops2 == null) return false; boolean stillEqual = true; for(Property prop1 : jslprops1.getPropertyList()) { boolean isListenerInOtherList = false; for(Property prop2 : jslprops2.getPropertyList()) { if(equals(prop1, prop2)) isListenerInOtherList = true; } stillEqual = stillEqual && isListenerInOtherList; } return stillEqual; }
: partitionMapper.getProperties().getPropertyList(); int targetPartition = Integer.parseInt(props.getPartition());
/** * Create an instance of {@link JSLProperties } * */ public JSLProperties createJSLProperties() { return new JSLProperties(); }
int targetPartition = Integer.parseInt(props.getPartition());
/** * Compare two <properties> elements and their contents. The properties need not * be in the same order. * @param jslprops1 first <properties> element, could be null * @param jslprops2 second <properties> element, could be null * @return whether JSLProperties contain the same property names/values */ public static boolean equals(JSLProperties jslprops1, JSLProperties jslprops2) { //TODO: test cases if(jslprops1 == null && jslprops2 == null) return true; if(jslprops1 == null || jslprops2 == null) return false; boolean stillEqual = true; for(Property prop1 : jslprops1.getPropertyList()) { boolean isListenerInOtherList = false; for(Property prop2 : jslprops2.getPropertyList()) { if(equals(prop1, prop2)) isListenerInOtherList = true; } stillEqual = stillEqual && isListenerInOtherList; } return stillEqual; }
: partitionMapper.getProperties().getPropertyList(); int targetPartition = Integer.parseInt(props.getPartition());
/** * Create an instance of {@link JSLProperties } * */ public JSLProperties createJSLProperties() { return new JSLProperties(); }
/** * Compare two <properties> elements and their contents. The properties need not * be in the same order. * @param jslprops1 first <properties> element, could be null * @param jslprops2 second <properties> element, could be null * @return whether JSLProperties contain the same property names/values */ public static boolean equals(JSLProperties jslprops1, JSLProperties jslprops2) { //TODO: test cases if(jslprops1 == null && jslprops2 == null) return true; if(jslprops1 == null || jslprops2 == null) return false; boolean stillEqual = true; for(Property prop1 : jslprops1.getPropertyList()) { boolean isListenerInOtherList = false; for(Property prop2 : jslprops2.getPropertyList()) { if(equals(prop1, prop2)) isListenerInOtherList = true; } stillEqual = stillEqual && isListenerInOtherList; } return stillEqual; }
public static JSLProperties cloneJSLProperties(JSLProperties jslProps) { if (jslProps == null) { return null; } JSLProperties newJSLProps = jslFactory.createJSLProperties(); newJSLProps.setPartition(jslProps.getPartition());; for(Property jslProp : jslProps.getPropertyList()) { Property newProperty = jslFactory.createProperty(); newProperty.setName(jslProp.getName()); newProperty.setValue(jslProp.getValue()); newJSLProps.getPropertyList().add(newProperty); } return newJSLProps; }
public static JSLProperties buildStepProperties(JobStepDefinition jobStepDefinition, JobStep jobStep, boolean hasNext) { JSLProperties jslProperties = new JSLProperties(); List<Property> jslPropertyList = jslProperties.getPropertyList(); Property jslStepIndexProperty = new Property(); jslStepIndexProperty.setName(StepContextPropertyNames.STEP_INDEX); jslStepIndexProperty.setValue(String.valueOf(jobStep.getStepIndex())); jslPropertyList.add(jslStepIndexProperty); if (hasNext) { Property jslStepNextIndexProperty = new Property(); jslStepNextIndexProperty.setName(StepContextPropertyNames.STEP_NEXT_INDEX); jslStepNextIndexProperty.setValue(String.valueOf(jobStep.getStepIndex() + 1)); jslPropertyList.add(jslStepNextIndexProperty); } jslPropertyList.addAll(buildCustomStepProperties(jobStepDefinition, jobStep)); return jslProperties; }
/** * Create an instance of {@link JSLProperties } * */ public JSLProperties createJSLProperties() { return new JSLProperties(); }
public String toString() { StringBuffer buf = new StringBuffer(140); buf.append("JSL Properties: "); List<Property> propList = getPropertyList(); if (propList.size() == 0) { buf.append("<no properties>"); } else { for (Property p : propList) { buf.append(p.toString() + "\n"); } } return buf.toString(); } }
public static JSLProperties cloneJSLProperties(JSLProperties jslProps) { if (jslProps == null) { return null; } JSLProperties newJSLProps = jslFactory.createJSLProperties(); newJSLProps.setPartition(jslProps.getPartition());; for(Property jslProp : jslProps.getPropertyList()) { Property newProperty = jslFactory.createProperty(); newProperty.setName(jslProp.getName()); newProperty.setValue(jslProp.getValue()); newJSLProps.getPropertyList().add(newProperty); } return newJSLProps; }
public static JSLProperties buildStepProperties(JobStepDefinition jobStepDefinition, JobStep jobStep, boolean hasNext) { JSLProperties jslProperties = new JSLProperties(); List<Property> jslPropertyList = jslProperties.getPropertyList(); Property jslStepIndexProperty = new Property(); jslStepIndexProperty.setName(StepContextPropertyNames.STEP_INDEX); jslStepIndexProperty.setValue(String.valueOf(jobStep.getStepIndex())); jslPropertyList.add(jslStepIndexProperty); if (hasNext) { Property jslStepNextIndexProperty = new Property(); jslStepNextIndexProperty.setName(StepContextPropertyNames.STEP_NEXT_INDEX); jslStepNextIndexProperty.setValue(String.valueOf(jobStep.getStepIndex() + 1)); jslPropertyList.add(jslStepNextIndexProperty); } jslPropertyList.addAll(buildCustomStepProperties(jobStepDefinition, jobStep)); return jslProperties; }
private static JobContextImpl getJobContext(ModelNavigator<JSLJob> jobNavigator) { JSLProperties jslProperties = new JSLProperties(); if(jobNavigator.getRootModelElement() != null) { jslProperties = jobNavigator.getRootModelElement().getProperties(); } return new JobContextImpl(jobNavigator, jslProperties); }
public static String getString(JSLProperties props) { if (props == null) return null; StringBuffer buf = new StringBuffer(150); for (Property prop : props.getPropertyList()) { buf.append("name=" + prop.getName() + ",value=" + prop.getValue() + "\n"); } return buf.toString(); } }
for (JSLProperties jslProp : jslProps) { if (jslProp.getPartition() != null) { jslProp.setPartition(this.replaceAllProperties(jslProp.getPartition(), submittedProps, parentProps)); currentProps = this.resolveElementProperties(jslProp.getPropertyList(), submittedProps, parentProps);
public static JSLProperties buildJobProperties(KapuaId scopeId, KapuaId jobId, JobStartOptions jobStartOptions) throws JAXBException { List<Property> jslPropertyList = new ArrayList<>(); // Scope id Property scopeIdProperty = new Property(); scopeIdProperty.setName(JobContextPropertyNames.JOB_SCOPE_ID); scopeIdProperty.setValue(scopeId.toCompactId()); jslPropertyList.add(scopeIdProperty); // Job id Property jobIdProperty = new Property(); jobIdProperty.setName(JobContextPropertyNames.JOB_ID); jobIdProperty.setValue(jobId.toCompactId()); jslPropertyList.add(jobIdProperty); // Job target sublist Property targetSublistProperty = new Property(); targetSublistProperty.setName(JobContextPropertyNames.JOB_TARGET_SUBLIST); targetSublistProperty.setValue(XmlUtil.marshal(new JobTargetSublist(jobStartOptions.getTargetIdSublist()))); jslPropertyList.add(targetSublistProperty); // Job from step index if (jobStartOptions.getFromStepIndex() != null) { Property stepFromIndexProperty = new Property(); stepFromIndexProperty.setName(JobContextPropertyNames.JOB_STEP_FROM_INDEX); stepFromIndexProperty.setValue(jobStartOptions.getFromStepIndex().toString()); jslPropertyList.add(stepFromIndexProperty); } // // Add them to the JBatch properties JSLProperties jslProperties = new JSLProperties(); jslProperties.getPropertyList().addAll(jslPropertyList); return jslProperties; }