I'm writing a ‘native’ OpenDaylight application which uses the OSGi interfaces (Java APIs) exposed by OpenDaylight framework (Helium SR3). In my particular case I just want to get all the hosts (of a Mininet network) over the IfIptoHost interface of the HostTracker module (i.e. org.opendaylight.controller.hosttracker.IfIptoHost). I am following the post "http://thenewstack.io/writing-opendaylight-applications/" and what I basically do is:
Register to the IfIptoHost service by creating a dependency in my app's bundle activator within the configureInstance() method: c.add(createContainerServiceDependency(containerName).setService(IfIptoHost.class).setCallbacks(...).setRequired(true))
Once I got the IfIptoHost osgi service I try to make the following call:
<HostNodeConnector>allhosts = iptoHost.getAllHosts();
I am debugging my code under Eclipse (ODL remote debugging) and I can see that allhosts set is empty. However, if I run the HTTP/REST call shown below I get all the hosts within the response. DLUX is also showing the hosts.
What could be the problem? Is there any alternative to get all the hosts of my mininet's network using the ODL's JAVA API?