blob: 2deaeded843e72b4fab2eb4709c6a9ccc72ad975 [file] [log] [blame]
Matteo Scandoloaa2adde2021-09-13 12:45:32 -07001/*
Joey Armstrong7f6d6d22023-01-09 17:09:50 -05002 * Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandoloaa2adde2021-09-13 12:45:32 -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
Gustavo Silva29fb20e2022-05-26 09:59:54 -030017package org.opencord.olt;
Matteo Scandoloaa2adde2021-09-13 12:45:32 -070018
19import org.onosproject.net.Device;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.Port;
22import org.onosproject.net.PortNumber;
23
24import java.util.Optional;
25
26/**
27 * Service for olt device handling.
28 */
29public interface OltDeviceServiceInterface {
30 /**
31 * Returns true if the device is a known OLT to sadis/config.
32 * @param device the device
33 * @return true if a configured olt
34 */
35 boolean isOlt(Device device);
36
37 /**
38 * Returns true if the port is an NNI port of the OLT device.
39 * @param device the device
40 * @param port the port
41 * @return true if an NNI port of that OLT
42 */
43 boolean isNniPort(Device device, PortNumber port);
44
45 /**
46 * Returns the NNi port fo the OLT device if present.
47 * @param device the device
48 * @return the nni Port, if present
49 */
50 Optional<Port> getNniPort(Device device);
51
52 /**
53 * Returns true if the instance is leader for the OLT device.
54 * @param deviceId the device
55 * @return true if master, false otherwise.
56 */
57 boolean isLocalLeader(DeviceId deviceId);
58}