summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/websocketmanager
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2022-01-31 05:11:03 +0100
committerKAPIL SINGAL <ks220y@att.com>2022-02-01 03:42:42 +0000
commitf01064b548d479d2f98abb7d30429b4a410a209e (patch)
tree08bede472e8833eeb431836a4bb33ae544f5430d /sdnr/wt/websocketmanager
parent9912e1626d93afeb4f7148dd5d826ae1caa1ef8a (diff)
add nodb support
add option to work without db Issue-ID: CCSDK-3573 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: I1a1dc785dceb1789fe12bf6b3009e35d56578816 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/websocketmanager')
-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
3 files changed, 25 insertions, 6 deletions
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 8af5cb1ee..d3f49b87d 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,9 +102,14 @@ public class WebSocketManagerProvider implements WebsocketManagerService, AutoCl
@Override
public void sendNotification(Notification notification, NodeId nodeId, QName eventType) {
- if (!assertNotificationType(notification, eventType)) {
- return;
- }
+// 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;
+// }
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 95715be39..f508c61f7 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,7 +24,6 @@ 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;
@@ -79,7 +78,7 @@ public class WebSocketManagerSocket extends WebSocketAdapter {
if (message != null) {
WebSocketManagerSocket.this.session.getRemote().sendStringByFuture(message)
.get(SEND_MESSAGE_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
- LOG.info("message sent");
+ LOG.debug("message sent");
}
} catch (ExecutionException | TimeoutException e) {
LOG.warn("problem pushing message: ", e);
@@ -151,7 +150,7 @@ public class WebSocketManagerSocket extends WebSocketAdapter {
@Override
public void onWebSocketText(String message) {
- LOG.info("{} has sent {}", this.getRemoteAdr(), message);
+ LOG.debug("{} 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 962838489..ff0437e2b 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,4 +56,19 @@ 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\""));
+// }
}