Search in sources :

Example 21 with DPNTEPsInfo

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo in project genius by opendaylight.

the class ItmInternalTunnelAddWorker method updateDpnTepInfoToConfig.

private static void updateDpnTepInfoToConfig(DPNTEPsInfo dpn, WriteTransaction tx) {
    LOG.debug("Updating CONFIGURATION datastore with DPN {} ", dpn);
    InstanceIdentifier<DpnEndpoints> dep = InstanceIdentifier.builder(DpnEndpoints.class).build();
    List<DPNTEPsInfo> dpnList = new ArrayList<>();
    dpnList.add(dpn);
    DpnEndpoints tnlBuilder = new DpnEndpointsBuilder().setDPNTEPsInfo(dpnList).build();
    tx.merge(LogicalDatastoreType.CONFIGURATION, dep, tnlBuilder);
}
Also used : DpnEndpoints(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.DpnEndpoints) DpnEndpointsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.DpnEndpointsBuilder) ArrayList(java.util.ArrayList) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo)

Example 22 with DPNTEPsInfo

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo in project genius by opendaylight.

the class ItmInternalTunnelAddWorker method wireUpWithinTransportZone.

private void wireUpWithinTransportZone(DPNTEPsInfo srcDpn, DPNTEPsInfo dstDpn, IMdsalApiManager mdsalManager, WriteTransaction transaction) {
    LOG.trace("Wiring up within Transport Zone for Dpns {}, {} ", srcDpn, dstDpn);
    List<TunnelEndPoints> srcEndPts = srcDpn.getTunnelEndPoints();
    List<TunnelEndPoints> dstEndPts = dstDpn.getTunnelEndPoints();
    for (TunnelEndPoints srcte : srcEndPts) {
        for (TunnelEndPoints dstte : dstEndPts) {
            // Compare the Transport zones
            if (!srcDpn.getDPNID().equals(dstDpn.getDPNID())) {
                if (!ItmUtils.getIntersection(srcte.getTzMembership(), dstte.getTzMembership()).isEmpty()) {
                    // wire them up
                    wireUpBidirectionalTunnel(srcte, dstte, srcDpn.getDPNID(), dstDpn.getDPNID(), mdsalManager, transaction);
                    if (!ItmTunnelAggregationHelper.isTunnelAggregationEnabled()) {
                        // CHECK THIS -- Assumption -- One end point per Dpn per transport zone
                        break;
                    }
                }
            }
        }
    }
}
Also used : TunnelEndPoints(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.TunnelEndPoints)

Example 23 with DPNTEPsInfo

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo in project genius by opendaylight.

the class DPNTEPsInfoCache method getDPNTepListFromDPNId.

public List<DPNTEPsInfo> getDPNTepListFromDPNId(List<BigInteger> dpnIds) {
    Collection<DPNTEPsInfo> meshedDpnList = this.getAllPresent();
    List<DPNTEPsInfo> cfgDpnList = new ArrayList<>();
    for (BigInteger dpnId : dpnIds) {
        for (DPNTEPsInfo teps : meshedDpnList) {
            if (dpnId.equals(teps.getDPNID())) {
                cfgDpnList.add(teps);
            }
        }
    }
    return cfgDpnList;
}
Also used : ArrayList(java.util.ArrayList) BigInteger(java.math.BigInteger) DPNTEPsInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo)

Aggregations

DPNTEPsInfo (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.DPNTEPsInfo)18 ArrayList (java.util.ArrayList)11 TunnelEndPoints (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.TunnelEndPoints)11 BigInteger (java.math.BigInteger)7 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)5 Subnets (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets)5 DeviceVteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.DeviceVteps)5 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)4 TzMembership (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.dpn.endpoints.dpn.teps.info.tunnel.end.points.TzMembership)4 Vteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.Vteps)4 HwVtep (org.opendaylight.genius.itm.confighelpers.HwVtep)3 ItmTepAddWorker (org.opendaylight.genius.itm.confighelpers.ItmTepAddWorker)3 ItmTepRemoveWorker (org.opendaylight.genius.itm.confighelpers.ItmTepRemoveWorker)3 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)3 ExternalTunnelList (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.ExternalTunnelList)3 ExternalTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnel)3 DcGatewayIp (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.dc.gateway.ip.list.DcGatewayIp)3 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)3 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2