4920bb491bcf1633d9c35a93a688c94ca287875c
[controller.git] / opendaylight / protocol_plugins / openflow_netty / 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.net.InetAddress;
13 import java.util.Map;
14
15 import org.openflow.protocol.OFType;
16
17 /**
18  * This interface defines an abstraction of the Open Flow Controller that allows applications to control and manage the Open Flow switches.
19  *
20  */
21 public interface IController {
22
23     /**
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
27      */
28     public void addMessageListener(OFType type, IMessageListener listener);
29
30     /**
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
34      */
35     public void removeMessageListener(OFType type, IMessageListener listener);
36
37     /**
38      * Allows application to start receiving switch state change events.
39      * @param listener The object that implements the ISwitchStateListener
40      */
41     public void addSwitchStateListener(ISwitchStateListener listener);
42
43     /**
44      * Allows application to stop receiving switch state change events.
45      * @param listener The object that implements the ISwitchStateListener
46      */
47     public void removeSwitchStateListener(ISwitchStateListener listener);
48
49     /**
50      * Returns a map containing all the OF switches that are currently connected to the Controller.
51      * @return Map of ISwitch
52      */
53     public Map<Long, ISwitch> getSwitches();
54
55     /**
56      * Returns the ISwitch of the given switchId.
57      *
58      * @param switchId The switch ID
59      * @return ISwitch if present, null otherwise
60      */
61     public ISwitch getSwitch(Long switchId);
62
63     public InetAddress getControllerIdForSwitch(Long id);
64
65
66 }