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

0

Doubt in NetworkGraphImpl.java - L2switch

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

ashvanth48 gravatar image

updated 2016-05-05 12:23:12 -0800

I'm trying to set flows along the shortest path between two nodes by using the getPath() method under NetworkGraphImpl.java but this only accepts NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.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
0

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

karthik330 gravatar image

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

Hi , I may wrong . If you dont know how to convert ,and facing issue, this trick might work.( import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;) 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

Comments

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 -0800 )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 -0800 )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 -0800 )edit

check my updated Answer!

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

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

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

Question Tools

Follow
1 follower

Stats

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

Seen: 49 times

Last updated: May 11 '16