2 * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
8 package org.opendaylight.netvirt.elan.l2gw.jobs;
10 import javax.inject.Inject;
11 import javax.inject.Singleton;
12 import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
13 import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
14 import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
15 import org.opendaylight.netvirt.elan.utils.Scheduler;
16 import org.opendaylight.netvirt.elanmanager.utils.ElanL2GwCacheUtils;
19 public class McastUpdateJobUtil {
20 ElanL2GatewayMulticastUtils mcastUtils;
21 ElanClusterUtils elanClusterUtils;
23 JobCoordinator jobCoordinator;
26 public McastUpdateJobUtil(ElanL2GatewayMulticastUtils mcastUtils, ElanClusterUtils elanClusterUtils,
27 Scheduler scheduler, JobCoordinator jobCoordinator) {
28 this.mcastUtils = mcastUtils;
29 this.elanClusterUtils = elanClusterUtils;
30 this.scheduler = scheduler;
31 this.jobCoordinator = jobCoordinator;
34 public void updateAllMcasts(String elanName) {
35 ElanL2GwCacheUtils.getInvolvedL2GwDevices(elanName).keySet().forEach(nodeId -> {
36 new McastUpdateJob(elanName, nodeId, true, mcastUtils,
37 elanClusterUtils, scheduler, jobCoordinator).submit();
41 public void removeMcastForNode(String elanName, String nodeId) {
42 new McastUpdateJob(elanName, nodeId, false, mcastUtils,
43 elanClusterUtils, scheduler, jobCoordinator).submit();
46 public void updateMcastForNode(String elanName, String nodeId) {
47 new McastUpdateJob(elanName, nodeId, true, mcastUtils,
48 elanClusterUtils, scheduler, jobCoordinator).submit();