Refactor VpnManager module.
[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.List;
12 import java.util.concurrent.Callable;
13 import org.opendaylight.netvirt.vpnmanager.iplearn.model.MacEntry;
14
15 public class IpMonitorStartTask implements Callable<List<ListenableFuture<Void>>> {
16     private final MacEntry macEntry;
17     private final Long arpMonitorProfileId;
18     private final AlivenessMonitorUtils alivenessMonitorUtils;
19
20     public IpMonitorStartTask(MacEntry macEntry, Long profileId, AlivenessMonitorUtils alivenessMonitorUtils) {
21         this.macEntry = macEntry;
22         this.arpMonitorProfileId = profileId;
23         this.alivenessMonitorUtils = alivenessMonitorUtils;
24     }
25
26     @Override
27     public List<ListenableFuture<Void>> call() {
28         alivenessMonitorUtils.startIpMonitoring(macEntry, arpMonitorProfileId);
29         return null;
30     }
31 }