From c8e5aa9f493ec5f80e4444285816ceed27b1752b Mon Sep 17 00:00:00 2001 From: janani b Date: Thu, 27 Sep 2018 15:26:39 +0530 Subject: Issue fixes for Restconf discovery node i) Adding constructor param ii) execute dg param order fix iii) Constants value fix. Issue-ID: CCSDK-325 Change-Id: I5aaf4b66b3982e4a1d3736362be3a5e8d7ab6d00 Signed-off-by: janani b --- .../sli/plugins/restconfdiscovery/EventProcessor.java | 9 +++++---- .../restconfdiscovery/RestconfDiscoveryNode.java | 18 ++++++++++++------ .../plugins/restconfdiscovery/SvcLogicGraphInfo.java | 2 +- .../blueprint/restconf-client-blueprint.xml | 4 +++- 4 files changed, 21 insertions(+), 12 deletions(-) (limited to 'restconf-client/provider/src/main') diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/EventProcessor.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/EventProcessor.java index aae80815..e46e47a9 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/EventProcessor.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/EventProcessor.java @@ -28,17 +28,18 @@ import org.slf4j.LoggerFactory; import java.util.Map; import static org.onap.ccsdk.sli.plugins.prop.JsonParser.convertToProperties; +import static org.slf4j.LoggerFactory.getLogger; /** * Processes the events from event queue and executes callback DG. */ class EventProcessor implements Runnable { - private static final Logger log = LoggerFactory.getLogger(EventProcessor.class); + + private static final Logger log = getLogger(EventProcessor.class); private RestconfDiscoveryNode node; - private static final String EVENT_SUBSCRIPTION_ID = "ietf-notification:notification" + - ".ietf-yang-push:push-change-update" + - ".subscription-id"; + private static final String EVENT_SUBSCRIPTION_ID = "ietf-restconf:" + + "notification.ietf-yang-push:push-change-update.subscription-id"; public EventProcessor(RestconfDiscoveryNode node) { this.node = node; diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java index f5366a54..111d6284 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/RestconfDiscoveryNode.java @@ -26,7 +26,6 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; @@ -37,12 +36,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; +import static org.slf4j.LoggerFactory.getLogger; + /** * Representation of a plugin to subscribe for notification and then * to handle the received notifications. */ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { - private static final Logger log = LoggerFactory.getLogger(RestconfDiscoveryNode.class); + + private static final Logger log = getLogger(RestconfDiscoveryNode.class); private ExecutorService executor = Executors.newCachedThreadPool(); private Map runnableInfo = new ConcurrentHashMap<>(); @@ -54,15 +56,19 @@ public class RestconfDiscoveryNode implements SvcLogicDiscoveryPlugin { private static final String SUBSCRIBER_ID = "subscriberId"; private static final String RESPONSE_CODE = "response-code"; private static final String RESPONSE_PREFIX = "responsePrefix"; - private static final String OUTPUT_IDENTIFIER = "ietf-subscribed-notifications:output.identifier"; + private static final String OUTPUT_IDENTIFIER = "ietf-subscribed-notif" + + "ications:establish-subscription.output.identifier"; private static final String RESPONSE_CODE_200 = "200"; private static final String SSE_URL = "sseConnectURL"; /** - * Creates an instance of RestconfDiscoveryNode and - * starts processing of event. + * Creates an instance of RestconfDiscoveryNode and starts processing of + * event. + * + * @param r restconf api call node */ - public RestconfDiscoveryNode() { + public RestconfDiscoveryNode(RestconfApiCallNode r) { + this.restconfApiCallNode = r; ExecutorService e = Executors.newFixedThreadPool(20); EventProcessor p = new EventProcessor(this); for (int i = 0; i < 20; ++i) { diff --git a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SvcLogicGraphInfo.java b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SvcLogicGraphInfo.java index 725826bd..1cc6261a 100644 --- a/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SvcLogicGraphInfo.java +++ b/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/SvcLogicGraphInfo.java @@ -142,7 +142,7 @@ class SvcLogicGraphInfo { SvcLogicStore store = service.getStore(); if (store != null) { - SvcLogicGraph subGraph = store.fetch(module, rpc, version, mode); + SvcLogicGraph subGraph = store.fetch(module, rpc, mode, version); if (subGraph != null) { ctx.setAttribute("subGraph", subGraph.toString()); service.execute(subGraph, ctx); diff --git a/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml b/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml index c8f2dc4c..45c335b1 100755 --- a/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml +++ b/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml @@ -32,7 +32,9 @@ - + + + -- cgit 1.2.3-korg