blob: 06c51885832def106ef8a38abda4e1a61ec400a9 [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.List;
Amit Ghoshe1d3f092018-10-09 19:44:33 +010020import java.util.Optional;
Gamze Abaka1b7816e2019-11-25 06:38:41 +000021import java.util.Set;
Saurav Das82b8e6d2018-10-04 15:25:12 -070022
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;
27
Saurav Das82b8e6d2018-10-04 15:25:12 -070028import com.google.common.collect.ImmutableMap;
Gamze Abaka1b7816e2019-11-25 06:38:41 +000029import org.opencord.sadis.UniTagInformation;
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.
Gamze Abaka1b7816e2019-11-25 06:38:41 +000039 * Installs flows for all uni tag information
Jonathan Harte533a422015-10-20 17:31:24 -070040 *
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.
Gamze Abaka1b7816e2019-11-25 06:38:41 +000048 * Removes flows for all uni tag information
Jonathan Harte533a422015-10-20 17:31:24 -070049 *
50 * @param port subscriber's connection point
Amit Ghosh31939522018-08-16 13:28:21 +010051 * @return true if successful false otherwise
Jonathan Harte533a422015-10-20 17:31:24 -070052 */
Amit Ghosh31939522018-08-16 13:28:21 +010053 boolean removeSubscriber(ConnectPoint port);
54
55 /**
Gamze Abaka1b7816e2019-11-25 06:38:41 +000056 * 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 Ghosh31939522018-08-16 13:28:21 +010059 *
60 * @param subscriberId Identification of the subscriber
Gamze Abaka1b7816e2019-11-25 06:38:41 +000061 * @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 Ghosh31939522018-08-16 13:28:21 +010064 * @return true if successful false otherwise
65 */
Gamze Abaka1b7816e2019-11-25 06:38:41 +000066 boolean provisionSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag,
67 Optional<VlanId> cTag, Optional<Integer> tpId);
Amit Ghosh31939522018-08-16 13:28:21 +010068
69 /**
Gamze Abaka1b7816e2019-11-25 06:38:41 +000070 * 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 Ghosh31939522018-08-16 13:28:21 +010073 *
74 * @param subscriberId Identification of the subscriber
Gamze Abaka1b7816e2019-11-25 06:38:41 +000075 * @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 Ghosh31939522018-08-16 13:28:21 +010078 * @return true if successful false otherwise
79 */
Gamze Abaka1b7816e2019-11-25 06:38:41 +000080 boolean removeSubscriber(AccessSubscriberId subscriberId, Optional<VlanId> sTag,
81 Optional<VlanId> cTag, Optional<Integer> tpId);
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 Abaka1b7816e2019-11-25 06:38:41 +000092 * data-plane. It shows all uni tag information list of the subscribers even if
93 * these have not been programmed.
Saurav Das82b8e6d2018-10-04 15:25:12 -070094 *
95 * @return an immutable map of locations and subscriber information
96 */
Gamze Abaka1b7816e2019-11-25 06:38:41 +000097 ImmutableMap<ConnectPoint, Set<UniTagInformation>> getProgSubs();
Gamze Abaka33feef52019-02-27 08:16:47 +000098
Jonathan Harte533a422015-10-20 17:31:24 -070099}