* Listens for updates on global schema context, transforms context to ietf-yang-library:modules-state and
* writes this state to operational data store
*/
-public class SchemaServiceToMdsalWriter implements SchemaContextListener, BindingAwareProvider, AutoCloseable {
+public class SchemaServiceToMdsalWriter implements SchemaContextListener, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(SchemaServiceToMdsalWriter.class);
private final SchemaService schemaService;
private final AtomicInteger moduleSetId;
- private DataBroker dataBroker;
+ private final DataBroker dataBroker;
- public SchemaServiceToMdsalWriter(final SchemaService schemaService) {
+ public SchemaServiceToMdsalWriter(final SchemaService schemaService,
+ final DataBroker dataBroker) {
this.schemaService = schemaService;
+ this.dataBroker = dataBroker;
this.moduleSetId = new AtomicInteger(0);
}
// TODO Delete modules-state from operational data store
}
- @Override
- public void onSessionInitiated(final BindingAwareBroker.ProviderContext providerContext) {
- dataBroker = providerContext.getSALService(DataBroker.class);
+ /**
+ * Invoke by blueprint
+ */
+ public void start() {
schemaService.registerSchemaContextListener(this);
}