+ return new ObjectNameAttributeMappingStrategy.MappedDependency(prefixNamespace.getValue(), serviceName,
+ dependencyName);
+ }
+
+ public static String checkPrefixAndExtractServiceName(XmlElement typeElement, Map.Entry<String, String> prefixNamespace) throws NetconfDocumentedException {
+ String serviceName = typeElement.getTextContent();
+
+ Preconditions.checkState(!prefixNamespace.equals(""), "Service %s value not prefixed with namespace",
+ XmlNetconfConstants.TYPE_KEY);
+ String prefix = prefixNamespace.getKey() + PREFIX_SEPARATOR;
+ Preconditions.checkState(serviceName.startsWith(prefix),
+ "Service %s not correctly prefixed, expected %s, but was %s", XmlNetconfConstants.TYPE_KEY, prefix,
+ serviceName);
+ serviceName = serviceName.substring(prefix.length());
+ return serviceName;