Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


How to get data from databroker?

asked 2014-09-08 10:48:35 -0800

canwu gravatar image

I have checked the wiki of the ODL, but still don't know how to deal with it, So I came to ask your help. I have checked the inside of the databroker and known that we could use "read" to get the information.

    String TargetURI = input.getTargetURI(); // get a String type URI,
    ReadTransaction getAccessID = dataService.newReadOnlyTransaction();
    InstanceIdentifier<CSEBase> target = InstanceIdentifier.keyOf(TargetURI);//?????????????? how to translate string to InstanceIdentifier?
    ListenableFuture<Optional<CSEBase>> readtarget =, target);

I tried this way, of course it did not work, my question is how to get the data from a known path? Or how to translate string to InstanceIdentifier? After that, how can I use the returned datatype?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-09-26 04:40:00 -0800

Devin Avery gravatar image

To read from the DataBroker you create an instance identifier using InstanceIdentifer.builder(). To this method and the chained methods you would provide the class names which represent the different levels you want to read from.

Check out this section in the Toaster example for some examples:

That link also provides some examples now how to read from the broker / write to it and provides best practices for handing async requests.

For more complex InstanceIdentifier examples, check out (BindingAware version).

edit flag offensive delete publish link more


Thanks so much!

canwu ( 2014-10-07 08:29:49 -0800 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2014-09-08 10:48:35 -0800

Seen: 507 times

Last updated: Sep 26 '14