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.hosttracker;
12 import java.net.InetAddress;
13 import java.util.List;
15 import java.util.concurrent.Future;
16 import org.opendaylight.controller.sal.core.NodeConnector;
17 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
18 import org.opendaylight.controller.sal.utils.Status;
21 * This interface defines the methods to retrieve information about
22 * learned Hosts. Also provides methods to statically add/remove
23 * Hosts from the local database.
27 public interface IfIptoHost {
29 * Applications call this interface methods to determine IP address to MAC binding and its
30 * connectivity to an OpenFlow switch in term of Node, Port, and VLAN. These
31 * bindings are learned dynamically as well as can be added statically through
32 * Northbound APIs. If a binding is unknown, then an ARP request is initiated
33 * immediately to discover the host.
35 * @param networkAddress IP Address of the Host encapsulated in class InetAddress
36 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
37 * Class that contains the Host info such as its MAC address,
38 * Switch ID, port, VLAN. If Host is not found, returns NULL
40 public HostNodeConnector hostFind(InetAddress networkAddress);
43 * Checks the local Host Database to see if a Host has been learned for a
46 * @param networkAddress IP Address of the Host encapsulated in class InetAddress
47 * @return {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}
48 * Class that contains the Host info such as its MAC address,
49 * Switch ID, port, VLAN. If Host is not found, returns NULL
52 public HostNodeConnector hostQuery(InetAddress networkAddress);
55 * Initiates an immediate discovery of the Host for a given IP address. This
56 * provides for the calling applications to block on the host discovery.
58 * @param networkAddress IP address encapsulated in InetAddress class
59 * @return Future {@link org.opendaylight.controller.hosttracker.HostTrackerCallable}
61 public Future<HostNodeConnector> discoverHost(InetAddress networkAddress);
64 * Returns the Network Hierarchy for a given Host. This API is typically used by
65 * applications like Hadoop for Rack Awareness functionality.
67 * @param IP address of the Host encapsulated in InetAddress class
68 * @return List of String ArrayList containing the Hierarchies.
70 public List<List<String>> getHostNetworkHierarchy(InetAddress hostAddress);
73 * Returns all the the Hosts either learned dynamically or added statically via
76 * @return Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
77 * Class that contains the Host info such as its MAC address,
78 * Switch ID, port, VLAN.
80 public Set<HostNodeConnector> getAllHosts();
83 * Returns all the "Active Hosts" learned "Statically" via Northbound APIs. These Hosts
84 * are categorized as "Active" because the Switch and Port they are connected to, are in
87 * @return Set of {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
88 * Class that contains the Host info such as MAC address,
89 * Switch ID, port, VLAN. If Host is not found, returns NULL
91 public Set<HostNodeConnector> getActiveStaticHosts();
94 * Returns all the "Inactive Hosts" learned "Statically" via Northbound APIs. These Hosts
95 * are categorized as "Inactive" because either the Switch or the Port they are connected
96 * to, is in down state.
98 * @return Set of HostNodeConnector {@link org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector}.
99 * HostNodeConnector is Class that
100 * contains the Host info such as its MAC address, OpenFlowNode
103 public Set<HostNodeConnector> getInactiveStaticHosts();
106 * Hosts can be learned dynamically or added statically. This method allows the addition
107 * of a Host to the local database statically.
109 * @param networkAddress IP Address of the Host
110 * @param dataLayerAddress MAC Address of the Host
111 * @param nc NodeConnector to which the host is attached
112 * @param vlan VLAN the host belongs to
113 * @return The status object as described in {@code Status}
114 * indicating the result of this action.
116 public Status addStaticHost(String networkAddress, String dataLayerAddress,
117 NodeConnector nc, String vlan);
120 * Allows the deletion of statically learned Host
122 * @param networkAddress
123 * @return The status object as described in {@code Status}
124 * indicating the result of this action.
126 public Status removeStaticHost(String networkAddress);