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.List; |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame] | 20 | import java.util.Optional; |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 21 | import java.util.Set; |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 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; |
| 27 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 28 | import com.google.common.collect.ImmutableMap; |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 29 | import org.opencord.sadis.UniTagInformation; |
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. |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 39 | * Installs flows for all uni tag information |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 40 | * |
| 41 | * @param port subscriber's connection point |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 42 | * @return true if successful false otherwise |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 43 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 44 | boolean provisionSubscriber(ConnectPoint port); |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Removes provisioned connectivity for a subscriber from an access device. |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 48 | * Removes flows for all uni tag information |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 49 | * |
| 50 | * @param port subscriber's connection point |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 51 | * @return true if successful false otherwise |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 52 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 53 | boolean removeSubscriber(ConnectPoint port); |
| 54 | |
| 55 | /** |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 56 | * Provisions a uni tag information for the specific subscriber. |
| 57 | * It finds the related uni tag information from the subscriber uni tag list |
| 58 | * and installs it |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 59 | * |
| 60 | * @param subscriberId Identification of the subscriber |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 61 | * @param sTag additional outer tag on this port |
| 62 | * @param cTag additional inner tag on this port |
| 63 | * @param tpId additional technology profile id |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 64 | * @return true if successful false otherwise |
| 65 | */ |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 66 | boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, |
| 67 | Optional<VlanId> cTag, Optional<Integer> tpId); |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 68 | |
| 69 | /** |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 70 | * Removes a uni tag information for the specific subscriber. |
| 71 | * It finds the related uni tag information from the subscriber uni tag list |
| 72 | * and remove it |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 73 | * |
| 74 | * @param subscriberId Identification of the subscriber |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 75 | * @param sTag additional outer tag on this port |
| 76 | * @param cTag additional inner tag on this port |
| 77 | * @param tpId additional technology profile id |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 78 | * @return true if successful false otherwise |
| 79 | */ |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 80 | boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, |
| 81 | Optional<VlanId> cTag, Optional<Integer> tpId); |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 82 | |
| 83 | /** |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 84 | * Returns the list of active OLTs. |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 85 | * |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 86 | * @return a List |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 87 | */ |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 88 | List<DeviceId> fetchOlts(); |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 89 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 90 | /** |
| 91 | * Returns information about subscribers that have been programmed in the |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 92 | * data-plane. It shows all uni tag information list of the subscribers even if |
| 93 | * these have not been programmed. |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 94 | * |
| 95 | * @return an immutable map of locations and subscriber information |
| 96 | */ |
Gamze Abaka | 1b7816e | 2019-11-25 06:38:41 +0000 | [diff] [blame] | 97 | ImmutableMap<ConnectPoint, Set<UniTagInformation>> getProgSubs(); |
Gamze Abaka | 33feef5 | 2019-02-27 08:16:47 +0000 | [diff] [blame] | 98 | |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 99 | } |