use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.elan.instance.ExternalTeps in project netvirt by opendaylight.
the class ElanExtnTepListener method updateElanRemoteBroadCastGroup.
@SuppressWarnings("checkstyle:IllegalCatch")
private void updateElanRemoteBroadCastGroup(final InstanceIdentifier<ExternalTeps> iid) {
String elanName = iid.firstKeyOf(ElanInstance.class).getElanInstanceName();
ElanInstance elanInfo = elanInstanceCache.get(elanName).orNull();
if (elanInfo == null) {
return;
}
jobCoordinator.enqueueJob(elanName, () -> {
SettableFuture<Void> ft = SettableFuture.create();
try {
// TODO make the following method return ft
elanL2GatewayMulticastUtils.updateRemoteBroadcastGroupForAllElanDpns(elanInfo);
ft.set(null);
} catch (Exception e) {
// since the above method does a sync write , if it fails there was no retry
// by setting the above mdsal exception in ft, and returning the ft makes sures that job is retried
ft.setException(e);
}
return Lists.newArrayList(ft);
}, ElanConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.elan.instance.ExternalTeps in project netvirt by opendaylight.
the class ElanL2GatewayMulticastUtils method getRemoteBCGroupBucketsOfElanExternalTeps.
public List<Bucket> getRemoteBCGroupBucketsOfElanExternalTeps(ElanInstance elanInfo, BigInteger dpnId, int bucketId) {
ElanInstance operElanInstance = null;
try {
operElanInstance = new SingleTransactionDataBroker(broker).syncReadOptional(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, elanInfo.getKey()).build()).orNull();
} catch (ReadFailedException e) {
LOG.error("Failed to read elan instance operational path {}", elanInfo, e);
return emptyList();
}
if (operElanInstance == null) {
return emptyList();
}
List<ExternalTeps> teps = operElanInstance.getExternalTeps();
if (teps == null || teps.isEmpty()) {
return emptyList();
}
List<Bucket> listBucketInfo = new ArrayList<>();
for (ExternalTeps tep : teps) {
String externalTep = tep.getNodeid() != null ? tep.getNodeid() : tep.getTepIp().toString();
String interfaceName = elanItmUtils.getExternalTunnelInterfaceName(String.valueOf(dpnId), externalTep);
if (interfaceName == null) {
LOG.error("Could not get interface name to ext tunnel {} {}", dpnId, tep.getTepIp());
continue;
}
List<Action> listActionInfo = elanItmUtils.buildTunnelItmEgressActions(interfaceName, elanUtils.getVxlanSegmentationId(elanInfo));
listBucketInfo.add(MDSALUtil.buildBucket(listActionInfo, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
}
return listBucketInfo;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.elan.instance.ExternalTeps in project netvirt by opendaylight.
the class BgpUtil method addTepToElanInstance.
public void addTepToElanInstance(String rd, String tepIp) {
if (rd == null || tepIp == null) {
LOG.error("addTepToElanInstance : Null parameters returning");
return;
}
String elanName = getElanNamefromRd(rd);
if (elanName == null) {
LOG.error("Elan null while processing RT2 for RD {}", rd);
return;
}
LOG.debug("Adding tepIp {} to elan {}", tepIp, elanName);
InstanceIdentifier<ExternalTeps> externalTepsId = getExternalTepsIdentifier(elanName, tepIp);
ExternalTepsBuilder externalTepsBuilder = new ExternalTepsBuilder();
ExternalTepsKey externalTepsKey = externalTepsId.firstKeyOf(ExternalTeps.class);
externalTepsBuilder.setKey(externalTepsKey);
externalTepsBuilder.setTepIp(externalTepsKey.getTepIp());
update(externalTepsId, externalTepsBuilder.build());
}
Aggregations