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


Where are the java files of NodeConnectorRef?

asked 2017-09-28 07:57:26 -0700

DanielRomero gravatar image


I'm working with the bundle of l2switch-release-beryllium-sr3 and I would like to know the methods of some classes like NodeConnectorRef or Node but I don't find these classes. Someone could tell me where to find them?

import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;

This is the GitHub of l2switch-beryllium:

Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-29 05:55:52 -0700

VincentJahjah gravatar image

updated 2017-10-02 08:40:09 -0700

For any classes whose imports look like


You're looking at yang auto-generated code. Search yang files and you should fine them, but do note that classes like "...Ref", "...Key" and "...Id" are generally all generated together, so what you want to look for is NodeConnector, not NodeConnectorRef. Also, note that classes named in Yang are formatted something-like-this, and not SomethingLikeThis.

So, to answer you more explicitly, I googled node.yang, 4th result on google. All the classes you want are defined here.

All yang-generated classes are often quite empty, so you won't learn much from them. Essentially, a yang-generated class will have an unique ID object, which is its key (the key is made of an ID, and that's pretty much it). The "Ref" is the URI version of the Key or Id of the object, and is used to make a query in MD-SAL. An ID can be made into a key, and Ids and keys can be used to make a Ref, and a Ref can be used to query MD-SAL ( and obtaining an actual object. (AFAIK, a Ref object is basically the same as a URI container, and is therefore much the same as an InstanceIdentifier object).

I'm no expert, but that's what I gathered.


EDIT: Node Ref Clarifications

Ref objects have only one public method: getValue(). As far as I know, they are plain data objects, or wrapper objects. Modifying them doesn't seem to be of any use, since one could just as easily make another NodeConnectorRef.

getValue() returns an InstanceIdentifier of their object, which itself contains information to reproduce a URI which can then be used for a RESTFUL request to fetch the dedicated object.

I tested this:

The second test shows that there's some way to make a URI-like string from the classes of the objects (which is what we pass the "child" methods to build the IID). Note that we also pass "key" objects to the "child" method: these keys are the unique identifiers for individual instances of object (hence the + "1" I added to mimic those keys).

edit flag offensive delete publish link more


I tried to understand and get familiarized with that yang file but I can't understad what are the attributes of NodeConnectorRef and what are the methods to modify the attributes of NodeConnectorRef. Can you help me with this?

DanielRomero ( 2017-10-02 06:59:48 -0700 )edit

I did some tests and updated my answer. Does that answer your questions?

VincentJahjah ( 2017-10-02 07:59:39 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-28 07:57:26 -0700

Seen: 109 times

Last updated: Oct 02 '17