mapping management app changes for karaf 4.2.1 CLI

Change-Id: Id493f10c572efd2774c3cbb6386aeb8ab9dc7c57
diff --git a/apps/mappingmanagement/cli/BUILD b/apps/mappingmanagement/cli/BUILD
index 2eddaff..e0c5fef 100644
--- a/apps/mappingmanagement/cli/BUILD
+++ b/apps/mappingmanagement/cli/BUILD
@@ -5,6 +5,6 @@
 ]
 
 osgi_jar_with_tests(
-    import_packages = "*,org.onosproject.cli.net",
+    karaf_command_packages = ["org.onosproject.mapping.cli"],
     deps = COMPILE_DEPS,
 )
diff --git a/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingStoreTypeCompleter.java b/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingStoreTypeCompleter.java
index 552605c..eaa53ff 100644
--- a/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingStoreTypeCompleter.java
+++ b/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingStoreTypeCompleter.java
@@ -17,6 +17,7 @@
 
 import com.google.common.collect.ImmutableList;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onosproject.cli.AbstractChoicesCompleter;
 import org.onosproject.mapping.MappingStore.Type;
 
@@ -26,6 +27,7 @@
 /**
  * Mapping store type completer.
  */
+@Service
 public class MappingStoreTypeCompleter extends AbstractChoicesCompleter {
 
     private static final List<Type> STORE_TYPES =
diff --git a/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingsListCommand.java b/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingsListCommand.java
index 8bd31d9..b524159 100644
--- a/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingsListCommand.java
+++ b/apps/mappingmanagement/cli/src/main/java/org/onosproject/mapping/cli/MappingsListCommand.java
@@ -21,9 +21,11 @@
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.karaf.shell.api.action.Argument;
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.DeviceIdCompleter;
 import org.onosproject.mapping.MappingEntry;
 import org.onosproject.mapping.MappingKey;
 import org.onosproject.mapping.MappingTreatment;
@@ -67,10 +69,12 @@
     @Argument(index = 0, name = "type",
             description = "Shows mappings with specified type",
             required = true, multiValued = false)
+    @Completion(MappingStoreTypeCompleter.class)
     private String type = null;
 
     @Argument(index = 1, name = "deviceId", description = "Device identity",
             required = false, multiValued = false)
+    @Completion(DeviceIdCompleter.class)
     private String deviceId = null;
 
     @Option(name = "-s", aliases = "--short",