From 56c27daf1656fd6436f8c818c771cf803079e1ea Mon Sep 17 00:00:00 2001 From: Michael DÜrre Date: Mon, 18 Jan 2021 05:41:16 +0100 Subject: migrate sli to alu-SR1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit migrate ODL interfaces and fix code for changes in alu-SR1 Issue-ID: CCSDK-3089 Signed-off-by: Michael DÜrre Change-Id: Id48dcfc517585f2ce6b30047113cd1d173c3c9dc Signed-off-by: Michael DÜrre --- plugins/restconf-client/provider/pom.xml | 13 ++++ .../restconfapicall/RestconfApiCallNode.java | 80 +++++++++------------- .../plugins/restconfapicall/RestconfApiUtils.java | 18 +++-- .../dfserializer/DfSerializerUtil.java | 42 ++++++------ .../MdsalPropertiesNodeSerializer.java | 26 ++++--- .../pnserializer/MdsalPropertiesNodeUtils.java | 37 +++++----- .../blueprint/restconf-client-blueprint.xml | 51 -------------- .../pnserializer/PropertiesSerializerTest.java | 14 ++-- 8 files changed, 109 insertions(+), 172 deletions(-) delete mode 100755 plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml (limited to 'plugins/restconf-client') diff --git a/plugins/restconf-client/provider/pom.xml b/plugins/restconf-client/provider/pom.xml index dbe16754f..58aa4219b 100755 --- a/plugins/restconf-client/provider/pom.xml +++ b/plugins/restconf-client/provider/pom.xml @@ -24,6 +24,13 @@ pom import + + org.glassfish.jersey + jersey-bom + 2.27 + import + pom + @@ -31,6 +38,7 @@ org.glassfish.jersey.media jersey-media-sse + javax.ws.rs javax.ws.rs-api @@ -113,6 +121,11 @@ jersey-container-grizzly2-http test + + org.glassfish.jersey.inject + jersey-hk2 + test + org.hamcrest hamcrest-library diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java index 620df282f..679ba57b7 100644 --- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java +++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java @@ -20,23 +20,48 @@ package org.onap.ccsdk.sli.plugins.restconfapicall; +import static com.google.common.base.Strings.repeat; +import static java.lang.String.format; +import static java.lang.String.valueOf; +import static org.apache.commons.lang3.StringUtils.join; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.DELETE; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.GET; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PATCH; +import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COLON; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMMA; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HEADER; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_REQ; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_RES; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REQ_ERR; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_CODE; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_MSG; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_PRE; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getSchemaCtxFromDir; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getUpdatedXmlReq; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getYangParameters; +import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.parseUrl; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfListenerFactory.instance; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.FORMAT_ERR; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.UTF_HEADER; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.XML_TREE_ERR; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.getXmlWriter; +import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getModuleNamespace; +import static org.osgi.framework.FrameworkUtil.getBundle; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonWriter; - -import javax.ws.rs.core.UriBuilder; import java.io.StringWriter; import java.io.Writer; import java.net.SocketException; import java.net.URI; -import java.net.URISyntaxException; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; - import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; @@ -59,6 +84,7 @@ import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.Namespace; import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.PropertiesNodeSerializer; import org.opendaylight.restconf.common.context.InstanceIdentifierContext; import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaNode; import org.osgi.framework.BundleContext; @@ -66,44 +92,6 @@ import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.google.common.base.Strings.repeat; -import static java.lang.String.format; -import static java.lang.String.valueOf; -import static org.apache.commons.lang3.StringUtils.join; -import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.DELETE; -import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.GET; -import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PATCH; -import static org.onap.ccsdk.sli.plugins.restapicall.HttpMethod.PUT; -import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.ATTEMPTS_MSG; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COLON; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMMA; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.COMM_FAIL; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HEADER; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_REQ; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.HTTP_RES; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.MAX_RETRY_ERR; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.NO_MORE_RETRY; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REQ_ERR; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.REST_API_URL; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_CODE; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_MSG; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RES_PRE; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_COUNT; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.RETRY_FAIL; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.UPDATED_URL; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getSchemaCtxFromDir; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getUpdatedXmlReq; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.getYangParameters; -import static org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiUtils.parseUrl; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfListenerFactory.instance; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.FORMAT_ERR; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.UTF_HEADER; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.XML_TREE_ERR; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.getXmlWriter; -import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getModuleNamespace; -import static org.osgi.framework.FrameworkUtil.getBundle; - /** * Representation of a plugin to enable RESTCONF based CRUD operations from DG. */ @@ -299,7 +287,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { private InstanceIdentifierContext getInsIdCtx(YangParameters params, String uri) throws SvcLogicException { - SchemaContext context = getSchemaContext(params); + EffectiveModelContext context = getSchemaContext(params); return ParserIdentifier.toInstanceIdentifier(uri, context, null); } @@ -311,18 +299,18 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { * @return schema context * @throws SvcLogicException when schema context fetching fails */ - private SchemaContext getSchemaContext(YangParameters params) + private EffectiveModelContext getSchemaContext(YangParameters params) throws SvcLogicException { if (params.dirPath != null) { return getSchemaCtxFromDir(params.dirPath); } BundleContext bc = getBundle(SchemaContext.class).getBundleContext(); - SchemaContext schemaContext = null; + EffectiveModelContext schemaContext = null; if (bc != null) { ServiceReference reference = bc.getServiceReference( SchemaContext.class); if (reference != null) { - schemaContext = (SchemaContext) bc.getService(reference); + schemaContext = (EffectiveModelContext) bc.getService(reference); } } return schemaContext; diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java index 1309102b3..d22c3707a 100644 --- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java +++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java @@ -22,6 +22,12 @@ package org.onap.ccsdk.sli.plugins.restconfapicall; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters; +import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; +import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE; +import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile; +import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor; +import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create; import java.io.File; import java.io.IOException; import java.net.URI; @@ -33,23 +39,15 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restapicall.HttpMethod; import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.YangParameters; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException; import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource; import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException; import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor; -import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters; -import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam; -import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE; -import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile; -import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor; -import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create; - /** * Utilities for restconf api call node. */ @@ -190,7 +188,7 @@ public final class RestconfApiUtils { * @return YANG schema context * @throws SvcLogicException when YANG file reading fails */ - static SchemaContext getSchemaCtxFromDir(String di) + static EffectiveModelContext getSchemaCtxFromDir(String di) throws SvcLogicException { Path d = Paths.get(di); File dir = d.toFile(); diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java index 707c29444..14824f51e 100644 --- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java +++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DfSerializerUtil.java @@ -20,6 +20,25 @@ package org.onap.ccsdk.sli.plugins.yangserializers.dfserializer; +import static javax.xml.transform.OutputKeys.INDENT; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.OBJECT_NODE; +import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.TEXT_NODE; +import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getRevision; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Iterator; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; import org.dom4j.Element; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.Namespace; @@ -31,27 +50,6 @@ import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Iterator; - -import static javax.xml.transform.OutputKeys.INDENT; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.OBJECT_NODE; -import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.XmlNodeType.TEXT_NODE; -import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getRevision; - /** * Utilities for data format serializer. */ @@ -179,7 +177,7 @@ public final class DfSerializerUtil { parentNs.revision()); } - Iterator it; + Iterator it; Module mod; if (mName != null) { it = ctx.findModules(mName).iterator(); diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java index 8a6e75668..8fd7a12bc 100644 --- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java +++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeSerializer.java @@ -20,18 +20,6 @@ package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer; -import java.util.HashMap; -import java.util.Map; - -import org.onap.ccsdk.sli.core.sli.SvcLogicException; -import org.opendaylight.restconf.common.errors.RestconfDocumentedException; -import org.opendaylight.yangtools.yang.model.api.Module; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; -import org.opendaylight.yangtools.yang.model.api.SchemaNode; -import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.DOT_REGEX; import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.SLASH; import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getChildSchemaNode; @@ -49,11 +37,21 @@ import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.M import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.MULTI_INSTANCE_NODE; import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.SINGLE_INSTANCE_LEAF_NODE; import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.NodeType.SINGLE_INSTANCE_NODE; +import java.util.HashMap; +import java.util.Map; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.opendaylight.restconf.common.errors.RestconfDocumentedException; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; +import org.opendaylight.yangtools.yang.model.api.Module; +import org.opendaylight.yangtools.yang.model.api.SchemaNode; +import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Representation of mdsal based properties node serializer implementation. */ -public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer { +public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer { private static final Logger log = LoggerFactory.getLogger( MdsalPropertiesNodeSerializer.class); @@ -68,7 +66,7 @@ public class MdsalPropertiesNodeSerializer extends PropertiesNodeSerializer id = toInstanceIdentifier( - uri1, context, null); + uri1, context, Optional.ofNullable(null)); return new SchemaPathHolder(id, uri1); } catch (IllegalArgumentException | RestconfDocumentedException | NullPointerException e) { @@ -289,7 +288,7 @@ public final class MdsalPropertiesNodeUtils { * @return schema and path holder */ private static SchemaPathHolder processNodesAndAppendPath(String uri, - SchemaContext context) { + EffectiveModelContext context) { String actPath = ""; SchemaPathHolder id = new SchemaPathHolder(null, ""); @@ -330,9 +329,7 @@ public final class MdsalPropertiesNodeUtils { * @param prefix prefix for the node in the path * @return schema and path holder */ - private static SchemaPathHolder processIdentifier(String node, - SchemaContext context, - String prefix) { + private static SchemaPathHolder processIdentifier(String node, EffectiveModelContext context, String prefix) { String[] values = node.split(UNDERSCORE); String val = values[0]; @@ -378,7 +375,7 @@ public final class MdsalPropertiesNodeUtils { * @param curSchema current schema * @return namespace of the given node */ - static Namespace getNamespace(String childName, SchemaContext ctx, + static Namespace getNamespace(String childName, EffectiveModelContext ctx, PropertiesNode parent, SchemaNode curSchema) { Namespace parentNs = parent.namespace(); @@ -425,8 +422,8 @@ public final class MdsalPropertiesNodeUtils { * @param ctx schema context * @return namespace of the given node name */ - private static Namespace getNs(String modName, SchemaContext ctx) { - Iterator it = ctx.findModules(modName).iterator(); + private static Namespace getNs(String modName, EffectiveModelContext ctx) { + Iterator it = ctx.findModules(modName).iterator(); if (it.hasNext()) { Module m = it.next(); return new Namespace(modName, m.getQNameModule().getNamespace(), @@ -488,7 +485,7 @@ public final class MdsalPropertiesNodeUtils { public static NodeType getNodeType(int index, int length, String name, SchemaNode schema) { if (index == length-1) { - if (schema instanceof AnyXmlSchemaNode){ + if (schema instanceof AnyxmlSchemaNode) { return NodeType.ANY_XML_NODE; } return (isListEntry(name) ? NodeType.MULTI_INSTANCE_LEAF_NODE : @@ -517,9 +514,7 @@ public final class MdsalPropertiesNodeUtils { * @return value namespace * @throws SvcLogicException if identity/module could not be found */ - static Namespace getValueNamespace(String value, - SchemaContext ctx) - throws SvcLogicException { + static Namespace getValueNamespace(String value, EffectiveModelContext ctx) throws SvcLogicException { String prefix = getPrefixFromValue(value); if (prefix == null) { return null; @@ -528,7 +523,7 @@ public final class MdsalPropertiesNodeUtils { IdentitySchemaNode id = IdentityCodecUtil.parseIdentity(value, ctx, prefixToModule -> { - final Iterator modules = ctx.findModules(prefix).iterator(); + final Iterator modules = ctx.findModules(prefix).iterator(); checkArgument(modules.hasNext(), "Could not find " + "module %s", prefix); return modules.next().getQNameModule(); diff --git a/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml b/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml deleted file mode 100755 index 45c335b13..000000000 --- a/plugins/restconf-client/provider/src/main/resources/OSGI-INF/blueprint/restconf-client-blueprint.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode - - - - - - org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode - - - - \ No newline at end of file diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java index c3a6b4ea8..2bcd45e2b 100644 --- a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java +++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/PropertiesSerializerTest.java @@ -19,6 +19,9 @@ */ package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertTrue; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; @@ -27,21 +30,16 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; - import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.opendaylight.restconf.common.context.InstanceIdentifierContext; import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; +import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertTrue; - public final class PropertiesSerializerTest { - private SchemaContext context; + private EffectiveModelContext context; @Before public void initialization() throws FileNotFoundException { @@ -1125,7 +1123,7 @@ public final class PropertiesSerializerTest { assertThat(l.valueNs().moduleNs().toString(), is("identity:list:second:ns:test:json:ser")); } - public static SchemaContext compileYangFile() throws FileNotFoundException { + public static EffectiveModelContext compileYangFile() throws FileNotFoundException { String path = PropertiesSerializerTest.class.getResource("/yang").getPath(); File dir = new File(path); String[] fileList = dir.list(); -- cgit 1.2.3-korg