[WIP] apps CLI changes for karaf upgrade
Change-Id: I283efc39c7d4f4b31344f1d2d0cdd2b98a60932d
diff --git a/providers/bgp/cli/BUILD b/providers/bgp/cli/BUILD
index 4ac3704..51259bd 100644
--- a/providers/bgp/cli/BUILD
+++ b/providers/bgp/cli/BUILD
@@ -1,12 +1,10 @@
-COMPILE_DEPS = CORE_DEPS + [
- "@org_apache_karaf_shell_console//jar",
+COMPILE_DEPS = CORE_DEPS + CLI + [
"//incubator/api:onos-incubator-api",
"//providers/bgp/cfg:onos-providers-bgp-cfg",
"//providers/bgp/topology:onos-providers-bgp-topology",
"//protocols/bgp/api:onos-protocols-bgp-api",
"//protocols/bgp/ctl:onos-protocols-bgp-ctl",
"//protocols/bgp/bgpio:onos-protocols-bgp-bgpio",
- "//cli:onos-cli",
]
osgi_jar_with_tests(
diff --git a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpConfiguration.java b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpConfiguration.java
index 186fcd1..2608076 100644
--- a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpConfiguration.java
+++ b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpConfiguration.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.bgp.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.bgp.controller.BgpCfg;
import org.onosproject.bgp.controller.BgpConnectPeer;
import org.onosproject.bgp.controller.BgpController;
@@ -48,7 +48,7 @@
String peer = null;
@Override
- protected void execute() {
+ protected void doExecute() {
switch (name) {
case CONFIGURATION:
displayBgpConfiguration();
diff --git a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpExceptions.java b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpExceptions.java
index c145a45..742ce92 100644
--- a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpExceptions.java
+++ b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpExceptions.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.bgp.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.cli.AbstractShellCommand;
import org.slf4j.Logger;
@@ -45,7 +45,7 @@
private Set<String> closedSessionExceptionKeySet;
@Override
- protected void execute() {
+ protected void doExecute() {
switch (name) {
case ACTIVESESSION:
displayActiveSessionException();
diff --git a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpLocalRibDisplay.java b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpLocalRibDisplay.java
index 3f1fee8..4eb7e41 100644
--- a/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpLocalRibDisplay.java
+++ b/providers/bgp/cli/src/main/java/org/onosproject/bgp/cli/BgpLocalRibDisplay.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.bgp.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgpio.protocol.BgpLSNlri;
@@ -97,7 +97,7 @@
private int count = 0;
@Override
- protected void execute() {
+ protected void doExecute() {
switch (name) {
case NODETREE:
displayNodes();
diff --git a/providers/isis/cli/src/main/java/org/onosproject/isis/cli/ApplicationIsisCommand.java b/providers/isis/cli/src/main/java/org/onosproject/isis/cli/ApplicationIsisCommand.java
index b531b5f..437f0af 100644
--- a/providers/isis/cli/src/main/java/org/onosproject/isis/cli/ApplicationIsisCommand.java
+++ b/providers/isis/cli/src/main/java/org/onosproject/isis/cli/ApplicationIsisCommand.java
@@ -17,8 +17,8 @@
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Deactivate;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onlab.packet.MacAddress;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.isis.controller.IsisController;
@@ -74,7 +74,7 @@
}
@Override
- protected void execute() {
+ protected void doExecute() {
switch (name) {
case INTERFACE:
displayIsisInterfaces();
diff --git a/providers/lldp/BUILD b/providers/lldp/BUILD
index e21966e..764a221 100644
--- a/providers/lldp/BUILD
+++ b/providers/lldp/BUILD
@@ -1,7 +1,5 @@
-COMPILE_DEPS = CORE_DEPS + NETTY + JACKSON + [
- "@org_apache_karaf_shell_console//jar",
+COMPILE_DEPS = CORE_DEPS + NETTY + JACKSON + CLI + [
"//providers/lldpcommon:onos-providers-lldpcommon",
- "//cli:onos-cli",
]
BUNDLES = [
diff --git a/providers/lldp/src/main/java/org/onosproject/provider/lldp/cli/ConfigLinkDiscoveryCommand.java b/providers/lldp/src/main/java/org/onosproject/provider/lldp/cli/ConfigLinkDiscoveryCommand.java
index c0ec6a6..1fee3d8 100644
--- a/providers/lldp/src/main/java/org/onosproject/provider/lldp/cli/ConfigLinkDiscoveryCommand.java
+++ b/providers/lldp/src/main/java/org/onosproject/provider/lldp/cli/ConfigLinkDiscoveryCommand.java
@@ -17,9 +17,9 @@
import java.util.Optional;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.cli.net.DeviceIdCompleter;
import org.onosproject.cli.net.PortNumberCompleter;
@@ -65,7 +65,7 @@
@Override
- protected void execute() {
+ protected void doExecute() {
DeviceService deviceService = get(DeviceService.class);
NetworkConfigService netcfgService = get(NetworkConfigService.class);
diff --git a/providers/netconf/alarm/src/main/java/org/onosproject/provider/netconf/alarm/NetconfAlarmProvider.java b/providers/netconf/alarm/src/main/java/org/onosproject/provider/netconf/alarm/NetconfAlarmProvider.java
index da0fa1c..20420cd 100644
--- a/providers/netconf/alarm/src/main/java/org/onosproject/provider/netconf/alarm/NetconfAlarmProvider.java
+++ b/providers/netconf/alarm/src/main/java/org/onosproject/provider/netconf/alarm/NetconfAlarmProvider.java
@@ -61,7 +61,7 @@
/**
* Provider which uses an Alarm Manager to keep track of device notifications.
*/
-@Component(immediate = true)
+@Component(immediate = true, service = AlarmProvider.class)
public class NetconfAlarmProvider extends AbstractProvider implements AlarmProvider {
public static final String ACTIVE = "active";
@@ -74,10 +74,10 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY)
protected NetconfController controller;
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ @Reference(cardinality = ReferenceCardinality.MANDATORY)
protected DriverService driverService;
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ @Reference(cardinality = ReferenceCardinality.MANDATORY)
protected DeviceService deviceService;
protected AlarmProviderService providerService;
diff --git a/providers/null/BUILD b/providers/null/BUILD
index 9120487..8059800 100644
--- a/providers/null/BUILD
+++ b/providers/null/BUILD
@@ -1,7 +1,4 @@
-COMPILE_DEPS = CORE_DEPS + NETTY + [
- "@org_apache_karaf_shell_console//jar",
- "//cli:onos-cli",
-]
+COMPILE_DEPS = CORE_DEPS + NETTY + CLI
osgi_jar_with_tests(
import_packages = "*,org.onosproject.cli.net",
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullDevice.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullDevice.java
index dc1ff92..809d90d 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullDevice.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullDevice.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onlab.util.Tools;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
@@ -60,7 +60,7 @@
String locType = GEO;
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
NetworkConfigService cfgService = get(NetworkConfigService.class);
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHost.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHost.java
index d079b23..682496b 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHost.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHost.java
@@ -17,8 +17,8 @@
package org.onosproject.provider.nil.cli;
import com.google.common.collect.ImmutableSet;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onlab.packet.IpAddress;
import org.onlab.util.Tools;
import org.onosproject.net.ConnectPoint;
@@ -65,7 +65,7 @@
String locType = GEO;
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
NetworkConfigService cfgService = get(NetworkConfigService.class);
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java
index c9b9301..b8618e0 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullHosts.java
@@ -16,8 +16,8 @@
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onlab.packet.IpAddress;
import org.onlab.util.Tools;
import org.onosproject.net.ConnectPoint;
@@ -69,7 +69,7 @@
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
NetworkConfigService cfgService = get(NetworkConfigService.class);
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullLink.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullLink.java
index 72e1781..f0bac10 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullLink.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/CreateNullLink.java
@@ -16,9 +16,9 @@
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.Link;
import org.onosproject.provider.nil.CustomTopologySimulator;
@@ -48,7 +48,7 @@
private boolean unidirectional = false;
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
TopologySimulator simulator = service.currentSimulator();
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullControlCommand.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullControlCommand.java
index 0b3fbe3..c901a6a 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullControlCommand.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullControlCommand.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.provider.nil.NullProviders;
@@ -41,7 +41,7 @@
String topoShape = null;
@Override
- protected void execute() {
+ protected void doExecute() {
ComponentConfigService service = get(ComponentConfigService.class);
// If there is an existing topology; make sure it's stopped before restarting
if (cmd.equals(START)) {
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullDeviceCommand.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullDeviceCommand.java
index 6b463f6..6f88be8 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullDeviceCommand.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullDeviceCommand.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.net.DeviceId;
import org.onosproject.provider.nil.NullProviders;
@@ -41,7 +41,7 @@
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
DeviceId deviceId = DeviceId.deviceId(id);
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullLinkCommand.java b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullLinkCommand.java
index 1b9729c..8d3314d9 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullLinkCommand.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/cli/NullLinkCommand.java
@@ -15,8 +15,8 @@
*/
package org.onosproject.provider.nil.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.net.ConnectPoint;
import org.onosproject.provider.nil.NullProviders;
@@ -45,7 +45,7 @@
@Override
- protected void execute() {
+ protected void doExecute() {
NullProviders service = get(NullProviders.class);
try {
diff --git a/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java
index 06b1042..a625d55 100644
--- a/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java
+++ b/providers/ospf/cli/src/main/java/org/onosproject/ospf/cli/ApplicationOspfCommand.java
@@ -20,8 +20,8 @@
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.ospf.controller.OspfArea;
import org.onosproject.ospf.controller.OspfController;
@@ -95,7 +95,7 @@
}
@Override
- protected void execute() {
+ protected void doExecute() {
if (DATABASE.equals(name)) {
buildOspfDatabaseInformation();
} else if (NEIGHBORLIST.equals(name)) {
diff --git a/providers/pcep/cli/BUILD b/providers/pcep/cli/BUILD
index b623bd9..64a75df 100644
--- a/providers/pcep/cli/BUILD
+++ b/providers/pcep/cli/BUILD
@@ -1,9 +1,7 @@
-COMPILE_DEPS = CORE_DEPS + [
- "@org_apache_karaf_shell_console//jar",
+COMPILE_DEPS = CORE_DEPS + CLI + [
"//incubator/api:onos-incubator-api",
"//protocols/pcep/server/ctl:onos-protocols-pcep-server-ctl",
"//protocols/pcep/server/api:onos-protocols-pcep-server-api",
- "//cli:onos-cli",
]
osgi_jar_with_tests(
diff --git a/providers/pcep/cli/src/main/java/org/onosproject/pcep/cli/PcepSessionCommand.java b/providers/pcep/cli/src/main/java/org/onosproject/pcep/cli/PcepSessionCommand.java
index c46a9a1..e1fc2a5 100644
--- a/providers/pcep/cli/src/main/java/org/onosproject/pcep/cli/PcepSessionCommand.java
+++ b/providers/pcep/cli/src/main/java/org/onosproject/pcep/cli/PcepSessionCommand.java
@@ -16,8 +16,8 @@
package org.onosproject.pcep.cli;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.pcep.server.PcepClientController;
import org.onosproject.pcep.server.PcepErrorDetail;
@@ -68,7 +68,7 @@
String peer = null;
@Override
- protected void execute() {
+ protected void doExecute() {
switch (name) {
case SESSION:
displayPcepSession();