/*
- * Copyright (c) 2013, 2015 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2016 Red Hat, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import java.net.HttpURLConnection;
import java.util.List;
-import org.opendaylight.neutron.spi.INeutronPortAware;
-import org.opendaylight.neutron.spi.NeutronPort;
+import org.opendaylight.ovsdb.openstack.netvirt.translator.NeutronPort;
+import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.INeutronPortAware;
import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
import org.opendaylight.ovsdb.openstack.netvirt.api.EventDispatcher;
import org.opendaylight.ovsdb.openstack.netvirt.api.NodeCacheManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
+import org.opendaylight.ovsdb.openstack.netvirt.impl.DistributedArpService;
import org.opendaylight.ovsdb.openstack.netvirt.impl.NeutronL3Adapter;
import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.osgi.framework.BundleContext;
+
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// The implementation for each of these services is resolved by the OSGi Service Manager
private volatile NodeCacheManager nodeCacheManager;
private volatile NeutronL3Adapter neutronL3Adapter;
+ private volatile DistributedArpService distributedArpService;
private volatile Southbound southbound;
/**
LOG.debug(" Port-ADD successful for tenant-id - {}, network-id - {}, port-id - {}",
neutronPort.getTenantID(), neutronPort.getNetworkUUID(),
neutronPort.getID());
+ distributedArpService.handlePortEvent(neutronPort, Action.ADD);
neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.ADD);
}
}
private void doNeutronPortUpdated(NeutronPort neutronPort) {
LOG.debug("Handling neutron update port {}", neutronPort);
+ distributedArpService.handlePortEvent(neutronPort, Action.UPDATE);
neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.UPDATE);
}
}
private void doNeutronPortDeleted(NeutronPort neutronPort) {
LOG.debug("Handling neutron delete port {}", neutronPort);
+ distributedArpService.handlePortEvent(neutronPort, Action.DELETE);
neutronL3Adapter.handleNeutronPortEvent(neutronPort, Action.DELETE);
//TODO: Need to implement getNodes
List<Node> nodes = nodeCacheManager.getNodes();
}
@Override
- public void setDependencies(BundleContext bundleContext, ServiceReference serviceReference) {
+ public void setDependencies(ServiceReference serviceReference) {
nodeCacheManager =
(NodeCacheManager) ServiceHelper.getGlobalInstance(NodeCacheManager.class, this);
neutronL3Adapter =
(NeutronL3Adapter) ServiceHelper.getGlobalInstance(NeutronL3Adapter.class, this);
+ distributedArpService =
+ (DistributedArpService) ServiceHelper.getGlobalInstance(DistributedArpService.class, this);
southbound =
(Southbound) ServiceHelper.getGlobalInstance(Southbound.class, this);
eventDispatcher =
(EventDispatcher) ServiceHelper.getGlobalInstance(EventDispatcher.class, this);
- eventDispatcher.eventHandlerAdded(
- bundleContext.getServiceReference(INeutronPortAware.class.getName()), this);
+ eventDispatcher.eventHandlerAdded(serviceReference, this);
}
@Override