Ask Your Question
0

How to write api without exposing as rest service

asked 2015-09-21 02:02:00 -0700

I would like to expose the java apis from osgi bundle, but I don't want to expose these apis as rest service. Could someone please suggest how to achieve this requirement.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-09-21 23:11:47 -0700

Vishal Thapar gravatar image

We're doing something similar in mdsalutil module of vpnservice project. Take a look at mdsalutil-api and it's usage in other impl bundles in vpnservice:

https://github.com/opendaylight/vpnservice/blob/master/mdsalutil/mdsalutil-api/src/main/yang/odl-mdsalutil.yang

This yang files shows how to expose your interfaces class file for others to consume as service. If you want step by step instructions, I could provide, but it would take some time. Try follow this example and see if it works.

This one shows how it is used [for starters]: https://github.com/opendaylight/vpnservice/blob/master/nexthopmgr/nexthopmgr-impl/src/main/yang/nexthopmgr-impl.yang

I believe with these you should be able to get what you want.

edit flag offensive delete publish link more

Comments

Thanks @vishal for the response, I wrote one plain bundle and it worked. Actually, I would like to write one shared library. I think this approach is to create a service bundle, similar the data broker, please let me whether my understanding is correct or not.

subhash ( 2015-09-22 11:05:15 -0700 )edit
0

answered 2016-02-08 22:37:34 -0700

balaodl gravatar image

updated 2016-02-08 22:40:59 -0700

HI Vishal,

I saw your project mdsal util project. i i found a similar project in github called cup-Example, i tried to compile and run cup example https://github.com/sniggel/odl-mdsal-... created by Grmontpetit.

I got a doubt in it.

I am able to mvn install the project successfully. When I launch the karaf and in the list I am able to see the odl-cup not pre installed, but present in the feature:list. So I tried to install it, it is throwing errors like shown in screen shot below.(i followed the step that Grmontpetit given in the README.md section in the above github URL) Cup Error

Then I tried to compile the controller project separately (also the karaf,config projects in it separately-as said in readme.md) but nothing helps. Please help me to solve this problem. please find the screen shot for the errors..

since your mdsal util project is somewhat similar to that can you please help me to overcome this problem?

edit flag offensive delete publish link more

Comments

This error means you're missing setting up dependencies in your features.xml and/or default-config.xml. Are you using the Cup example as is or have some modifications to it?

Vishal Thapar ( 2016-03-21 02:04:40 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-09-21 02:02:00 -0700

Seen: 65 times

Last updated: Feb 08 '16