2 * Copyright 2014 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.openflow.controller;
18 import org.projectfloodlight.openflow.protocol.OFPortStatus;
21 * Allows for providers interested in Switch events to be notified.
23 public interface OpenFlowSwitchListener {
26 * Notify that the switch was added.
27 * @param dpid the switch where the event occurred
29 void switchAdded(Dpid dpid);
32 * Notify that the switch was removed.
33 * @param dpid the switch where the event occurred.
35 void switchRemoved(Dpid dpid);
38 * Notify that the switch has changed in some way.
39 * @param dpid the switch that changed
41 void switchChanged(Dpid dpid);
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.
48 void portChanged(Dpid dpid, OFPortStatus status);
51 * Notify that a role imposed on a switch failed to take hold.
53 * @param dpid the switch that failed role assertion
54 * @param requested the role controller requested
55 * @param response role reply from the switch
57 void receivedRoleReply(Dpid dpid, RoleState requested, RoleState response);