import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Optional;
import com.google.common.collect.Multimap;
+import java.util.Arrays;
+import java.util.Map;
import org.opendaylight.controller.config.api.ServiceReferenceReadableRegistry;
-import org.opendaylight.controller.config.util.ConfigRegistryClient;
import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.Config;
import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.ModuleElementDefinition;
import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.ModuleElementResolved;
import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.ServiceRegistryWrapper;
import org.opendaylight.controller.netconf.confignetconfconnector.mapping.config.Services;
import org.opendaylight.controller.netconf.confignetconfconnector.operations.Datastore;
-import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider;
import org.opendaylight.controller.netconf.util.exception.MissingNameSpaceException;
import org.opendaylight.controller.netconf.util.exception.UnexpectedNamespaceException;
import org.opendaylight.controller.netconf.util.xml.XmlElement;
-import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.Arrays;
-import java.util.Map;
-
public class EditConfigXmlParser {
- private static final Logger logger = LoggerFactory.getLogger(EditConfigXmlParser.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EditConfigXmlParser.class);
public static final String EDIT_CONFIG = "edit-config";
public static final String DEFAULT_OPERATION_KEY = "default-operation";
public EditConfigXmlParser() {
}
- EditConfigXmlParser.EditConfigExecution fromXml(final XmlElement xml, final Config cfgMapping,
- TransactionProvider transactionProvider, ConfigRegistryClient configRegistryClient)
+ EditConfigXmlParser.EditConfigExecution fromXml(final XmlElement xml, final Config cfgMapping)
throws NetconfDocumentedException {
//TODO remove transactionProvider and CfgRegistry from parameters, accept only service ref store
targetElement = xml.getOnlyChildElementWithSameNamespace(EditConfigXmlParser.TARGET_KEY);
targetChildNode = targetElement.getOnlyChildElementWithSameNamespace();
} catch (final MissingNameSpaceException | UnexpectedNamespaceException e) {
- logger.trace("Can't get only child element with same namespace due to {}",e);
+ LOG.trace("Can't get only child element with same namespace", e);
throw NetconfDocumentedException.wrap(e);
}
String datastoreValue = targetChildNode.getName();
Datastore targetDatastore = Datastore.valueOf(datastoreValue);
- logger.debug("Setting {} to '{}'", EditConfigXmlParser.TARGET_KEY, targetDatastore);
+ LOG.debug("Setting {} to '{}'", EditConfigXmlParser.TARGET_KEY, targetDatastore);
// check target
if (targetDatastore != Datastore.candidate){
} else {
testOption = EditConfigXmlParser.TestOption.getDefault();
}
- logger.debug("Setting {} to '{}'", EditConfigXmlParser.TEST_OPTION_KEY, testOption);
+ LOG.debug("Setting {} to '{}'", EditConfigXmlParser.TEST_OPTION_KEY, testOption);
// Error option
Optional<XmlElement> errorOptionElement = xml
.getOnlyChildElementWithSameNamespaceOptionally(EditConfigXmlParser.DEFAULT_OPERATION_KEY);
if (defaultContent.isPresent()) {
String mergeStrategyString = defaultContent.get().getTextContent();
- logger.trace("Setting merge strategy to {}", mergeStrategyString);
+ LOG.trace("Setting merge strategy to {}", mergeStrategyString);
editStrategyType = EditStrategyType.valueOf(mergeStrategyString);
}
try {
configElement = xml.getOnlyChildElementWithSameNamespace(XmlNetconfConstants.CONFIG_KEY);
} catch (MissingNameSpaceException e) {
- logger.trace("Can't get only child element with same namespace due to {}",e);
+ LOG.trace("Can't get only child element with same namespace due to ",e);
throw NetconfDocumentedException.wrap(e);
}