summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/websocketmanager/provider
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2022-03-10 10:39:16 +0100
committerDan Timoney <dtimoney@att.com>2022-03-23 15:08:48 -0400
commiteb2a7c97c0007b013bd1784ac17d57be02b63d03 (patch)
treeb0861438532727219216cfd426e21ae053abb31a /sdnr/wt/websocketmanager/provider
parent3c74361514bb920ed441d105f66ca978bd074ced (diff)
migrate sdnr features to phosphorus
fix mapper and switch to dom api Updated to use phosphorus version of parent poms Issue-ID: CCSDK-3566 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: I98c5bef9286622e0d66b53db687557d798cd53f5 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/websocketmanager/provider')
-rw-r--r--sdnr/wt/websocketmanager/provider/pom.xml2
-rw-r--r--sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerProvider.java11
-rw-r--r--sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerSocket.java5
-rw-r--r--sdnr/wt/websocketmanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/test/TestSerializer.java15
4 files changed, 7 insertions, 26 deletions
diff --git a/sdnr/wt/websocketmanager/provider/pom.xml b/sdnr/wt/websocketmanager/provider/pom.xml
index 838ecc487..abd8dd10f 100644
--- a/sdnr/wt/websocketmanager/provider/pom.xml
+++ b/sdnr/wt/websocketmanager/provider/pom.xml
@@ -28,7 +28,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
- <version>2.3.2</version>
+ <version>2.3.3-SNAPSHOT</version>
<relativePath/>
</parent>
diff --git a/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerProvider.java b/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerProvider.java
index d3f49b87d..8af5cb1ee 100644
--- a/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerProvider.java
+++ b/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerProvider.java
@@ -102,14 +102,9 @@ public class WebSocketManagerProvider implements WebsocketManagerService, AutoCl
@Override
public void sendNotification(Notification notification, NodeId nodeId, QName eventType) {
-// disabled because of malfunction
-// e.g. notification type (class org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.
-// OperationStatusChanged$$$eventInstantAware) and qname((urn:o-ran-sc:params:xml:ns:yang:nts:manager?
-// revision=2021-06-08)operation-status-changed) do not match. won't be sent
-// if (!assertNotificationType(notification, eventType)) {
-// LOG.warn("notification type ({}) and qname({}) do not match. won't be sent",notification.getClass(), eventType)
-// return;
-// }
+ if (!assertNotificationType(notification, eventType)) {
+ return;
+ }
this.sendNotification(notification, nodeId, eventType,
YangToolsMapperHelper.getTime(notification, Instant.now()));
}
diff --git a/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerSocket.java b/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerSocket.java
index f508c61f7..95715be39 100644
--- a/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerSocket.java
+++ b/sdnr/wt/websocketmanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager/WebSocketManagerSocket.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Random;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutionException;
@@ -78,7 +79,7 @@ public class WebSocketManagerSocket extends WebSocketAdapter {
if (message != null) {
WebSocketManagerSocket.this.session.getRemote().sendStringByFuture(message)
.get(SEND_MESSAGE_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
- LOG.debug("message sent");
+ LOG.info("message sent");
}
} catch (ExecutionException | TimeoutException e) {
LOG.warn("problem pushing message: ", e);
@@ -150,7 +151,7 @@ public class WebSocketManagerSocket extends WebSocketAdapter {
@Override
public void onWebSocketText(String message) {
- LOG.debug("{} has sent {}", this.getRemoteAdr(), message);
+ LOG.info("{} has sent {}", this.getRemoteAdr(), message);
if (!this.manageClientRequest(message)) {
this.manageClientRequest2(message);
}
diff --git a/sdnr/wt/websocketmanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/test/TestSerializer.java b/sdnr/wt/websocketmanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/test/TestSerializer.java
index ff0437e2b..962838489 100644
--- a/sdnr/wt/websocketmanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/test/TestSerializer.java
+++ b/sdnr/wt/websocketmanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/test/TestSerializer.java
@@ -56,19 +56,4 @@ public class TestSerializer {
assertNotNull(sOutput);
assertTrue(sOutput.contains("\"type\""));
}
-// @Test
-// public void test2() {
-// InstanceChanged notification = new InstanceChangedBuilder().setChangeStatus("stop SUCCESS").setName("NTS_FUNCTION_TYPE_OPENROADM_6_1_0-1").setFunctionType(NTS_FUNCTION_TYPE_OPENROADM_6_1_0.class)
-// NotificationOutput output = new NotificationOutput(notification, NODEID, ObjectCreationNotification.QNAME,DateAndTime.getDefaultInstance(TIMESTAMP));
-// String sOutput=null;
-// try {
-// sOutput = mapper.writeValueAsString(output);
-// LOG.debug(sOutput);
-// } catch (JsonProcessingException e) {
-// e.printStackTrace();
-// fail(e.getMessage());
-// }
-// assertNotNull(sOutput);
-// assertTrue(sOutput.contains("\"type\""));
-// }
}