blob: 9191eaf9fdd77c468e3e8be1d993fb63ab560d07 [file] [log] [blame]
sangyun-han8df84bc2016-10-12 17:16:33 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sangyun-han8df84bc2016-10-12 17:16:33 +09003 *
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
17package org.onosproject.incubator.net.virtual.provider;
18
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.MastershipRole;
22import org.onosproject.net.PortNumber;
23
24/**
25 * Abstraction of a virtual device information provider.
26 */
27public interface VirtualDeviceProvider extends VirtualProvider {
28
29 /**
30 * Notifies the provider of a mastership role change for the specified
31 * device as decided by the core.
32 *
33 * @param deviceId device identifier
34 * @param newRole newly determined mastership role
35 */
36 void roleChanged(DeviceId deviceId, MastershipRole newRole);
37
38 /**
39 * Indicates whether or not the specified connect points on the underlying
40 * network are traversable.
41 *
42 * @param src source connection point
43 * @param dst destination connection point
44 * @return true if the destination is reachable from the source
45 */
46 boolean isTraversable(ConnectPoint src, ConnectPoint dst);
47
48 /**
49 * Indicates whether or not the all physical devices mapped by the given
50 * virtual device are reachable.
51 *
52 * @param deviceId device identifier
53 * @return true if the all physical devices are reachable, false otherwise
54 */
55 boolean isReachable(DeviceId deviceId);
56
57 /**
58 * Administratively enables or disables a port.
59 *
60 * @param deviceId device identifier
61 * @param portNumber port number
62 * @param enable true if port is to be enabled, false to disable
63 */
64 void changePortState(DeviceId deviceId, PortNumber portNumber,
65 boolean enable);
66}