Added CustomizationInfo and RadiusCommunicator to impl.
Change-Id: Ifdfeb3fed6575cbcd04f0c707fcd24f003666fe2
diff --git a/src/main/java/org/opencord/aaa/impl/CustomizationInfo.java b/src/main/java/org/opencord/aaa/impl/CustomizationInfo.java
new file mode 100644
index 0000000..56f296e
--- /dev/null
+++ b/src/main/java/org/opencord/aaa/impl/CustomizationInfo.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2017-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.onosproject.net.device.DeviceService;
+import org.opencord.sadis.SubscriberAndDeviceInformationService;
+
+/**
+ * Bindings to Device service and Subscriber and Device Information service
+ * (SADIS), required for RADIUS packet customization.
+ */
+public class CustomizationInfo {
+
+ private final SubscriberAndDeviceInformationService subsService;
+ private final DeviceService devService;
+
+ /**
+ * Creates a customization info instance, with bindings for the given
+ * service instances.
+ *
+ * @param subsService subscriber service
+ * @param devService device service
+ */
+ public CustomizationInfo(SubscriberAndDeviceInformationService subsService,
+ DeviceService devService) {
+ this.subsService = subsService;
+ this.devService = devService;
+ }
+
+ /**
+ * Returns the reference to the subscriber service.
+ *
+ * @return the subscriber service
+ */
+ public SubscriberAndDeviceInformationService subscriberService() {
+ return subsService;
+ }
+
+ /**
+ * Returns the reference to the device service.
+ *
+ * @return the device service
+ */
+ public DeviceService deviceService() {
+ return devService;
+ }
+}
diff --git a/src/main/java/org/opencord/aaa/impl/RadiusCommunicator.java b/src/main/java/org/opencord/aaa/impl/RadiusCommunicator.java
new file mode 100644
index 0000000..018ccb8
--- /dev/null
+++ b/src/main/java/org/opencord/aaa/impl/RadiusCommunicator.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017-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.onlab.packet.RADIUS;
+import org.onosproject.net.packet.InboundPacket;
+import org.onosproject.net.packet.PacketContext;
+import org.opencord.aaa.api.AaaConfig;
+
+/**
+ * Interface to the implementations for RADIUS server side communication.
+ */
+public interface RadiusCommunicator {
+
+ /**
+ * Initializes the local state of the communicator, using the relevant
+ * parameters from the supplied configuration.
+ *
+ * @param newCfg new configuration to be applied
+ */
+ void initializeLocalState(AaaConfig newCfg);
+
+ /**
+ * Clears local state.
+ */
+ void clearLocalState();
+
+ /**
+ * Callback invoked when the AAA application is deactivated.
+ */
+ void deactivate();
+
+ /**
+ * Provisions intercepts on the switches (if needed).
+ */
+ void requestIntercepts();
+
+ /**
+ * Clears intercepts from the switches (if needed).
+ */
+ void withdrawIntercepts();
+
+ /**
+ * Sends the given RADIUS packet to the RADIUS server. The incoming
+ * EAPOL packet (from the switch to ONOS) is provided as reference.
+ *
+ * @param radiusPacket RADIUS packet to be sent to server
+ * @param inPkt incoming EAPOL packet
+ */
+ void sendRadiusPacket(RADIUS radiusPacket, InboundPacket inPkt);
+
+ /**
+ * Handles the packet from RADIUS server.
+ *
+ * @param context incoming packet context
+ */
+ void handlePacketFromServer(PacketContext context);
+}