Search in sources :

Example 46 with Transport

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.allowed.devices.device.Transport in project netvirt by opendaylight.

the class VpnInstanceListener method addVpnInstance.

// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
private void addVpnInstance(VpnInstance value, WriteTransaction writeConfigTxn, WriteTransaction writeOperTxn) {
    VpnAfConfig config = value.getIpv4Family();
    String vpnInstanceName = value.getVpnInstanceName();
    long vpnId = VpnUtil.getUniqueId(idManager, VpnConstants.VPN_IDPOOL_NAME, vpnInstanceName);
    if (vpnId == 0) {
        LOG.error("{} addVpnInstance: Unable to fetch label from Id Manager. Bailing out of adding operational" + " data for Vpn Instance {}", LOGGING_PREFIX_ADD, value.getVpnInstanceName());
        return;
    }
    LOG.info("{} addVpnInstance: VPN Id {} generated for VpnInstanceName {}", LOGGING_PREFIX_ADD, vpnId, vpnInstanceName);
    String primaryRd = VpnUtil.getPrimaryRd(value);
    org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstance vpnInstanceToVpnId = VpnUtil.getVpnInstanceToVpnId(vpnInstanceName, vpnId, primaryRd);
    if (writeConfigTxn != null) {
        writeConfigTxn.put(LogicalDatastoreType.CONFIGURATION, VpnOperDsUtils.getVpnInstanceToVpnIdIdentifier(vpnInstanceName), vpnInstanceToVpnId, WriteTransaction.CREATE_MISSING_PARENTS);
    } else {
        TransactionUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, VpnOperDsUtils.getVpnInstanceToVpnIdIdentifier(vpnInstanceName), vpnInstanceToVpnId);
    }
    VpnIds vpnIdToVpnInstance = VpnUtil.getVpnIdToVpnInstance(vpnId, value.getVpnInstanceName(), primaryRd, VpnUtil.isBgpVpn(vpnInstanceName, primaryRd));
    if (writeConfigTxn != null) {
        writeConfigTxn.put(LogicalDatastoreType.CONFIGURATION, VpnUtil.getVpnIdToVpnInstanceIdentifier(vpnId), vpnIdToVpnInstance, WriteTransaction.CREATE_MISSING_PARENTS);
    } else {
        TransactionUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, VpnUtil.getVpnIdToVpnInstanceIdentifier(vpnId), vpnIdToVpnInstance);
    }
    try {
        String cachedTransType = fibManager.getConfTransType();
        if (cachedTransType.equals("Invalid")) {
            try {
                fibManager.setConfTransType("L3VPN", "VXLAN");
            } catch (Exception e) {
                LOG.error("{} addVpnInstance: Exception caught setting the L3VPN tunnel transportType for vpn {}", LOGGING_PREFIX_ADD, vpnInstanceName, e);
            }
        } else {
            LOG.debug("{} addVpnInstance: Configured tunnel transport type for L3VPN {} as {}", LOGGING_PREFIX_ADD, vpnInstanceName, cachedTransType);
        }
    } catch (Exception e) {
        LOG.error("{} addVpnInstance: Error when trying to retrieve tunnel transport type for L3VPN {}", LOGGING_PREFIX_ADD, vpnInstanceName, e);
    }
    VpnInstanceOpDataEntryBuilder builder = new VpnInstanceOpDataEntryBuilder().setVrfId(primaryRd).setVpnId(vpnId).setVpnInstanceName(vpnInstanceName).setVpnState(VpnInstanceOpDataEntry.VpnState.Created).setIpv4Configured(false).setIpv6Configured(false);
    if (VpnUtil.isBgpVpn(vpnInstanceName, primaryRd)) {
        List<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget> opVpnTargetList = new ArrayList<>();
        builder.setBgpvpnType(VpnInstanceOpDataEntry.BgpvpnType.BGPVPNExternal);
        if (value.getL3vni() != null) {
            builder.setL3vni(value.getL3vni());
        }
        if (value.getType() == VpnInstance.Type.L2) {
            builder.setType(VpnInstanceOpDataEntry.Type.L2);
        }
        VpnTargets vpnTargets = config.getVpnTargets();
        if (vpnTargets != null) {
            List<VpnTarget> vpnTargetList = vpnTargets.getVpnTarget();
            if (vpnTargetList != null) {
                for (VpnTarget vpnTarget : vpnTargetList) {
                    VpnTargetBuilder vpnTargetBuilder = new VpnTargetBuilder().setKey(new VpnTargetKey(vpnTarget.getKey().getVrfRTValue())).setVrfRTType(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget.VrfRTType.forValue(vpnTarget.getVrfRTType().getIntValue())).setVrfRTValue(vpnTarget.getVrfRTValue());
                    opVpnTargetList.add(vpnTargetBuilder.build());
                }
            }
        }
        VpnTargetsBuilder vpnTargetsBuilder = new VpnTargetsBuilder().setVpnTarget(opVpnTargetList);
        builder.setVpnTargets(vpnTargetsBuilder.build());
        List<String> rds = config.getRouteDistinguisher();
        builder.setRd(rds);
    } else {
        builder.setBgpvpnType(VpnInstanceOpDataEntry.BgpvpnType.VPN);
    }
    if (writeOperTxn != null) {
        writeOperTxn.merge(LogicalDatastoreType.OPERATIONAL, VpnUtil.getVpnInstanceOpDataIdentifier(primaryRd), builder.build(), true);
    } else {
        TransactionUtil.syncWrite(dataBroker, LogicalDatastoreType.OPERATIONAL, VpnUtil.getVpnInstanceOpDataIdentifier(primaryRd), builder.build());
    }
    LOG.info("{} addVpnInstance: VpnInstanceOpData populated successfully for vpn {} rd {}", LOGGING_PREFIX_ADD, vpnInstanceName, primaryRd);
}
Also used : VpnTargetKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetKey) ArrayList(java.util.ArrayList) VpnAfConfig(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.VpnAfConfig) VpnTarget(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.af.config.vpntargets.VpnTarget) VpnTargetBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetBuilder) VpnInstanceOpDataEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntryBuilder) VpnIds(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.id.to.vpn.instance.VpnIds) VpnTargets(org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.af.config.VpnTargets) ExecutionException(java.util.concurrent.ExecutionException) ReadFailedException(org.opendaylight.controller.md.sal.common.api.data.ReadFailedException) VpnTargetsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.VpnTargetsBuilder)

Example 47 with Transport

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.allowed.devices.device.Transport in project netvirt by opendaylight.

the class ElanDpnToTransportZoneListener method remove.

@Override
public void remove(InstanceIdentifier<DpnInterfaces> key, DpnInterfaces dataObjectModification) {
    // Proceed only if "auto-config-transport-zones = TRUE"
    if (!useTransportZone) {
        return;
    }
    LOG.debug("Elan dpn {} delete detected, deleting transport zones", dataObjectModification.getDpId());
    Uint64 dpId = dataObjectModification.getDpId();
    String elanInstanceName = key.firstKeyOf(ElanDpnInterfacesList.class).getElanInstanceName();
    if (!ElanUtils.isVxlanNetworkOrVxlanSegment(elanInstanceCache.get(elanInstanceName).orElse(null))) {
        LOG.debug("ElanInstance {} is not vxlan network, nothing to do", elanInstanceName);
        return;
    }
    LOG.debug("Deleting tz for elanInstance {} dpId {}", elanInstanceName, dpId);
    transportZoneNotificationUtil.deleteTransportZone(elanInstanceName, dpId);
}
Also used : ElanDpnInterfacesList(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.ElanDpnInterfacesList) Uint64(org.opendaylight.yangtools.yang.common.Uint64)

Example 48 with Transport

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.allowed.devices.device.Transport in project netvirt by opendaylight.

the class NexthopManager method createConfTransportType.

private ConfTransportTypeL3vpn createConfTransportType(String type) {
    ConfTransportTypeL3vpn confTransType;
    switch(type) {
        case ITMConstants.TUNNEL_TYPE_GRE:
            confTransType = new ConfTransportTypeL3vpnBuilder().setTransportType(TunnelTypeGre.class).build();
            LOG.trace("Setting the confTransportType to GRE.");
            break;
        case ITMConstants.TUNNEL_TYPE_VXLAN:
            confTransType = new ConfTransportTypeL3vpnBuilder().setTransportType(TunnelTypeVxlan.class).build();
            LOG.trace("Setting the confTransportType to VxLAN.");
            break;
        default:
            LOG.trace("Invalid transport type {} passed to Config DS ", type);
            confTransType = null;
            break;
    }
    return confTransType;
}
Also used : ConfTransportTypeL3vpnBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.ConfTransportTypeL3vpnBuilder) ConfTransportTypeL3vpn(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.ConfTransportTypeL3vpn)

Example 49 with Transport

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.allowed.devices.device.Transport in project netvirt by opendaylight.

the class VpnInstanceListener method addVpnInstance.

// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
private void addVpnInstance(VpnInstance value, TypedWriteTransaction<Configuration> writeConfigTxn, TypedWriteTransaction<Operational> writeOperTxn) {
    if (writeConfigTxn == null) {
        LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, tx -> addVpnInstance(value, tx, writeOperTxn)), LOG, "Error adding VPN instance {}", value);
        return;
    }
    if (writeOperTxn == null) {
        LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> addVpnInstance(value, writeConfigTxn, tx)), LOG, "Error adding VPN instance {}", value);
        return;
    }
    String vpnInstanceName = value.getVpnInstanceName();
    Uint32 vpnId = vpnUtil.getUniqueId(VpnConstants.VPN_IDPOOL_NAME, vpnInstanceName);
    if (vpnId.longValue() == 0) {
        LOG.error("{} addVpnInstance: Unable to fetch label from Id Manager. Bailing out of adding operational" + " data for Vpn Instance {}", LOGGING_PREFIX_ADD, value.getVpnInstanceName());
        return;
    }
    LOG.info("{} addVpnInstance: VPN Id {} generated for VpnInstanceName {}", LOGGING_PREFIX_ADD, vpnId, vpnInstanceName);
    String primaryRd = VpnUtil.getPrimaryRd(value);
    org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.to.vpn.id.VpnInstance vpnInstanceToVpnId = VpnUtil.getVpnInstanceToVpnId(vpnInstanceName, vpnId, primaryRd);
    writeConfigTxn.mergeParentStructurePut(VpnOperDsUtils.getVpnInstanceToVpnIdIdentifier(vpnInstanceName), vpnInstanceToVpnId);
    VpnIds vpnIdToVpnInstance = VpnUtil.getVpnIdToVpnInstance(vpnId, value.getVpnInstanceName(), primaryRd, VpnUtil.isBgpVpn(vpnInstanceName, primaryRd));
    writeConfigTxn.mergeParentStructurePut(VpnUtil.getVpnIdToVpnInstanceIdentifier(vpnId), vpnIdToVpnInstance);
    try {
        String cachedTransType = fibManager.getConfTransType();
        if (cachedTransType.equals("Invalid")) {
            try {
                fibManager.setConfTransType("L3VPN", "VXLAN");
            } catch (Exception e) {
                LOG.error("{} addVpnInstance: Exception caught setting the L3VPN tunnel transportType for vpn {}", LOGGING_PREFIX_ADD, vpnInstanceName, e);
            }
        } else {
            LOG.debug("{} addVpnInstance: Configured tunnel transport type for L3VPN {} as {}", LOGGING_PREFIX_ADD, vpnInstanceName, cachedTransType);
        }
    } catch (Exception e) {
        LOG.error("{} addVpnInstance: Error when trying to retrieve tunnel transport type for L3VPN {}", LOGGING_PREFIX_ADD, vpnInstanceName, e);
    }
    VpnInstanceOpDataEntryBuilder builder = new VpnInstanceOpDataEntryBuilder().setVrfId(primaryRd).setVpnId(vpnId).setVpnInstanceName(vpnInstanceName).setVpnState(VpnInstanceOpDataEntry.VpnState.Created);
    if (VpnUtil.isBgpVpn(vpnInstanceName, primaryRd)) {
        List<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget> opVpnTargetList = new ArrayList<>();
        if (value.getL3vni() != null) {
            builder.setL3vni(value.getL3vni());
        }
        if (value.isL2vpn()) {
            builder.setType(VpnInstanceOpDataEntry.Type.L2);
        }
        VpnTargets vpnTargets = value.getVpnTargets();
        if (vpnTargets != null) {
            @Nullable Map<org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.vpn.instance.vpntargets.VpnTargetKey, VpnTarget> vpnTargetListMap = vpnTargets.nonnullVpnTarget();
            if (vpnTargetListMap != null) {
                for (VpnTarget vpnTarget : vpnTargetListMap.values()) {
                    VpnTargetBuilder vpnTargetBuilder = new VpnTargetBuilder().withKey(new VpnTargetKey(vpnTarget.key().getVrfRTValue())).setVrfRTType(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTarget.VrfRTType.forValue(vpnTarget.getVrfRTType().getIntValue())).setVrfRTValue(vpnTarget.getVrfRTValue());
                    opVpnTargetList.add(vpnTargetBuilder.build());
                }
            }
        }
        VpnTargetsBuilder vpnTargetsBuilder = new VpnTargetsBuilder().setVpnTarget(opVpnTargetList);
        builder.setVpnTargets(vpnTargetsBuilder.build());
        List<String> rds = value.getRouteDistinguisher();
        builder.setRd(rds);
    }
    // Get BGP-VPN type configured details from config vpn-instance
    builder.setBgpvpnType(VpnInstanceOpDataEntry.BgpvpnType.forValue(value.getBgpvpnType().getIntValue()));
    writeOperTxn.mergeParentStructureMerge(VpnUtil.getVpnInstanceOpDataIdentifier(primaryRd), builder.build());
    LOG.info("{} addVpnInstance: VpnInstanceOpData populated successfully for vpn {} rd {}", LOGGING_PREFIX_ADD, vpnInstanceName, primaryRd);
}
Also used : CONFIGURATION(org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION) VpnInstances(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.VpnInstances) SingleTransactionDataBroker(org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker) IFibManager(org.opendaylight.netvirt.fibmanager.api.IFibManager) Arrays(java.util.Arrays) LoggerFactory(org.slf4j.LoggerFactory) DcGatewayIpKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.dc.gateway.ip.list.DcGatewayIpKey) VpnInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.VpnInstance) PreDestroy(javax.annotation.PreDestroy) ExternalTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnel) Nullable(org.eclipse.jdt.annotation.Nullable) VpnTargetsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.VpnTargetsBuilder) DcGatewayIp(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.dc.gateway.ip.list.DcGatewayIp) Map(java.util.Map) IBgpManager(org.opendaylight.netvirt.bgpmanager.api.IBgpManager) LoggingFutures(org.opendaylight.infrautils.utils.concurrent.LoggingFutures) DcGatewayIpList(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.DcGatewayIpList) MDSALUtil(org.opendaylight.genius.mdsalutil.MDSALUtil) VpnIds(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.id.to.vpn.instance.VpnIds) Collection(java.util.Collection) Configuration(org.opendaylight.mdsal.binding.util.Datastore.Configuration) FlowEntity(org.opendaylight.genius.mdsalutil.FlowEntity) Objects(java.util.Objects) ExternalTunnelKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnelKey) List(java.util.List) ManagedNewTransactionRunnerImpl(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl) VpnInstanceOpDataEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntry) TypedWriteTransaction(org.opendaylight.mdsal.binding.util.TypedWriteTransaction) AddressFamily(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.ebgp.rev150901.AddressFamily) Optional(java.util.Optional) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) NWUtil(org.opendaylight.genius.mdsalutil.NWUtil) Uint64(org.opendaylight.yangtools.yang.common.Uint64) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) Executors(org.opendaylight.infrautils.utils.concurrent.Executors) ManagedNewTransactionRunner(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner) Callable(java.util.concurrent.Callable) VpnTargetBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetBuilder) Singleton(javax.inject.Singleton) InstructionWriteMetadata(org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata) ArrayList(java.util.ArrayList) VpnTarget(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.vpn.instance.vpntargets.VpnTarget) Inject(javax.inject.Inject) MatchTunnelId(org.opendaylight.genius.mdsalutil.matches.MatchTunnelId) MatchInfo(org.opendaylight.genius.mdsalutil.MatchInfo) NwConstants(org.opendaylight.genius.mdsalutil.NwConstants) ExternalTunnelList(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.ExternalTunnelList) VpnTargets(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.vpn.instance.VpnTargets) Uint32(org.opendaylight.yangtools.yang.common.Uint32) Logger(org.slf4j.Logger) ReentrantLock(java.util.concurrent.locks.ReentrantLock) AbstractAsyncDataTreeChangeListener(org.opendaylight.serviceutils.tools.listener.AbstractAsyncDataTreeChangeListener) JobCoordinator(org.opendaylight.infrautils.jobcoordinator.JobCoordinator) WriteTransaction(org.opendaylight.mdsal.binding.api.WriteTransaction) Operational(org.opendaylight.mdsal.binding.util.Datastore.Operational) VrfTables(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables) VpnTargetKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetKey) SystemPropertyReader(org.opendaylight.genius.utils.SystemPropertyReader) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) FutureCallback(com.google.common.util.concurrent.FutureCallback) VpnInstanceOpDataEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntryBuilder) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) InstructionInfo(org.opendaylight.genius.mdsalutil.InstructionInfo) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) InstructionGotoTable(org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable) Collections(java.util.Collections) MetaDataUtil(org.opendaylight.genius.mdsalutil.MetaDataUtil) OPERATIONAL(org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL) JvmGlobalLocks(org.opendaylight.genius.utils.JvmGlobalLocks) DataBroker(org.opendaylight.mdsal.binding.api.DataBroker) VpnTargetKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetKey) ArrayList(java.util.ArrayList) VpnTarget(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.vpn.instance.vpntargets.VpnTarget) VpnTargetBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.vpntargets.VpnTargetBuilder) VpnInstanceOpDataEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntryBuilder) VpnIds(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.id.to.vpn.instance.VpnIds) Uint32(org.opendaylight.yangtools.yang.common.Uint32) VpnTargets(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.l3vpn.rev200204.vpn.instances.vpn.instance.VpnTargets) ExecutionException(java.util.concurrent.ExecutionException) VpnTargetsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.vpn.instance.op.data.entry.VpnTargetsBuilder) Nullable(org.eclipse.jdt.annotation.Nullable)

Example 50 with Transport

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netconf.callhome.server.rev201015.netconf.callhome.server.allowed.devices.device.Transport in project bgpcep by opendaylight.

the class NeighborStateCliUtils method printTransportState.

private static void printTransportState(final Transport transport, final ShellTable table) {
    if (transport == null) {
        return;
    }
    final NeighborTransportStateAugmentation state = transport.getState().augmentation(NeighborTransportStateAugmentation.class);
    if (state == null) {
        return;
    }
    addHeader(table, "Transport state");
    final IpAddress remoteAddress = state.getRemoteAddress();
    final String stringRemoteAddress;
    if (remoteAddress.getIpv4Address() == null) {
        stringRemoteAddress = remoteAddress.getIpv6Address().getValue();
    } else {
        stringRemoteAddress = remoteAddress.getIpv4Address().getValue();
    }
    table.addRow().addContent("Remote Address", stringRemoteAddress);
    table.addRow().addContent("Remote Port", state.getRemotePort().getValue());
    table.addRow().addContent("Local Port", state.getLocalPort().getValue());
}
Also used : NeighborTransportStateAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.NeighborTransportStateAugmentation) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

ArrayList (java.util.ArrayList)24 UnknownVteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVteps)24 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)24 TepsInNotHostedTransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone)21 UnknownVtepsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.tepsinnothostedtransportzone.UnknownVtepsKey)20 Vteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Vteps)17 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)16 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)16 TransportZoneKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZoneKey)15 List (java.util.List)13 VtepsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.VtepsKey)13 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)12 TransportZones (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.TransportZones)12 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)12 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)11 Map (java.util.Map)11 Test (org.junit.Test)11 TepsInNotHostedTransportZoneKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZoneKey)11 Optional (java.util.Optional)10 Inject (javax.inject.Inject)10