3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.protocol_plugin.openflow.core;
12 import java.net.InetAddress;
15 import org.openflow.protocol.OFType;
18 * This interface defines an abstraction of the Open Flow Controller that allows applications to control and manage the Open Flow switches.
21 public interface IController {
24 * Allows application to start receiving OF messages received from switches.
25 * @param type the type of OF message that applications want to receive
26 * @param listener: Object that implements the IMessageListener
28 public void addMessageListener(OFType type, IMessageListener listener);
31 * Allows application to stop receiving OF message received from switches.
32 * @param type The type of OF message that applications want to stop receiving
33 * @param listener The object that implements the IMessageListener
35 public void removeMessageListener(OFType type, IMessageListener listener);
38 * Allows application to start receiving switch state change events.
39 * @param listener The object that implements the ISwitchStateListener
41 public void addSwitchStateListener(ISwitchStateListener listener);
44 * Allows application to stop receiving switch state change events.
45 * @param listener The object that implements the ISwitchStateListener
47 public void removeSwitchStateListener(ISwitchStateListener listener);
50 * Returns a map containing all the OF switches that are currently connected to the Controller.
51 * @return Map of ISwitch
53 public Map<Long, ISwitch> getSwitches();
56 * Returns the ISwitch of the given switchId.
58 * @param switchId The switch ID
59 * @return ISwitch if present, null otherwise
61 public ISwitch getSwitch(Long switchId);
63 public InetAddress getControllerIdForSwitch(Long id);