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


How to call karaf console command in Java code

asked 2016-03-14 00:03:17 -0700

kevin5476 gravatar image

updated 2016-03-15 02:19:37 -0700

If I want to execute a karaf shell command in my plugin (java), how to do it?

ex: opendaylight-user@root> snmp4sdn:printdb

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2016-03-21 02:49:44 -0700

Vishal Thapar gravatar image

Why not use the underlying API that karaf shell command uses instead? Take a look at blueprint.xml file. It gets a reference to org.opendaylight.snmp4sdn.ICore and calls its printDB() method and you could do the same from your code.

edit flag offensive delete publish link more

answered 2016-05-26 09:10:13 -0700

jgoodyear gravatar image

You can create custom karaf commands which would connect to your plugin code.

Follow these instructions for making new commands:

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-03-14 00:03:17 -0700

Seen: 418 times

Last updated: May 26 '16