Bug 1029: Remove dead code: samples/clustersession
[controller.git] / opendaylight / adsal / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / core / IController.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
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
8  */
9
10 package org.opendaylight.controller.protocol_plugin.openflow.core;
11
12 import java.util.Map;
13
14 import org.openflow.protocol.OFType;
15
16 /**
17  * This interface defines an abstraction of the Open Flow Controller that allows applications to control and manage the Open Flow switches.
18  *
19  */
20 public interface IController {
21
22     /**
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
26      */
27     public void addMessageListener(OFType type, IMessageListener listener);
28
29     /**
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
33      */
34     public void removeMessageListener(OFType type, IMessageListener listener);
35
36     /**
37      * Allows application to start receiving switch state change events.
38      * @param listener The object that implements the ISwitchStateListener
39      */
40     public void addSwitchStateListener(ISwitchStateListener listener);
41
42     /**
43      * Allows application to stop receiving switch state change events.
44      * @param listener The object that implements the ISwitchStateListener
45      */
46     public void removeSwitchStateListener(ISwitchStateListener listener);
47
48     /**
49      * Returns a map containing all the OF switches that are currently connected to the Controller.
50      * @return Map of ISwitch
51      */
52     public Map<Long, ISwitch> getSwitches();
53
54     /**
55      * Returns the ISwitch of the given switchId.
56      *
57      * @param switchId The switch ID
58      * @return ISwitch if present, null otherwise
59      */
60     public ISwitch getSwitch(Long switchId);
61
62 }