import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.Module;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final DOMTransactionChain transactionChain = handlersHolder.getTransactionChainHandler().get();
final DOMDataTreeReadWriteTransaction writeTransaction = transactionChain.newReadWriteTransaction();
- final SchemaContext schemaContext = handlersHolder.getSchemaHandler().get();
+ final EffectiveModelContext schemaContext = handlersHolder.getSchemaHandler().get();
final boolean exist = checkExist(schemaContext, writeTransaction);
final URI uri = prepareUriByStreamName(uriInfo, streamName);
handlersHolder.getTransactionChainHandler(), handlersHolder.getSchemaHandler());
final NormalizedNode<?, ?> mapToStreams =
RestconfMappingNodeUtil.mapYangNotificationStreamByIetfRestconfMonitoring(
- notificationListenerAdapter.get().getSchemaPath().getLastComponent(),
+ notificationListenerAdapter.get().getSchemaPath().lastNodeIdentifier(),
schemaContext.getNotifications(), notificationQueryParams.getStart(),
notificationListenerAdapter.get().getOutputType(), uri, getMonitoringModule(schemaContext), exist);
writeDataToDS(schemaContext,
- notificationListenerAdapter.get().getSchemaPath().getLastComponent().getLocalName(), writeTransaction,
+ notificationListenerAdapter.get().getSchemaPath().lastNodeIdentifier().getLocalName(), writeTransaction,
exist, mapToStreams);
submitData(writeTransaction);
transactionChain.close();
return uri;
}
- static Module getMonitoringModule(final SchemaContext schemaContext) {
+ static Module getMonitoringModule(final EffectiveModelContext schemaContext) {
return schemaContext.findModule(MonitoringModule.MODULE_QNAME).orElse(null);
}
- private static void writeDataToDS(final SchemaContext schemaContext, final String name,
+ private static void writeDataToDS(final EffectiveModelContext schemaContext, final String name,
final DOMDataTreeReadWriteTransaction readWriteTransaction, final boolean exist,
final NormalizedNode<?, ?> mapToStreams) {
String pathId;
listener.setRegistration(registration);
}
- private static boolean checkExist(final SchemaContext schemaContext,
+ private static boolean checkExist(final EffectiveModelContext schemaContext,
final DOMDataTreeReadOperations readWriteTransaction) {
try {
return readWriteTransaction.exists(LogicalDatastoreType.OPERATIONAL,
return;
}
- final SchemaPath path = listener.getSchemaPath();
+ final Absolute path = listener.getSchemaPath();
final ListenerRegistration<DOMNotificationListener> registration =
notificationServiceHandler.get().registerNotificationListener(listener, path);
listener.setRegistration(registration);