commit | bdb6408dce86ebadf0c840dcb5af19d9997b1d60 | [log] [tgz] |
---|---|---|
author | Laszlo Papp <laszlo.papp@hubersuhner.com> | Tue Sep 11 12:21:29 2018 +0100 |
committer | Andrea Campanella <andrea@opennetworking.org> | Mon Sep 17 09:20:50 2018 +0000 |
tree | e27365b02713b40051fa6926c2018d3bf5211820 | |
parent | a17b3a14f355f1ccf97d593037545fa5e36f9efd [diff] [blame] |
Make the netconf notification stream customisable Change-Id: I0e51861b7f8cb4961a47e88f64a493106e2c7a8a
diff --git a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java index 1516912..ee1fe39 100644 --- a/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java +++ b/drivers/polatis/netconf/src/main/java/org/onosproject/drivers/polatis/netconf/PolatisNetconfUtility.java
@@ -220,6 +220,23 @@ } /** + * Subscribes for notifications. + * + * @param handler parent driver handler + * @return true on success, false otherwise + */ + public static boolean subscribe(DriverHandler handler) { + NetconfSession session = getNetconfSession(handler); + try { + session.startSubscription(); + } catch (NetconfException e) { + log.error("Failed to subscribe for notifications."); + return false; + } + return true; + } + + /** * Returns the NETCONF session of the device. * * @return session