Changed the how to relay proxy message within cluster
*changed the commnunication way to 'unicast' from 'sendAndReceived'
Change-Id: I0207c074fd2ab7b8378d9b4ce0cf877fc9aeab29
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfController.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfController.java
index 45d81d2..daf92fa 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfController.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-present Open Networking Foundation
+ * Copyright 2019-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
package org.onosproject.netconf;
import org.onlab.packet.IpAddress;
+import org.onosproject.cluster.NodeId;
import org.onosproject.net.DeviceId;
import java.util.Map;
@@ -138,4 +139,13 @@
errorFuture.completeExceptionally(new NetconfException("Method executeAtMaster not implemented"));
return errorFuture;
}
+
+ /**
+ * Get a contoller node Id .
+ *
+ * @return controller node Id
+ */
+ default NodeId getLocalNodeId() {
+ return null;
+ }
}
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessage.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessage.java
index 8ebfbe3..66a73b2 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessage.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessage.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-present Open Networking Foundation
+ * Copyright 2019-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.onosproject.netconf;
+import org.onosproject.cluster.NodeId;
import org.onosproject.net.DeviceId;
import java.util.List;
@@ -57,4 +58,10 @@
* @return arguments
*/
List<String> arguments();
+
+ /**
+ * Returns the node id of proxymessage sender.
+ * @return NodeId
+ */
+ NodeId senderId();
}
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessageHandler.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessageHandler.java
index a1d4d74..69d29f5 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessageHandler.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfProxyMessageHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018-present Open Networking Foundation
+ * Copyright 2019-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
*/
package org.onosproject.netconf;
+import java.util.Set;
+
/**
* Abstract interface for the implementation of proxy message handler.
*/
@@ -28,4 +30,32 @@
* @throws NetconfException netconf exception
*/
<T> T handleIncomingMessage(NetconfProxyMessage proxyMessage) throws NetconfException;
+
+ /**
+ * Will decode the message on case basis and
+ * call the actual method in Netconf Session implementation bound to secure transport.
+ * @param replyMessage incoming reply message
+ * @param <T> return type
+ * @return the value returned by session call
+ * @throws NetconfException netconf exception
+ */
+ <T> T handleReplyMessage(NetconfProxyMessage replyMessage) throws NetconfException;
+
+ /**
+ * Will decode the message on case basis and
+ * call the actual method in Netconf Session implementation bound to secure transport.
+ * @param proxyMessage incoming proxy message
+ * @return the set value returned by session call
+ * @throws NetconfException netconf exception
+ */
+ Set<String> handleIncomingSetMessage(NetconfProxyMessage proxyMessage) throws NetconfException;
+
+ /**
+ * Will decode the message on case basis and
+ * call the actual method in Netconf Session implementation bound to secure transport.
+ * @param replyMessage incoming proxy message
+ * @return the set value returned by session call
+ * @throws NetconfException netconf exception
+ */
+ Set<String> handleReplySetMessage(NetconfProxyMessage replyMessage) throws NetconfException;
}
\ No newline at end of file