2 * Copyright (c) 2017 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.genius.interfacemanager.servicebindings.flowbased.config.helpers;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.List;
12 import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.config.factory.FlowBasedServicesConfigRemovable;
13 import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.L2vlan;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.Tunnel;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.bound.services.state.list.BoundServicesState;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
20 * AbstractFlowBasedServicesConfigBindHelper to enable flow based ingress/egress service binding for interfaces.
22 public abstract class AbstractFlowBasedServicesConfigUnbindHelper implements FlowBasedServicesConfigRemovable {
25 public final void unbindService(List<ListenableFuture<Void>> futures, String interfaceName,
26 BoundServices boundServiceOld, List<BoundServices> boundServices,
27 BoundServicesState boundServicesState) {
29 if (FlowBasedServicesUtils.isInterfaceTypeBasedServiceBinding(interfaceName)) {
30 unbindServiceOnInterfaceType(futures, boundServiceOld, boundServices);
31 } else if (L2vlan.class.equals(boundServicesState.getInterfaceType())
32 || Tunnel.class.equals(boundServicesState.getInterfaceType())) {
33 unbindServiceOnInterface(futures, boundServiceOld, boundServices, boundServicesState);
38 protected abstract void unbindServiceOnInterface(List<ListenableFuture<Void>> futures,
39 BoundServices boundServiceOld, List<BoundServices> allServices,
40 BoundServicesState boundServicesState);
42 protected abstract void unbindServiceOnInterfaceType(List<ListenableFuture<Void>> futures,
43 BoundServices boundServiceOld,
44 List<BoundServices> allServices);