blob: 395f08ee0f88e563835d616222d7abbb49a756aa [file] [log] [blame]
Hyunsun Moon90163ba2016-10-12 13:35:14 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon90163ba2016-10-12 13:35:14 -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 */
16package org.onosproject.ofagent.api;
17
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090018import org.onosproject.incubator.net.virtual.NetworkId;
Claudine Chiu5c184e12017-08-08 21:21:38 -040019import org.onosproject.net.ConnectPoint;
Claudine Chiu785ef2d2017-07-04 13:13:28 -040020import org.onosproject.net.DeviceId;
21import org.onosproject.net.Port;
Claudine Chiu5c184e12017-08-08 21:21:38 -040022import org.onosproject.net.PortNumber;
Claudine Chiu2729ffd2017-07-31 21:38:27 -040023import org.onosproject.net.device.PortStatistics;
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090024
Claudine Chiu2729ffd2017-07-31 21:38:27 -040025import java.util.List;
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090026import java.util.Set;
Hyunsun Moon90163ba2016-10-12 13:35:14 -070027
28/**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090029 * Service for providing virtual OpenFlow switch information.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070030 */
31public interface OFSwitchService {
32
33 /**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090034 * Returns all openflow switches that OF agent service manages.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070035 *
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090036 * @return set of openflow switches; empty set if no openflow switches exist
Hyunsun Moon90163ba2016-10-12 13:35:14 -070037 */
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090038 Set<OFSwitch> ofSwitches();
Hyunsun Moon90163ba2016-10-12 13:35:14 -070039
40 /**
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090041 * Returns all openflow switches for the specified network.
Hyunsun Moon90163ba2016-10-12 13:35:14 -070042 *
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090043 * @param networkId network id
44 * @return set of openflow switches; empty set if no devices exist on the network
Hyunsun Moon90163ba2016-10-12 13:35:14 -070045 */
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +090046 Set<OFSwitch> ofSwitches(NetworkId networkId);
Claudine Chiu785ef2d2017-07-04 13:13:28 -040047
48 /**
Claudine Chiu2729ffd2017-07-31 21:38:27 -040049 * Returns openflow switch for the specified device in the specified network.
50 *
51 * @param networkId network id
52 * @param deviceId device id
53 * @return openflow switch; null if none exists
54 */
55 OFSwitch ofSwitch(NetworkId networkId, DeviceId deviceId);
56
57 /**
Claudine Chiu785ef2d2017-07-04 13:13:28 -040058 * Returns all ports of the specified device in the specified network.
59 *
60 * @param networkId network id
61 * @param deviceId device id
62 * @return set of ports; empty set if no ports exist for the specified device
63 */
64 Set<Port> ports(NetworkId networkId, DeviceId deviceId);
Claudine Chiu2729ffd2017-07-31 21:38:27 -040065
66 /**
67 * Returns all port statistics of the specified device in the specified network.
68 *
69 * @param networkId network id
70 * @param deviceId device id
71 * @return list of port statistics; empty list if none exists for the specified device
72 */
73 List<PortStatistics> getPortStatistics(NetworkId networkId, DeviceId deviceId);
74
Claudine Chiu5c184e12017-08-08 21:21:38 -040075 /**
76 * Returns neighbour port of the specified port in the specified network.
77 *
78 * @param networkId network id
79 * @param deviceId device id
80 * @param portNumber port number
81 * @return connect point; null if none exists
82 */
83 ConnectPoint neighbour(NetworkId networkId, DeviceId deviceId, PortNumber portNumber);
Hyunsun Moon90163ba2016-10-12 13:35:14 -070084}