diff options
author | Dan Timoney <dtimoney@att.com> | 2022-07-21 08:25:58 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2022-07-21 08:25:58 -0400 |
commit | de63cbb97a9f751f8856647dbf81eb632420cd9d (patch) | |
tree | 5a01dee9016aa40c2ca5948533170740e0c30721 /plugins/restconf-client/provider/src/main | |
parent | 01ec365d01605dd6b86c2c972eeea969835e74b8 (diff) |
Migrate sli to sulfur sr1
Migrate sli to OpenDaylight Sulfur release
Issue-ID: CCSDK-3693
Signed-off-by: Dan Timoney <dtimoney@att.com>
Change-Id: I3ca6fb12a03038a9447747650ea2a6e6d6e71d9d
Diffstat (limited to 'plugins/restconf-client/provider/src/main')
3 files changed, 14 insertions, 13 deletions
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 4a2e18198..2e4a6c34c 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 @@ -87,8 +87,9 @@ import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.SchemaNode; -import org.opendaylight.yangtools.yang.model.parser.api.YangParserException; -import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory; + +import org.opendaylight.yangtools.yang.parser.api.YangParserException; +import org.opendaylight.yangtools.yang.parser.api.YangParserFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -185,7 +186,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { String pp = p.responsePrefix != null ? p.responsePrefix + '.' : ""; Map<String, String> props = new HashMap<>((Map)ctx.toProperties()); String uri = parseUrl(p.restapiUrl, p.httpMethod); - InstanceIdentifierContext<?> insIdCtx = getInsIdCtx(p, uri); + InstanceIdentifierContext insIdCtx = getInsIdCtx(p, uri); String req = null; if (p.httpMethod != GET && p.httpMethod != DELETE) { @@ -311,7 +312,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { * @return instance identifier context * @throws SvcLogicException when getting schema context fails */ - private InstanceIdentifierContext<?> getInsIdCtx(YangParameters params, + private InstanceIdentifierContext getInsIdCtx(YangParameters params, String uri) throws SvcLogicException { EffectiveModelContext context = getSchemaContext(params); @@ -394,7 +395,7 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin { * @throws SvcLogicException when the data format type is wrong */ public String updateReq(String req, YangParameters p, - InstanceIdentifierContext<?> insIdCtx) + InstanceIdentifierContext insIdCtx) throws SvcLogicException { SchemaNode schemaNode = insIdCtx.getSchemaNode(); 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 134868c15..ee5dacdce 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 @@ -25,7 +25,6 @@ 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.YangTextSchemaSource.forFile; import java.io.File; import java.io.IOException; import java.net.URI; @@ -39,10 +38,11 @@ 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.EffectiveModelContext; -import org.opendaylight.yangtools.yang.model.parser.api.YangParser; -import org.opendaylight.yangtools.yang.model.parser.api.YangParserException; -import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory; -import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException; +import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; +import org.opendaylight.yangtools.yang.parser.api.YangParser; +import org.opendaylight.yangtools.yang.parser.api.YangParserException; +import org.opendaylight.yangtools.yang.parser.api.YangParserFactory; +import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; /** * Utilities for restconf api call node. @@ -193,7 +193,7 @@ public final class RestconfApiUtils { YangParser parser = parserFactory.createParser(); for (File file : yangFiles) { try { - parser.addSource(forFile(file)); + parser.addSource(YangTextSchemaSource.forPath(file.toPath())); } catch (IOException | YangSyntaxErrorException e) { throw new SvcLogicException(YANG_FILE_ERR + e.getMessage(), e); } diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java index 9b0a31d09..efbbc0458 100644 --- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java +++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/yangserializers/pnserializer/MdsalPropertiesNodeUtils.java @@ -262,7 +262,7 @@ public final class MdsalPropertiesNodeUtils { String uri1 = uri.replaceAll(UNDERSCORE, COLON); try { - InstanceIdentifierContext<?> id = toInstanceIdentifier( + InstanceIdentifierContext id = toInstanceIdentifier( uri1, context, Optional.ofNullable(null)); return new SchemaPathHolder(id, uri1); } catch (IllegalArgumentException | RestconfDocumentedException @@ -335,7 +335,7 @@ public final class MdsalPropertiesNodeUtils { if (node.contains(UNDERSCORE)) { secondHalf = node.substring(values[0].length()+1); } - InstanceIdentifierContext<?> id; + InstanceIdentifierContext id; for (int i = 0; i< values.length-1; i++) { val = values[i]; val = firstHalf + val + COLON + secondHalf; |