NETVIRT-1630 migrate to md-sal APIs
[netvirt.git] / vpnmanager / impl / src / main / java / org / opendaylight / netvirt / vpnmanager / iplearn / IpMonitorStartTask.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. 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 package org.opendaylight.netvirt.vpnmanager.iplearn;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.Collections;
12 import java.util.List;
13 import java.util.concurrent.Callable;
14 import org.opendaylight.netvirt.vpnmanager.iplearn.model.MacEntry;
15
16 public class IpMonitorStartTask implements Callable<List<? extends ListenableFuture<?>>> {
17     private final MacEntry macEntry;
18     private final Long arpMonitorProfileId;
19     private final AlivenessMonitorUtils alivenessMonitorUtils;
20
21     public IpMonitorStartTask(MacEntry macEntry, Long profileId, AlivenessMonitorUtils alivenessMonitorUtils) {
22         this.macEntry = macEntry;
23         this.arpMonitorProfileId = profileId;
24         this.alivenessMonitorUtils = alivenessMonitorUtils;
25     }
26
27     @Override
28     public List<ListenableFuture<Void>> call() {
29         alivenessMonitorUtils.startIpMonitoring(macEntry, arpMonitorProfileId);
30         return Collections.emptyList();
31     }
32 }