blob: 6387a036de0ae5206866279b080614e0406baa48 [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;
22
Jonathan Harte533a422015-10-20 17:31:24 -070023import org.onlab.packet.VlanId;
alshabib8e4fd2f2016-01-12 15:55:53 -080024import org.onosproject.event.ListenerService;
Jonathan Harte533a422015-10-20 17:31:24 -070025import org.onosproject.net.ConnectPoint;
alshabibe0559672016-02-21 14:49:51 -080026import org.onosproject.net.DeviceId;
Saurav Das82b8e6d2018-10-04 15:25:12 -070027import org.opencord.sadis.SubscriberAndDeviceInformation;
alshabibe0559672016-02-21 14:49:51 -080028
Saurav Das82b8e6d2018-10-04 15:25:12 -070029import com.google.common.collect.ImmutableMap;
Jonathan Harte533a422015-10-20 17:31:24 -070030
31/**
32 * Service for interacting with an access device (OLT).
33 */
alshabib8e4fd2f2016-01-12 15:55:53 -080034public interface AccessDeviceService
35 extends ListenerService<AccessDeviceEvent, AccessDeviceListener> {
Jonathan Harte533a422015-10-20 17:31:24 -070036
37 /**
38 * Provisions connectivity for a subscriber on an access device.
39 *
40 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010041 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070042 */
Amit Ghosh31939522018-08-16 13:28:21 +010043 boolean provisionSubscriber(ConnectPoint port);
Jonathan Harte533a422015-10-20 17:31:24 -070044
45 /**
46 * Removes provisioned connectivity for a subscriber from an access device.
47 *
48 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010049 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070050 */
Amit Ghosh31939522018-08-16 13:28:21 +010051 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);
alshabib8e4fd2f2016-01-12 15:55:53 -080068
alshabibe0559672016-02-21 14:49:51 -080069 /**
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080070 * Returns information about the provisioned subscribers.
71 *
72 * @return subscribers
73 */
Amit Ghosh31939522018-08-16 13:28:21 +010074 Collection<Map.Entry<ConnectPoint, Map.Entry<VlanId, VlanId>>> getSubscribers();
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080075
76 /**
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010077 * Returns the list of active OLTs.
alshabibe0559672016-02-21 14:49:51 -080078 *
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010079 * @return a List
alshabibe0559672016-02-21 14:49:51 -080080 */
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010081 List<DeviceId> fetchOlts();
alshabibe0559672016-02-21 14:49:51 -080082
Saurav Das82b8e6d2018-10-04 15:25:12 -070083 /**
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 Harte533a422015-10-20 17:31:24 -070091}