blob: e2d584cb6c9394860f1784449805380047526863 [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.incubator.net.virtual.VirtualPortDescription;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.MastershipRole;
22import org.onosproject.net.device.PortStatistics;
23
24import java.util.Collection;
25import java.util.List;
26
27/**
28 * Service through which virtual device providers can inject virtual device
29 * information into the core.
30 */
31public interface VirtualDeviceProviderService
32 extends VirtualProviderService<VirtualDeviceProvider> {
33
34 /**
35 * Updates information about all ports of a device. It is up to the core to
36 * determine what has changed.
37 *
38 * @param deviceId identity of the device
39 * @param portDescs list of virtual device ports
40 */
41 void updatePorts(DeviceId deviceId, List<VirtualPortDescription> portDescs);
42
43 /**
44 * Notifies the core about port status change of a single port.
45 *
46 * @param deviceId identity of the device
47 * @param portDesc description of the virtual port that changed
48 */
49 void portStatusChanged(DeviceId deviceId, VirtualPortDescription portDesc);
50
51 /**
52 * Notifies the core about the result of a RoleRequest sent to a device.
53 *
54 * @param deviceId identity of the device
55 * @param requested mastership role that was requested by the node
56 * @param response mastership role the switch accepted
57 */
58 void receivedRoleReply(DeviceId deviceId, MastershipRole requested,
59 MastershipRole response);
60
61 /**
62 * Updates statistics about all ports of a device.
63 *
64 * @param deviceId identity of the device
65 * @param portStatistics list of device port statistics
66 */
67 void updatePortStatistics(DeviceId deviceId,
68 Collection<PortStatistics> portStatistics);
69}