use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.GraphTopologyBuilder in project bgpcep by opendaylight.
the class ConnectedGraphServer method initOperationalGraphModel.
/**
* Initialize GraphModel tree at Data Store top-level.
*/
private synchronized void initOperationalGraphModel() {
requireNonNull(this.chain, "A valid transaction chain must be provided.");
final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
LOG.info("Create Graph Model at top level in Operational DataStore: {}", GRAPH_TOPOLOGY_IDENTIFIER);
trans.put(LogicalDatastoreType.OPERATIONAL, GRAPH_TOPOLOGY_IDENTIFIER, new GraphTopologyBuilder().build());
trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
public void onSuccess(final CommitInfo result) {
LOG.trace("Transaction {} committed successfully", trans.getIdentifier());
}
@Override
public void onFailure(final Throwable throwable) {
LOG.error("Failed to initialize GraphModel {} (transaction {}) by listener {}", GRAPH_TOPOLOGY_IDENTIFIER, trans.getIdentifier(), ConnectedGraphServer.this, throwable);
}
}, MoreExecutors.directExecutor());
}
Aggregations