X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-monitoring%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fmonitoring%2FGet.java;h=baea3a5e09f816fdecb76720ac65816fde4b6fbb;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=3b3f71b0ed0f3aad635d88d6b0bb93a3e4229aa3;hpb=76b553837d30cd4c9d423251d9c4b9e218e53f6a;p=controller.git diff --git a/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java b/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java index 3b3f71b0ed..baea3a5e09 100644 --- a/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java +++ b/opendaylight/netconf/netconf-monitoring/src/main/java/org/opendaylight/controller/netconf/monitoring/Get.java @@ -8,7 +8,9 @@ package org.opendaylight.controller.netconf.monitoring; import java.util.Collections; -import org.opendaylight.controller.netconf.api.NetconfDocumentedException; +import org.opendaylight.controller.config.util.xml.DocumentedException; +import org.opendaylight.controller.config.util.xml.XmlElement; +import org.opendaylight.controller.config.util.xml.XmlMappingConstants; import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService; import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; @@ -16,7 +18,6 @@ import org.opendaylight.controller.netconf.mapping.api.NetconfOperationChainedEx import org.opendaylight.controller.netconf.monitoring.xml.JaxBSerializer; import org.opendaylight.controller.netconf.monitoring.xml.model.NetconfState; import org.opendaylight.controller.netconf.util.mapping.AbstractNetconfOperation; -import org.opendaylight.controller.netconf.util.xml.XmlElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; @@ -24,7 +25,7 @@ import org.w3c.dom.Element; public class Get extends AbstractNetconfOperation { - private static final Logger logger = LoggerFactory.getLogger(Get.class); + private static final Logger LOG = LoggerFactory.getLogger(Get.class); private final NetconfMonitoringService netconfMonitor; public Get(final NetconfMonitoringService netconfMonitor) { @@ -33,9 +34,9 @@ public class Get extends AbstractNetconfOperation { } private Element getPlaceholder(final Document innerResult) - throws NetconfDocumentedException { + throws DocumentedException { final XmlElement rootElement = XmlElement.fromDomElementWithExpected( - innerResult.getDocumentElement(), XmlNetconfConstants.RPC_REPLY_KEY, XmlNetconfConstants.RFC4741_TARGET_NAMESPACE); + innerResult.getDocumentElement(), XmlMappingConstants.RPC_REPLY_KEY, XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0); return rootElement.getOnlyChildElement(XmlNetconfConstants.DATA_KEY).getDomElement(); } @@ -51,12 +52,12 @@ public class Get extends AbstractNetconfOperation { @Override public Document handle(final Document requestMessage, final NetconfOperationChainedExecution subsequentOperation) - throws NetconfDocumentedException { + throws DocumentedException { if (subsequentOperation.isExecutionTermination()){ - throw new NetconfDocumentedException(String.format("Subsequent netconf operation expected by %s", this), - NetconfDocumentedException.ErrorType.application, - NetconfDocumentedException.ErrorTag.operation_failed, - NetconfDocumentedException.ErrorSeverity.error); + throw new DocumentedException(String.format("Subsequent netconf operation expected by %s", this), + DocumentedException.ErrorType.application, + DocumentedException.ErrorTag.operation_failed, + DocumentedException.ErrorSeverity.error); } try { @@ -72,18 +73,18 @@ public class Get extends AbstractNetconfOperation { return innerResult; } catch (final RuntimeException e) { final String errorMessage = "Get operation for netconf-state subtree failed"; - logger.warn(errorMessage, e); + LOG.warn(errorMessage, e); - throw new NetconfDocumentedException(errorMessage, NetconfDocumentedException.ErrorType.application, - NetconfDocumentedException.ErrorTag.operation_failed, - NetconfDocumentedException.ErrorSeverity.error, - Collections.singletonMap(NetconfDocumentedException.ErrorSeverity.error.toString(), e.getMessage())); + throw new DocumentedException(errorMessage, DocumentedException.ErrorType.application, + DocumentedException.ErrorTag.operation_failed, + DocumentedException.ErrorSeverity.error, + Collections.singletonMap(DocumentedException.ErrorSeverity.error.toString(), e.getMessage())); } } @Override protected Element handle(final Document document, final XmlElement message, final NetconfOperationChainedExecution subsequentOperation) - throws NetconfDocumentedException { + throws DocumentedException { throw new UnsupportedOperationException("Never gets called"); } }