2da413357d1f928566cfe7f5657fffa6be229e26
[onosfw.git] /
1 /*
2  * Copyright 2014 Open Networking Laboratory
3  *
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 package org.onosproject.openflow.controller;
17
18 import org.projectfloodlight.openflow.protocol.OFPortStatus;
19
20 /**
21  * Allows for providers interested in Switch events to be notified.
22  */
23 public interface OpenFlowSwitchListener {
24
25     /**
26      * Notify that the switch was added.
27      * @param dpid the switch where the event occurred
28      */
29     void switchAdded(Dpid dpid);
30
31     /**
32      * Notify that the switch was removed.
33      * @param dpid the switch where the event occurred.
34      */
35     void switchRemoved(Dpid dpid);
36
37     /**
38      * Notify that the switch has changed in some way.
39      * @param dpid the switch that changed
40      */
41     void switchChanged(Dpid dpid);
42
43     /**
44      * 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      */
48     void portChanged(Dpid dpid, OFPortStatus status);
49
50     /**
51      * Notify that a role imposed on a switch failed to take hold.
52      *
53      * @param dpid the switch that failed role assertion
54      * @param requested the role controller requested
55      * @param response role reply from the switch
56      */
57     void receivedRoleReply(Dpid dpid, RoleState requested, RoleState response);
58 }