X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-manager-facade-xml%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Ffacade%2Fxml%2Frpc%2FRuntimeRpcElementResolved.java;fp=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Foperations%2Fruntimerpc%2FRuntimeRpcElementResolved.java;h=cd3d72a5c500d75a2e5393c76c2e923e2bd7b83a;hp=4bf469d7e6040384ab6131dd7fe86a4b527a07ea;hb=refs%2Fchanges%2F13%2F23413%2F26;hpb=071a641d7c12c0e6112d5ce0afe806b54f116ed2 diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolved.java b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/rpc/RuntimeRpcElementResolved.java similarity index 89% rename from opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolved.java rename to opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/rpc/RuntimeRpcElementResolved.java index 4bf469d7e6..cd3d72a5c5 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/operations/runtimerpc/RuntimeRpcElementResolved.java +++ b/opendaylight/config/config-manager-facade-xml/src/main/java/org/opendaylight/controller/config/facade/xml/rpc/RuntimeRpcElementResolved.java @@ -1,12 +1,12 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.controller.netconf.confignetconfconnector.operations.runtimerpc; +package org.opendaylight.controller.config.facade.xml.rpc; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; @@ -18,8 +18,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.management.ObjectName; import org.opendaylight.controller.config.api.jmx.ObjectNameUtil; -import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants; -import org.opendaylight.controller.netconf.confignetconfconnector.mapping.rpc.ModuleRpcs; +import org.opendaylight.controller.config.util.xml.XmlMappingConstants; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.Modules; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.rev130405.modules.Module; @@ -34,7 +33,7 @@ public final class RuntimeRpcElementResolved { private final Map additionalAttributes; private RuntimeRpcElementResolved(String namespace, String moduleName, String instanceName, String runtimeBeanName, - Map additionalAttributes) { + Map additionalAttributes) { this.moduleName = Preconditions.checkNotNull(moduleName, "Module name"); this.instanceName = Preconditions.checkNotNull(instanceName, "Instance name"); this.additionalAttributes = additionalAttributes; @@ -89,10 +88,10 @@ public final class RuntimeRpcElementResolved { "/" + getRegExForPrefixedName(Modules.QNAME.getLocalName())+ "/" + getRegExForPrefixedName(Module.QNAME.getLocalName()) + "\\[" - + "(?" + getRegExForPrefixedName(XmlNetconfConstants.TYPE_KEY) + "|" + getRegExForPrefixedName(XmlNetconfConstants.NAME_KEY) + ")" + + "(?" + getRegExForPrefixedName(XmlMappingConstants.TYPE_KEY) + "|" + getRegExForPrefixedName(XmlMappingConstants.NAME_KEY) + ")" + "=('|\")?(?[^'\"\\]]+)('|\")?" + "( and |\\]\\[)" - + "(?" + getRegExForPrefixedName(XmlNetconfConstants.TYPE_KEY) + "|" + getRegExForPrefixedName(XmlNetconfConstants.NAME_KEY) + ")" + + "(?" + getRegExForPrefixedName(XmlMappingConstants.TYPE_KEY) + "|" + getRegExForPrefixedName(XmlMappingConstants.NAME_KEY) + ")" + "=('|\")?(?[^'\"\\]]+)('|\")?" + "\\]" @@ -120,7 +119,8 @@ public final class RuntimeRpcElementResolved { Matcher matcher = xpathPattern.matcher(xpath); Preconditions.checkState(matcher.matches(), "Node %s with value '%s' not in required form on rpc element %s, required format is %s", - RuntimeRpc.CONTEXT_INSTANCE, xpath, elementName, xpathPatternBlueprint); + //TODO refactor this string, and/or unify with RPR.CONTEXT_INSTANCE from netconf + "context-instance", xpath, elementName, xpathPatternBlueprint); PatternGroupResolver groups = new PatternGroupResolver(matcher.group("key1"), matcher.group("value1"), matcher.group("value2"), matcher.group("additional")); @@ -148,11 +148,11 @@ public final class RuntimeRpcElementResolved { } String getModuleName() { - return key1.contains(XmlNetconfConstants.TYPE_KEY) ? value1 : value2; + return key1.contains(XmlMappingConstants.TYPE_KEY) ? value1 : value2; } String getInstanceName() { - return key1.contains(XmlNetconfConstants.NAME_KEY) ? value1 : value2; + return key1.contains(XmlMappingConstants.NAME_KEY) ? value1 : value2; }