protected static void addControllerService(final Element element, ControllerServiceSchema controllerServiceSchema) throws ConfigurationChangeException { try { final Element serviceElement = element.getOwnerDocument().createElement("controllerService"); addTextElement(serviceElement, "id", controllerServiceSchema.getId()); addTextElement(serviceElement, "name", controllerServiceSchema.getName()); addTextElement(serviceElement, "comment", ""); addTextElement(serviceElement, "class", controllerServiceSchema.getServiceClass()); addTextElement(serviceElement, "enabled", "true"); Map<String, Object> attributes = controllerServiceSchema.getProperties(); addConfiguration(serviceElement, attributes); String annotationData = controllerServiceSchema.getAnnotationData(); if(annotationData != null && !annotationData.isEmpty()) { addTextElement(element, "annotationData", annotationData); } element.appendChild(serviceElement); } catch (Exception e) { throw new ConfigurationChangeException("Failed to parse the config YAML while trying to create an SSL Controller Service", e); } }