protected static void addProvenanceReportingTask(final Element element, ConfigSchema configSchema) throws ConfigurationChangeException {
try {
ProvenanceReportingSchema provenanceProperties = configSchema.getProvenanceReportingProperties();
final Element taskElement = element.getOwnerDocument().createElement("reportingTask");
addTextElement(taskElement, "id", "Provenance-Reporting");
addTextElement(taskElement, "name", "Site-To-Site-Provenance-Reporting");
addTextElement(taskElement, "comment", provenanceProperties.getComment());
addTextElement(taskElement, "class", DEFAULT_PROV_REPORTING_TASK_CLASS);
addTextElement(taskElement, "schedulingPeriod", provenanceProperties.getSchedulingPeriod());
addTextElement(taskElement, "scheduledState", "RUNNING");
addTextElement(taskElement, "schedulingStrategy", provenanceProperties.getSchedulingStrategy());
Map<String, Object> attributes = new HashMap<>();
attributes.put("Destination URL", provenanceProperties.getDestinationUrl());
attributes.put("Input Port Name", provenanceProperties.getPortName());
attributes.put("Instance URL", provenanceProperties.getOriginatingUrl());
attributes.put("Compress Events", provenanceProperties.getUseCompression());
attributes.put("Batch Size", provenanceProperties.getBatchSize());
attributes.put("Communications Timeout", provenanceProperties.getTimeout());
SecurityPropertiesSchema securityProps = configSchema.getSecurityProperties();
if (securityProps.useSSL()) {
attributes.put("SSL Context Service", "SSL-Context-Service");
}
addConfiguration(taskElement, attributes);
element.appendChild(taskElement);
} catch (Exception e) {
throw new ConfigurationChangeException("Failed to parse the config YAML while trying to add the Provenance Reporting Task", e);
}
}