If I want to execute a karaf shell command in my plugin (java), how to do it?
ex: opendaylight-user@root> snmp4sdn:printdb
"org.apache.felix.service.command.CommandProcessor" can handle it ?
If I want to execute a karaf shell command in my plugin (java), how to do it?
ex: opendaylight-user@root> snmp4sdn:printdb
"org.apache.felix.service.command.CommandProcessor" can handle it ?
In Karaf 3, you have to use the Felix Gogo services, ie the
CommandProcessor
.From a
CommandProcessor
, you can create aCommandSession
and then callexecute
on this session.Two notes on this:
BundleContext.installBundle
or install a feature through theFeaturesService
Your command, for example, use the
org.opendaylight.snmp4sdn.ICore
service. See: PrintDB