4fb38991f0def9f90316a57791963048b456b93a
[ovsdb.git] / openstack / net-virt / src / main / java / org / opendaylight / ovsdb / openstack / netvirt / api / GatewayMacResolver.java
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.ovsdb.openstack.netvirt.api;
10
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
13
14 import com.google.common.util.concurrent.ListenableFuture;
15
16 /**
17 *
18 * @author Anil Vishnoi (avishnoi@Brocade.com)
19 *
20 */
21
22 public interface GatewayMacResolver {
23
24     /**
25      * Method will trigger the mac resolution for gateway IP. If user set periodicRefresh to true,
26      * it will periodically trigger the gateway resolution after a specific time interval using the
27      * given source IP and MAC addresses. It will also cache the source IP and MAC in case of periodicRefresh.
28      * If periodicRefresh is false, it will just do one time gateway resolution and won't cache any internal data.
29      * If user call the same method with different source ip and mac address, GatewayMacResolver service will
30      * update the internally cached data with these new source ip and mac address and will use it as per
31      * periodicRefresh flag.
32      * @param externalNetworkBridgeDpid This bridge will be used for sending ARP request
33      * @param gatewayIp ARP request will be send for this ip address
34      * @param periodicRefresh Do you want to periodically refresh the gateway mac?
35      * @return
36      */
37     public ListenableFuture<MacAddress> resolveMacAddress( final Long externalNetworkBridgeDpid, final Ipv4Address gatewayIp,
38             final Ipv4Address sourceIpAddress, final MacAddress sourceMacAddress, final Boolean periodicRefresh);
39
40     /**
41      * Method will stop the periodic refresh of the given gateway ip address.
42      * @param gatewayIp
43      */
44     public void stopPeriodicRefresh(final Ipv4Address gatewayIp);
45 }