Ask Your Question
0

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
0

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
0

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: http://karaf.apache.org/manual/latest...

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

Question Tools

Follow
1 follower

Stats

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

Seen: 202 times

Last updated: May 26 '16