package org.opendaylight.vpnservice;
import java.math.BigInteger;
+import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+import org.opendaylight.fibmanager.api.IFibManager;
+import org.opendaylight.vpnmanager.api.IVpnManager;
import org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager;
import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.idmanager.rev150403.CreateIdPoolInput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class VpnserviceProvider implements BindingAwareProvider,
+public class VpnserviceProvider implements BindingAwareProvider, IVpnManager,
AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(VpnserviceProvider.class);
private VpnInterfaceManager vpnInterfaceManager;
private VpnManager vpnManager;
private IBgpManager bgpManager;
+ private IFibManager fibManager;
private IMdsalApiManager mdsalManager;
private IInterfaceManager interfaceManager;
private IdManagerService idManager;
this.mdsalManager = mdsalManager;
}
+ public void setFibManager(IFibManager fibManager) {
+ this.fibManager = fibManager;
+ }
+
public void setInterfaceManager(IInterfaceManager interfaceManager) {
this.interfaceManager = interfaceManager;
}
try {
Future<RpcResult<Void>> result = idManager.createIdPool(createPool);
if ((result != null) && (result.get().isSuccessful())) {
- LOG.info("Created IdPool for VPN Service");
+ LOG.debug("Created IdPool for VPN Service");
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Failed to create idPool for VPN Service",e);
vpnManager.close();
vpnInterfaceManager.close();
}
+
+ @Override
+ public Collection<Long> getDpnsForVpn(long vpnId) {
+ return vpnInterfaceManager.getDpnsForVpn(vpnId);
+ }
+
+ @Override
+ public void setFibService(IFibManager fibManager) {
+ LOG.debug("Fib service reference is initialized in VPN Manager");
+ this.fibManager = fibManager;
+ vpnInterfaceManager.setFibManager(fibManager);
+ }
}