Search in sources :

Example 1 with ConfigReferenceElements

use of com.thoughtworks.go.config.parser.ConfigReferenceElements in project gocd by gocd.

the class MagicalGoConfigXmlLoader method deserializeConfig.

public CruiseConfig deserializeConfig(String content) throws Exception {
    String md5 = CachedDigestUtils.md5Hex(content);
    Element element = parseInputStream(new ByteArrayInputStream(content.getBytes()));
    LOGGER.debug("[Config Save] Updating config cache with new XML");
    CruiseConfig configForEdit = classParser(element, BasicCruiseConfig.class, configCache, new GoCipher(), registry, new ConfigReferenceElements()).parse();
    setMd5(configForEdit, md5);
    configForEdit.setOrigins(new FileConfigOrigin());
    return configForEdit;
}
Also used : GoCipher(com.thoughtworks.go.security.GoCipher) ByteArrayInputStream(java.io.ByteArrayInputStream) FileConfigOrigin(com.thoughtworks.go.config.remote.FileConfigOrigin) Element(org.jdom2.Element) ConfigReferenceElements(com.thoughtworks.go.config.parser.ConfigReferenceElements)

Example 2 with ConfigReferenceElements

use of com.thoughtworks.go.config.parser.ConfigReferenceElements in project gocd by gocd.

the class MagicalGoConfigXmlLoader method fromXmlPartial.

public <T> T fromXmlPartial(InputStream inputStream, Class<T> o) throws Exception {
    Document document = new SAXBuilder().build(inputStream);
    Element element = document.getRootElement();
    return classParser(element, o, configCache, new GoCipher(), registry, new ConfigReferenceElements()).parse();
}
Also used : SAXBuilder(org.jdom2.input.SAXBuilder) GoCipher(com.thoughtworks.go.security.GoCipher) Element(org.jdom2.Element) ConfigReferenceElements(com.thoughtworks.go.config.parser.ConfigReferenceElements) Document(org.jdom2.Document) XmlUtils.buildXmlDocument(com.thoughtworks.go.util.XmlUtils.buildXmlDocument)

Aggregations

ConfigReferenceElements (com.thoughtworks.go.config.parser.ConfigReferenceElements)2 GoCipher (com.thoughtworks.go.security.GoCipher)2 Element (org.jdom2.Element)2 FileConfigOrigin (com.thoughtworks.go.config.remote.FileConfigOrigin)1 XmlUtils.buildXmlDocument (com.thoughtworks.go.util.XmlUtils.buildXmlDocument)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 Document (org.jdom2.Document)1 SAXBuilder (org.jdom2.input.SAXBuilder)1