blob: 2652a311e2899e29c40d4f6f55a46ee9e45d3bad [file] [log] [blame]
Jonathan Harte533a422015-10-20 17:31:24 -07001/*
Brian O'Connord6a135a2017-08-03 22:46:05 -07002 * Copyright 2016-present Open Networking Foundation
Jonathan Harte533a422015-10-20 17:31:24 -07003 *
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
alshabib36a4d732016-06-01 16:03:59 -070017package org.opencord.olt;
Jonathan Harte533a422015-10-20 17:31:24 -070018
Saurav Das82b8e6d2018-10-04 15:25:12 -070019import java.util.Collection;
20import java.util.List;
21import java.util.Map;
Amit Ghoshe1d3f092018-10-09 19:44:33 +010022import java.util.Optional;
Saurav Das82b8e6d2018-10-04 15:25:12 -070023
Jonathan Harte533a422015-10-20 17:31:24 -070024import org.onlab.packet.VlanId;
alshabib8e4fd2f2016-01-12 15:55:53 -080025import org.onosproject.event.ListenerService;
Jonathan Harte533a422015-10-20 17:31:24 -070026import org.onosproject.net.ConnectPoint;
alshabibe0559672016-02-21 14:49:51 -080027import org.onosproject.net.DeviceId;
Saurav Das82b8e6d2018-10-04 15:25:12 -070028import org.opencord.sadis.SubscriberAndDeviceInformation;
alshabibe0559672016-02-21 14:49:51 -080029
Saurav Das82b8e6d2018-10-04 15:25:12 -070030import com.google.common.collect.ImmutableMap;
Jonathan Harte533a422015-10-20 17:31:24 -070031
32/**
33 * Service for interacting with an access device (OLT).
34 */
alshabib8e4fd2f2016-01-12 15:55:53 -080035public interface AccessDeviceService
36 extends ListenerService<AccessDeviceEvent, AccessDeviceListener> {
Jonathan Harte533a422015-10-20 17:31:24 -070037
38 /**
39 * Provisions connectivity for a subscriber on an access device.
40 *
41 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010042 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070043 */
Amit Ghosh31939522018-08-16 13:28:21 +010044 boolean provisionSubscriber(ConnectPoint port);
Jonathan Harte533a422015-10-20 17:31:24 -070045
46 /**
47 * Removes provisioned connectivity for a subscriber from an access device.
48 *
49 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010050 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070051 */
Amit Ghosh31939522018-08-16 13:28:21 +010052 boolean removeSubscriber(ConnectPoint port);
53
54 /**
55 * Provisions flows for the specific subscriber.
56 *
57 * @param subscriberId Identification of the subscriber
Amit Ghoshe1d3f092018-10-09 19:44:33 +010058 * @param sTag additional outer tag on this port
59 * @param cTag additional inner tag on this port
Amit Ghosh31939522018-08-16 13:28:21 +010060 * @return true if successful false otherwise
61 */
Amit Ghoshe1d3f092018-10-09 19:44:33 +010062 boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag);
Amit Ghosh31939522018-08-16 13:28:21 +010063
64 /**
65 * Removes flows for the specific subscriber.
66 *
67 * @param subscriberId Identification of the subscriber
Amit Ghoshe1d3f092018-10-09 19:44:33 +010068 * @param sTag additional outer tag on this port
69 * @param cTag additional inner tag on this port
Amit Ghosh31939522018-08-16 13:28:21 +010070 * @return true if successful false otherwise
71 */
Amit Ghoshe1d3f092018-10-09 19:44:33 +010072 boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag);
alshabib8e4fd2f2016-01-12 15:55:53 -080073
alshabibe0559672016-02-21 14:49:51 -080074 /**
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080075 * Returns information about the provisioned subscribers.
76 *
77 * @return subscribers
78 */
Amit Ghosh31939522018-08-16 13:28:21 +010079 Collection<Map.Entry<ConnectPoint, Map.Entry<VlanId, VlanId>>> getSubscribers();
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080080
81 /**
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010082 * Returns the list of active OLTs.
alshabibe0559672016-02-21 14:49:51 -080083 *
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010084 * @return a List
alshabibe0559672016-02-21 14:49:51 -080085 */
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010086 List<DeviceId> fetchOlts();
alshabibe0559672016-02-21 14:49:51 -080087
Saurav Das82b8e6d2018-10-04 15:25:12 -070088 /**
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 Harte533a422015-10-20 17:31:24 -070096}