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; |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame^] | 22 | import java.util.Optional; |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 23 | |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 24 | import org.onlab.packet.VlanId; |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 25 | import org.onosproject.event.ListenerService; |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 26 | import org.onosproject.net.ConnectPoint; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 27 | import org.onosproject.net.DeviceId; |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 28 | import org.opencord.sadis.SubscriberAndDeviceInformation; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 29 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 30 | import com.google.common.collect.ImmutableMap; |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Service for interacting with an access device (OLT). |
| 34 | */ |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 35 | public interface AccessDeviceService |
| 36 | extends ListenerService<AccessDeviceEvent, AccessDeviceListener> { |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * Provisions connectivity for a subscriber on an access device. |
| 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. |
| 48 | * |
| 49 | * @param port subscriber's connection point |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 50 | * @return true if successful false otherwise |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 51 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 52 | boolean removeSubscriber(ConnectPoint port); |
| 53 | |
| 54 | /** |
| 55 | * Provisions flows for the specific subscriber. |
| 56 | * |
| 57 | * @param subscriberId Identification of the subscriber |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame^] | 58 | * @param sTag additional outer tag on this port |
| 59 | * @param cTag additional inner tag on this port |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 60 | * @return true if successful false otherwise |
| 61 | */ |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame^] | 62 | boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag); |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 63 | |
| 64 | /** |
| 65 | * Removes flows for the specific subscriber. |
| 66 | * |
| 67 | * @param subscriberId Identification of the subscriber |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame^] | 68 | * @param sTag additional outer tag on this port |
| 69 | * @param cTag additional inner tag on this port |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 70 | * @return true if successful false otherwise |
| 71 | */ |
Amit Ghosh | e1d3f09 | 2018-10-09 19:44:33 +0100 | [diff] [blame^] | 72 | boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag); |
alshabib | 8e4fd2f | 2016-01-12 15:55:53 -0800 | [diff] [blame] | 73 | |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 74 | /** |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 75 | * Returns information about the provisioned subscribers. |
| 76 | * |
| 77 | * @return subscribers |
| 78 | */ |
Amit Ghosh | 3193952 | 2018-08-16 13:28:21 +0100 | [diff] [blame] | 79 | Collection<Map.Entry<ConnectPoint, Map.Entry<VlanId, VlanId>>> getSubscribers(); |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 80 | |
| 81 | /** |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 82 | * Returns the list of active OLTs. |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 83 | * |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 84 | * @return a List |
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 | List<DeviceId> fetchOlts(); |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 87 | |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 88 | /** |
| 89 | * Returns information about subscribers that have been programmed in the |
| 90 | * dataplane. |
| 91 | * |
| 92 | * @return an immutable map of locations and subscriber information |
| 93 | */ |
| 94 | ImmutableMap<ConnectPoint, SubscriberAndDeviceInformation> getProgSubs(); |
| 95 | |
Jonathan Hart | e533a42 | 2015-10-20 17:31:24 -0700 | [diff] [blame] | 96 | } |