blob: adf9387c7d349bee204cdbe6ec446102fef9dfa8 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska781d18b2014-10-27 10:31:25 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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
Thomas Vachuska781d18b2014-10-27 10:31:25 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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.
Thomas Vachuska781d18b2014-10-27 10:31:25 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.openflow.controller;
tom7ef8ff92014-09-17 13:08:06 -070017
18import org.projectfloodlight.openflow.protocol.OFPortStatus;
19
20/**
21 * Allows for providers interested in Switch events to be notified.
22 */
23public interface OpenFlowSwitchListener {
24
25 /**
26 * Notify that the switch was added.
27 * @param dpid the switch where the event occurred
28 */
Sho SHIMIZU358815c2015-05-13 11:25:32 -070029 void switchAdded(Dpid dpid);
tom7ef8ff92014-09-17 13:08:06 -070030
31 /**
32 * Notify that the switch was removed.
33 * @param dpid the switch where the event occurred.
34 */
Sho SHIMIZU358815c2015-05-13 11:25:32 -070035 void switchRemoved(Dpid dpid);
tom7ef8ff92014-09-17 13:08:06 -070036
37 /**
Ayaka Koshibe38594c22014-10-22 13:36:12 -070038 * Notify that the switch has changed in some way.
39 * @param dpid the switch that changed
40 */
Sho SHIMIZU358815c2015-05-13 11:25:32 -070041 void switchChanged(Dpid dpid);
Ayaka Koshibe38594c22014-10-22 13:36:12 -070042
43 /**
tom7ef8ff92014-09-17 13:08:06 -070044 * Notify that a port has changed.
45 * @param dpid the switch on which the change happened.
46 * @param status the new state of the port.
47 */
Sho SHIMIZU358815c2015-05-13 11:25:32 -070048 void portChanged(Dpid dpid, OFPortStatus status);
Ayaka Koshibeab91cc42014-09-25 10:20:52 -070049
50 /**
51 * Notify that a role imposed on a switch failed to take hold.
52 *
53 * @param dpid the switch that failed role assertion
Yuta HIGUCHI5c947272014-11-03 21:39:21 -080054 * @param requested the role controller requested
55 * @param response role reply from the switch
Ayaka Koshibeab91cc42014-09-25 10:20:52 -070056 */
Sho SHIMIZU358815c2015-05-13 11:25:32 -070057 void receivedRoleReply(Dpid dpid, RoleState requested, RoleState response);
tom7ef8ff92014-09-17 13:08:06 -070058}