blob: 32c2ed08d526e359c5051ec0c8eba8c7082b92c4 [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
Gamze Abaka33feef52019-02-27 08:16:47 +000024import com.google.common.collect.ImmutableSet;
Jonathan Harte533a422015-10-20 17:31:24 -070025import org.onlab.packet.VlanId;
alshabib8e4fd2f2016-01-12 15:55:53 -080026import org.onosproject.event.ListenerService;
Jonathan Harte533a422015-10-20 17:31:24 -070027import org.onosproject.net.ConnectPoint;
alshabibe0559672016-02-21 14:49:51 -080028import org.onosproject.net.DeviceId;
Gamze Abaka33feef52019-02-27 08:16:47 +000029import org.onosproject.net.meter.MeterKey;
Saurav Das82b8e6d2018-10-04 15:25:12 -070030import org.opencord.sadis.SubscriberAndDeviceInformation;
alshabibe0559672016-02-21 14:49:51 -080031
Saurav Das82b8e6d2018-10-04 15:25:12 -070032import com.google.common.collect.ImmutableMap;
Jonathan Harte533a422015-10-20 17:31:24 -070033
34/**
35 * Service for interacting with an access device (OLT).
36 */
alshabib8e4fd2f2016-01-12 15:55:53 -080037public interface AccessDeviceService
38 extends ListenerService<AccessDeviceEvent, AccessDeviceListener> {
Jonathan Harte533a422015-10-20 17:31:24 -070039
40 /**
41 * Provisions connectivity for a subscriber on an access device.
42 *
43 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010044 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070045 */
Amit Ghosh31939522018-08-16 13:28:21 +010046 boolean provisionSubscriber(ConnectPoint port);
Jonathan Harte533a422015-10-20 17:31:24 -070047
48 /**
49 * Removes provisioned connectivity for a subscriber from an access device.
50 *
51 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010052 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070053 */
Amit Ghosh31939522018-08-16 13:28:21 +010054 boolean removeSubscriber(ConnectPoint port);
55
56 /**
57 * Provisions flows for the specific subscriber.
58 *
59 * @param subscriberId Identification of the subscriber
Amit Ghoshe1d3f092018-10-09 19:44:33 +010060 * @param sTag additional outer tag on this port
61 * @param cTag additional inner tag on this port
Amit Ghosh31939522018-08-16 13:28:21 +010062 * @return true if successful false otherwise
63 */
Amit Ghoshe1d3f092018-10-09 19:44:33 +010064 boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag);
Amit Ghosh31939522018-08-16 13:28:21 +010065
66 /**
67 * Removes flows for the specific subscriber.
68 *
69 * @param subscriberId Identification of the subscriber
Amit Ghoshe1d3f092018-10-09 19:44:33 +010070 * @param sTag additional outer tag on this port
71 * @param cTag additional inner tag on this port
Amit Ghosh31939522018-08-16 13:28:21 +010072 * @return true if successful false otherwise
73 */
Amit Ghoshe1d3f092018-10-09 19:44:33 +010074 boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag, Optional<VlanId> cTag);
alshabib8e4fd2f2016-01-12 15:55:53 -080075
alshabibe0559672016-02-21 14:49:51 -080076 /**
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080077 * Returns information about the provisioned subscribers.
78 *
79 * @return subscribers
80 */
Amit Ghosh31939522018-08-16 13:28:21 +010081 Collection<Map.Entry<ConnectPoint, Map.Entry<VlanId, VlanId>>> getSubscribers();
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080082
83 /**
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010084 * Returns the list of active OLTs.
alshabibe0559672016-02-21 14:49:51 -080085 *
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010086 * @return a List
alshabibe0559672016-02-21 14:49:51 -080087 */
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010088 List<DeviceId> fetchOlts();
alshabibe0559672016-02-21 14:49:51 -080089
Saurav Das82b8e6d2018-10-04 15:25:12 -070090 /**
91 * Returns information about subscribers that have been programmed in the
Gamze Abaka33feef52019-02-27 08:16:47 +000092 * data-plane.
Saurav Das82b8e6d2018-10-04 15:25:12 -070093 *
94 * @return an immutable map of locations and subscriber information
95 */
96 ImmutableMap<ConnectPoint, SubscriberAndDeviceInformation> getProgSubs();
97
Gamze Abaka33feef52019-02-27 08:16:47 +000098 /**
99 * Returns information about device-meter mappings that have been programmed in the
100 * data-plane.
101 *
102 * @return an immutable set of device-meter mappings
103 */
104 ImmutableSet<MeterKey> getProgMeters();
105
106 /**
107 * Returns information about bandwidthProfile-meterKey (device / meter) mappings
108 * that have been programmed in the data-plane.
109 *
110 * @return an immutable map of bandwidthProfile-meterKey (device / meter) mappings
111 */
112 ImmutableMap<String, List<MeterKey>> getBpMeterMappings();
113
Jonathan Harte533a422015-10-20 17:31:24 -0700114}