Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | d6a135a | 2017-08-03 22:46:05 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
alshabib | 36a4d73 | 2016-06-01 16:03:59 -0700 | [diff] [blame] | 17 | package org.opencord.olt; |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 18 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame^] | 19 | import java.util.Collection; |
| 20 | import java.util.List; |
| 21 | import java.util.Map; |
| 22 | |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 23 | import org.onlab.packet.VlanId; |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 24 | import org.onosproject.event.ListenerService; |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 25 | import org.onosproject.net.ConnectPoint; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 26 | import org.onosproject.net.DeviceId; |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame^] | 27 | import org.opencord.sadis.SubscriberAndDeviceInformation; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 28 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame^] | 29 | import com.google.common.collect.ImmutableMap; |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Service for interacting with an access device (OLT). |
| 33 | */ |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 34 | public interface AccessDeviceService |
| 35 | extends ListenerService<AccessDeviceEvent, AccessDeviceListener> { |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Provisions connectivity for a subscriber on an access device. |
| 39 | * |
| 40 | * @param port subscriber's connection point |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 41 | * @return true if successful false otherwise |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 42 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 43 | boolean provisionSubscriber(ConnectPoint port); |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Removes provisioned connectivity for a subscriber from an access device. |
| 47 | * |
| 48 | * @param port subscriber's connection point |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 49 | * @return true if successful false otherwise |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 50 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 51 | boolean removeSubscriber(ConnectPoint port); |
| 52 | |
| 53 | /** |
| 54 | * Provisions flows for the specific subscriber. |
| 55 | * |
| 56 | * @param subscriberId Identification of the subscriber |
| 57 | * @return true if successful false otherwise |
| 58 | */ |
| 59 | boolean provisionSubscriber(AccessSubscriberId subscriberId); |
| 60 | |
| 61 | /** |
| 62 | * Removes flows for the specific subscriber. |
| 63 | * |
| 64 | * @param subscriberId Identification of the subscriber |
| 65 | * @return true if successful false otherwise |
| 66 | */ |
| 67 | boolean removeSubscriber(AccessSubscriberId subscriberId); |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 68 | |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 69 | /** |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 70 | * Returns information about the provisioned subscribers. |
| 71 | * |
| 72 | * @return subscribers |
| 73 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 74 | Collection<Map.Entry<ConnectPoint, Map.Entry<VlanId, VlanId>>> getSubscribers(); |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 75 | |
| 76 | /** |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 77 | * Returns the list of active OLTs. |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 78 | * |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 79 | * @return a List |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 80 | */ |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 81 | List<DeviceId> fetchOlts(); |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 82 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame^] | 83 | /** |
| 84 | * Returns information about subscribers that have been programmed in the |
| 85 | * dataplane. |
| 86 | * |
| 87 | * @return an immutable map of locations and subscriber information |
| 88 | */ |
| 89 | ImmutableMap<ConnectPoint, SubscriberAndDeviceInformation> getProgSubs(); |
| 90 | |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 91 | } |