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


Doubt in - L2switch

asked 2016-05-05 07:19:53 -0700

ashvanth48 gravatar image

updated 2016-05-05 12:23:12 -0700

I'm trying to set flows along the shortest path between two nodes by using the getPath() method under but this only accepts NodeId (

Whereas I'm only able to get the NodeId value through (import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId). Though the values are same it still sames type error. How to convert this into other one??

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-05-08 22:38:34 -0700

karthik330 gravatar image

updated 2016-05-11 03:28:28 -0700

Hi , I may wrong . If you dont know how to convert ,and facing issue, this trick might work.( import;) If you could import it, use the following constructor which acccepts string. **

NodeId src = new NodeId(string);

NodeId dest= new NodeId(string);

//retrieve Shortest Path link

List<link> sPath = getPath(src, dest);**

updated : I am able to call getPath function from L2-main ! I simply added <dependency> <groupid>org.opendaylight.l2switch.loopremover</groupid> <artifactid>loopremover-impl</artifactid> <version>0.3.2-SNAPSHOT</version> </dependency>

in L2-main->impl->pom . And I am able to create object of NetworkGraphImpl and all the functions are visible ! try it and let me know if you face any problem .

I am using InteliJ Idea IDE which is more easier than eclipse. try it if you like.

edit flag offensive delete publish link more


Thanks I did the same. But now facing issues with importing this NetworkGraphImpl class in the main-impl. Can you help me with that?

ashvanth48 ( 2016-05-09 04:56:06 -0700 )edit

what dependency you have added? . And why do you want to import that class in main-impl? what i did is , inside loopremover i created RPC, and i created one class to implement the RPC Service. Form here i called getPath(src, dest) to get shortestPath which will return as RPCresults !

karthik330 ( 2016-05-10 20:02:18 -0700 )edit

I'm modifying the ReactiveFlowWriter in main-impl. So I want to use the getpath() method here. So I'm importing the loopremover's NetworkGraphImpl class which has the getpath() method

ashvanth48 ( 2016-05-10 20:10:24 -0700 )edit

check my updated Answer!

karthik330 ( 2016-05-11 03:27:43 -0700 )edit

Now I added the version also but I'm getting the same error.

ashvanth48 ( 2016-05-11 05:33:27 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-05-05 07:19:53 -0700

Seen: 54 times

Last updated: May 11 '16