+
+ public NotificationContext getNotificationContext() {
+ LOG.info("Getting tapi notification context");
+ try {
+ Optional<NotificationContext> notificationContextOptional = this.networkTransactionService.read(
+ LogicalDatastoreType.OPERATIONAL,
+ InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(NotificationContext.class)
+ .build())
+ .get();
+ if (notificationContextOptional.isPresent()) {
+ return notificationContextOptional.orElseThrow();
+ }
+ LOG.debug("notification context is empty");
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Caught exception getting Notification Context", e);
+ }
+ LOG.error("Could not get TAPI notification context");
+ return null;
+ }
+
+ public boolean updateNotificationContext(NotificationContext notificationContext1) {
+ try {
+ this.networkTransactionService.merge(
+ LogicalDatastoreType.OPERATIONAL,
+ InstanceIdentifier.builder(Context.class)
+ .augmentation(Context1.class).child(NotificationContext.class)
+ .build(),
+ notificationContext1);
+ this.networkTransactionService.commit().get();
+ return true;
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Could not update TAPI notification context");
+ }
+ return false;
+ }
+