[SEBA-719] Display counters in onos cli and reset counters

Change-Id: Ia9fc1865d13a366c9a7cd3e7ae11c39dcc284fd9
diff --git a/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java b/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java
new file mode 100644
index 0000000..0717f9a
--- /dev/null
+++ b/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.opencord.aaa.impl;
+
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.opencord.aaa.AaaStatistics;
+import org.opencord.aaa.AuthenticationStatisticsService;
+
+/**
+ * Display current value of all aaa statistics counters.
+ */
+@Command(scope = "onos", name = "show-aaa-counters",
+description = "Display current value of all aaa statistics counters")
+public class AaaShowCountersCommand extends AbstractShellCommand {
+    @Override
+    protected void execute() {
+
+        AaaStatistics aaaStats = new AaaStatistics();
+
+        AuthenticationStatisticsService aaaStatisticsManager =
+                AbstractShellCommand.get(AuthenticationStatisticsService.class);
+        aaaStats = aaaStatisticsManager.getAaaStats();
+
+        System.out.format("%30s %10d\n", "AccessRequestsTx", aaaStats.getAccessRequestsTx());
+        System.out.format("%30s %10d\n", "ChallengeResponsesRx", aaaStats.getChallengeResponsesRx());
+        System.out.format("%30s %10d\n", "RequestReTx", aaaStats.getRequestReTx());
+        System.out.format("%30s %10d\n", "AcceptResponsesRx", aaaStats.getAcceptResponsesRx());
+        System.out.format("%30s %10d\n", "RejectResponsesRx", aaaStats.getRejectResponsesRx());
+        System.out.format("%30s %10d\n", "PendingRequests", aaaStats.getPendingRequests());
+        System.out.format("%30s %10d\n", "DroppedResponsesRx", aaaStats.getDroppedResponsesRx());
+        System.out.format("%30s %10d\n", "InvalidValidatorsRx", aaaStats.getInvalidValidatorsRx());
+        System.out.format("%30s %10d\n", "MalformedResponsesRx", aaaStats.getMalformedResponsesRx());
+        System.out.format("%30s %10d\n", "UnknownServerRx", aaaStats.getUnknownServerRx());
+        System.out.format("%30s %10d\n", "UnknownTypeRx", aaaStats.getUnknownTypeRx());
+        System.out.format("%30s %10d\n", "RequestRttMillis", aaaStats.getRequestRttMilis());
+
+  }
+}