[SEBA-36] Operational Status 802.1x Session
Cherry-picked from aaa-1.10
Change-Id: I6b90ec939c1f70b259fc96aedb34d2ab7e6b5812
diff --git a/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsDelegate.java b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsDelegate.java
new file mode 100644
index 0000000..a402419
--- /dev/null
+++ b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsDelegate.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2018-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;
+
+import org.onosproject.store.StoreDelegate;
+
+/**
+ * Delegate for Authentication Statistics.
+ */
+public interface AaaMachineStatisticsDelegate extends StoreDelegate<AaaMachineStatisticsEvent> {
+
+}
diff --git a/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEvent.java b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEvent.java
new file mode 100644
index 0000000..1c130dc
--- /dev/null
+++ b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEvent.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2018-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;
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * Event indicating the Accounting Data of AAA.
+ */
+public class AaaMachineStatisticsEvent extends
+ AbstractEvent<AaaMachineStatisticsEvent.Type, AaaSupplicantMachineStats> {
+/**
+ * Accounting data.
+ * Machine Statistic event type.
+ */
+ public enum Type {
+ /**
+ * signifies that the Machine Statistics Event stats has been updated.
+ */
+ STATS_UPDATE
+ }
+ public AaaMachineStatisticsEvent(Type type, AaaSupplicantMachineStats stats) {
+ super(type, stats);
+ }
+}
\ No newline at end of file
diff --git a/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEventListener.java b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEventListener.java
new file mode 100644
index 0000000..28681eb
--- /dev/null
+++ b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsEventListener.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2018-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;
+
+import org.onosproject.event.EventListener;
+
+/**
+ * Listener for accounting events.
+ */
+public interface AaaMachineStatisticsEventListener extends
+EventListener<AaaMachineStatisticsEvent> {
+}
diff --git a/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsService.java b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsService.java
new file mode 100644
index 0000000..11095b3
--- /dev/null
+++ b/api/src/main/java/org/opencord/aaa/AaaMachineStatisticsService.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2018-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;
+
+import org.onosproject.event.ListenerService;
+
+/**
+ * Service for interacting with authentication module.
+ */
+public interface AaaMachineStatisticsService
+ extends ListenerService<AaaMachineStatisticsEvent, AaaMachineStatisticsEventListener> {
+ /**
+ * To get Supplicant machine stat.
+ *
+ * @param obj State Machine instance.
+ * @return supplicant stats.
+ */
+ public AaaSupplicantMachineStats getSupplicantStats(Object obj);
+
+ /**
+ * Returns AaaMachineStatisticsDelegate object.
+ *
+ * @return AaaMachineStatisticsDelegate.
+ */
+ public AaaMachineStatisticsDelegate getMachineStatsDelegate();
+
+ /**
+ * Log the Machine stats.
+ *
+ * @param obj of AaaSupplicantMachineStats.
+ */
+ void logAaaSupplicantMachineStats(AaaSupplicantMachineStats obj);
+
+}
diff --git a/api/src/main/java/org/opencord/aaa/AaaSupplicantMachineStats.java b/api/src/main/java/org/opencord/aaa/AaaSupplicantMachineStats.java
new file mode 100644
index 0000000..87fa2f5
--- /dev/null
+++ b/api/src/main/java/org/opencord/aaa/AaaSupplicantMachineStats.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2018-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;
+
+public class AaaSupplicantMachineStats {
+
+ private String sessionId;
+
+ private String sessionName;
+
+ private long sessionDuration;
+
+ private long totalFramesReceived;
+
+ private long totalFramesSent;
+
+ private long totalPacketsRecieved;
+
+ private long totalPacketsSent;
+
+ private long totalOctetRecieved;
+
+ private long totalOctetSent;
+
+ private String eapolType;
+
+ private String srcMacAddress;
+
+ private String sessionTerminateReason;
+
+ public String getSessionId() {
+ return sessionId;
+ }
+
+ public void setSessionId(String sessionId) {
+ this.sessionId = sessionId;
+ }
+
+ public String getSessionName() {
+ return sessionName;
+ }
+
+ public void setSessionName(String sessionName) {
+ this.sessionName = sessionName;
+ }
+
+ public long getSessionDuration() {
+ return sessionDuration;
+ }
+
+ public void setSessionDuration(long sessionDuration) {
+ this.sessionDuration = sessionDuration;
+ }
+
+ public long getTotalFramesReceived() {
+ return totalFramesReceived;
+ }
+
+ public void setTotalFramesReceived(long totalFramesReceived) {
+ this.totalFramesReceived = totalFramesReceived;
+ }
+
+ public String getEapolType() {
+ return eapolType;
+ }
+
+ public void setEapolType(String eapolType) {
+ this.eapolType = eapolType;
+ }
+
+ public String getSrcMacAddress() {
+ return srcMacAddress;
+ }
+
+ public void setSrcMacAddress(String srcMacAddress) {
+ this.srcMacAddress = srcMacAddress;
+ }
+
+ public long getTotalFramesSent() {
+ return totalFramesSent;
+ }
+
+ public void setTotalFramesSent(long totalFramesSent) {
+ this.totalFramesSent = totalFramesSent;
+ }
+
+ public long getTotalPacketsRecieved() {
+ return totalPacketsRecieved;
+ }
+
+ public void setTotalPacketsRecieved(long totalPacketsRecieved) {
+ this.totalPacketsRecieved = totalPacketsRecieved;
+ }
+
+ public long getTotalPacketsSent() {
+ return totalPacketsSent;
+ }
+
+ public void setTotalPacketsSent(long totalPacketsSent) {
+ this.totalPacketsSent = totalPacketsSent;
+ }
+
+ public long getTotalOctetRecieved() {
+ return totalOctetRecieved;
+ }
+
+ public void setTotalOctetRecieved(long totalOctetRecieved) {
+ this.totalOctetRecieved = totalOctetRecieved;
+ }
+
+ public long getTotalOctetSent() {
+ return totalOctetSent;
+ }
+
+ public void setTotalOctetSent(long totalOctetSent) {
+ this.totalOctetSent = totalOctetSent;
+ }
+
+ public String getSessionTerminateReason() {
+ return sessionTerminateReason;
+ }
+
+ public void setSessionTerminateReason(String sessionTerminateReason) {
+ this.sessionTerminateReason = sessionTerminateReason;
+ }
+
+}