[VOL-4246] Feature parity with the previous implementation
Change-Id: I3741edb3c1b88b1cf8b5e6d4ff0900132e2e5e6a
diff --git a/api/src/main/java/org/opencord/olt/AccessDeviceService.java b/api/src/main/java/org/opencord/olt/AccessDeviceService.java
index 4878d97..9f39715 100644
--- a/api/src/main/java/org/opencord/olt/AccessDeviceService.java
+++ b/api/src/main/java/org/opencord/olt/AccessDeviceService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016-present Open Networking Foundation
+ * Copyright 2021-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.
@@ -16,93 +16,62 @@
package org.opencord.olt;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
-
import org.onlab.packet.VlanId;
import org.onosproject.event.ListenerService;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
-import com.google.common.collect.ImmutableMap;
-import org.opencord.sadis.UniTagInformation;
+import java.util.List;
-/**
- * Service for interacting with an access device (OLT).
- */
-public interface AccessDeviceService
- extends ListenerService<AccessDeviceEvent, AccessDeviceListener> {
-
+public interface AccessDeviceService extends ListenerService<AccessDeviceEvent, AccessDeviceListener> {
/**
* Provisions connectivity for a subscriber on an access device.
- * Installs flows for all uni tag information
+ * It installs flows for all uni tag information
*
- * @param port subscriber's connection point
- * @return true if successful false otherwise
+ * @param cp subscriber's connection point
+ * @return true if the request is accepted (does not guarantee the subscriber is provisioned)
*/
- boolean provisionSubscriber(ConnectPoint port);
+ boolean provisionSubscriber(ConnectPoint cp);
/**
- * Removes provisioned connectivity for a subscriber from an access device.
- * Removes flows for all uni tag information
- *
- * @param port subscriber's connection point
- * @return true if successful false otherwise
+ * Removes subscriber flows from a given ConnectPoint.
+ * @param cp subscriber's connect point
+ * @return true if the request is accepted (does not guarantee the subscriber is removed)
*/
- boolean removeSubscriber(ConnectPoint port);
+ boolean removeSubscriber(ConnectPoint cp);
/**
- * Provisions a uni tag information for the specific subscriber.
- * It finds the related uni tag information from the subscriber uni tag list
- * and installs it
- *
- * @param subscriberId Identification of the subscriber
- * @param sTag additional outer tag on this port
- * @param cTag additional inner tag on this port
- * @param tpId additional technology profile id
- * @return true if successful false otherwise
+ * Provisions connectivity for a particular service for a subscriber.
+ * @param cp subscriber's connect point
+ * @param cTag service's cTag
+ * @param sTag service's sTag
+ * @param tpId service's Technology Profile ID
+ * @return true if the request is accepted (does not guarantee the subscriber is provisioned)
*/
- boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag,
- Optional<VlanId> cTag, Optional<Integer> tpId);
+ boolean provisionSubscriber(ConnectPoint cp, VlanId cTag, VlanId sTag, Integer tpId);
/**
- * Removes a uni tag information for the specific subscriber.
- * It finds the related uni tag information from the subscriber uni tag list
- * and remove it
- *
- * @param subscriberId Identification of the subscriber
- * @param sTag additional outer tag on this port
- * @param cTag additional inner tag on this port
- * @param tpId additional technology profile id
- * @return true if successful false otherwise
+ * Removes connectivity for a particular service for a subscriber.
+ * @param cp subscriber's connect point
+ * @param cTag service's cTag
+ * @param sTag service's sTag
+ * @param tpId service's Technology Profile ID
+ * @return true if the request is accepted (does not guarantee the subscriber is removed)
*/
- boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag,
- Optional<VlanId> cTag, Optional<Integer> tpId);
+ boolean removeSubscriber(ConnectPoint cp, VlanId cTag, VlanId sTag, Integer tpId);
/**
- * Returns the list of active OLTs.
- *
- * @return a List
+ * Returns a list of connected OLT devices ID.
+ * @return a list of devices
*/
- List<DeviceId> fetchOlts();
+ List<DeviceId> getConnectedOlts();
/**
- * Returns information about subscribers that have been programmed in the
- * data-plane. It shows all uni tag information list of the subscribers even if
- * these have not been programmed.
+ * Finds the ConnectPoint to which a subscriber is connected.
*
- * @return an immutable map of locations and subscriber information
+ * @param id The id of the subscriber, this is the same ID as in Sadis
+ * @return Subscribers ConnectPoint if found else null
*/
- ImmutableMap<ConnectPoint, Set<UniTagInformation>> getProgSubs();
-
- /**
- * Returns information about subscribers that have NOT been programmed in the
- * data-plane. It shows all uni tag information list of the subscribers even if
- * these have not been programmed, meaning no flows have been sent to the device.
- *
- * @return an immutable map of locations and subscriber information
- */
- ImmutableMap<ConnectPoint, Set<UniTagInformation>> getFailedSubs();
+ ConnectPoint findSubscriberConnectPoint(String id);
}