REST/CLI Implementations and Fix for remote url data
Change-Id: I0daeebdd40864179c6b923bed3da0c38f259829e
diff --git a/app/src/main/java/org/opencord/sadis/cli/SubscriberGetCommand.java b/app/src/main/java/org/opencord/sadis/cli/SubscriberGetCommand.java
index 42ec7bb..93e9830 100644
--- a/app/src/main/java/org/opencord/sadis/cli/SubscriberGetCommand.java
+++ b/app/src/main/java/org/opencord/sadis/cli/SubscriberGetCommand.java
@@ -18,6 +18,8 @@
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.onosproject.cli.AbstractShellCommand;
+import org.opencord.sadis.SubscriberAndDeviceInformationService;
+import org.opencord.sadis.SubscriberAndDeviceInformation;
/**
* Subscriber And Device Information Service CLI.
@@ -28,9 +30,15 @@
@Argument(index = 0, name = "ID", description = "subscriber ID", required = true, multiValued = false)
String id;
+ private SubscriberAndDeviceInformationService sadisService = get(SubscriberAndDeviceInformationService.class);
+
@Override
protected void execute() {
- print("Hello %s", "World");
+ SubscriberAndDeviceInformation info = sadisService.get(id);
+ if (info != null) {
+ print(info.toString());
+ } else {
+ print("Subscriber not found");
+ }
}
-
}