- private DataProviderService createLegacyDataService(final DataStore legacyStore, final SchemaService schemaService) {
- YangInstanceIdentifier rootPath = YangInstanceIdentifier.builder().toInstance();
- DataBrokerImpl dataService = new DataBrokerImpl();
- SchemaAwareDataStoreAdapter wrappedStore = new SchemaAwareDataStoreAdapter();
- wrappedStore.changeDelegate(legacyStore);
- wrappedStore.setValidationEnabled(false);
-
- schemaService.registerSchemaContextListener(wrappedStore);
-
- dataService.registerConfigurationReader(rootPath, wrappedStore);
- dataService.registerCommitHandler(rootPath, wrappedStore);
- dataService.registerOperationalReader(rootPath, wrappedStore);
- return dataService;
- }
-