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.openflowplugin.openflow.core;
14 import org.openflow.protocol.OFType;
17 * This interface defines an abstraction of the Open Flow Controller that allows applications to control and manage the Open Flow switches.
20 public interface IController {
23 * Allows application to start receiving OF messages received from switches.
24 * @param type the type of OF message that applications want to receive
25 * @param listener: Object that implements the IMessageListener
27 public void addMessageListener(OFType type, IMessageListener listener);
30 * Allows application to stop receiving OF message received from switches.
31 * @param type The type of OF message that applications want to stop receiving
32 * @param listener The object that implements the IMessageListener
34 public void removeMessageListener(OFType type, IMessageListener listener);
37 * Allows application to start receiving switch state change events.
38 * @param listener The object that implements the ISwitchStateListener
40 public void addSwitchStateListener(ISwitchStateListener listener);
43 * Allows application to stop receiving switch state change events.
44 * @param listener The object that implements the ISwitchStateListener
46 public void removeSwitchStateListener(ISwitchStateListener listener);
49 * Returns a map containing all the OF switches that are currently connected to the Controller.
50 * @return Map of ISwitch
52 public Map<Long, ISwitch> getSwitches();
55 * Returns the ISwitch of the given switchId.
57 * @param switchId The switch ID
58 * @return ISwitch if present, null otherwise
60 public ISwitch getSwitch(Long switchId);