+
+ public static void createTapiContext(
+ NetworkTransactionService networkTransactionService) throws ExecutionException, InterruptedException {
+ // Augmenting tapi context to include topology and connectivity contexts
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name contextName
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder()
+ .setValue(TAPI_CONTEXT).setValueName("TAPI Context Name").build();
+
+ Context1 connectivityContext =
+ new Context1Builder()
+ .setConnectivityContext(
+ new ConnectivityContextBuilder()
+ .setConnection(new HashMap<>())
+ .setConnectivityService(new HashMap<>())
+ .build())
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name nwTopoServiceName =
+ new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder()
+ .setValue("Network Topo Service")
+ .setValueName("Network Topo Service Name")
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1 topologyContext
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1Builder()
+ .setTopologyContext(new TopologyContextBuilder()
+ .setNwTopologyService(new NwTopologyServiceBuilder()
+ .setTopology(new HashMap<>())
+ .setUuid(
+ new Uuid(
+ UUID.nameUUIDFromBytes("Network Topo Service".getBytes(Charset.forName("UTF-8")))
+ .toString()))
+ .setName(Map.of(nwTopoServiceName.key(), nwTopoServiceName))
+ .build())
+ .setTopology(new HashMap<>())
+ .build())
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Context1 notificationContext
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Context1Builder()
+ .setNotificationContext(new NotificationContextBuilder()
+ .setNotification(new HashMap<>())
+ .setNotifSubscription(new HashMap<>())
+ .build())
+ .build();
+
+ ContextBuilder contextBuilder = new ContextBuilder()
+ .setName(Map.of(contextName.key(), contextName))
+ .setUuid(
+ new Uuid(UUID.nameUUIDFromBytes(TAPI_CONTEXT.getBytes(Charset.forName("UTF-8"))).toString()))
+ .setServiceInterfacePoint(new HashMap<>())
+ .addAugmentation(connectivityContext)
+ .addAugmentation(topologyContext)
+ .addAugmentation(notificationContext);
+
+ // todo: add notification context
+ InstanceIdentifier<Context> contextIID = InstanceIdentifier.builder(Context.class).build();
+ // put in datastore
+ networkTransactionService.put(LogicalDatastoreType.OPERATIONAL, contextIID, contextBuilder.build());
+ networkTransactionService.commit().get();
+ }
+
+ public static GetNotificationListInputBuilder buildGetNotificationListInputBuilder(String subscriptionUuid) {
+ return new GetNotificationListInputBuilder()
+ .setSubscriptionIdOrName(subscriptionUuid)
+ .setTimePeriod("some string");
+ }