use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project netvirt by opendaylight.
the class NodeConnectedHandler method readAndCopyChildPSOpToHAPS.
/**
* Merge data of child PS node to HA ps node .
*
* @param childGlobalNode Ha Global Child node
* @param haNodePath Ha node path
* @param tx Transaction
* @throws ReadFailedException Exception thrown if read fails
*/
void readAndCopyChildPSOpToHAPS(Node childGlobalNode, InstanceIdentifier<Node> haNodePath, ReadWriteTransaction tx) throws ReadFailedException {
if (childGlobalNode == null || childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
return;
}
List<Switches> switches = childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches();
if (switches == null) {
return;
}
for (Switches ps : switches) {
Node childPsNode = HwvtepHAUtil.readNode(tx, OPERATIONAL, (InstanceIdentifier<Node>) ps.getSwitchRef().getValue());
if (childPsNode != null) {
InstanceIdentifier<Node> haPsPath = HwvtepHAUtil.convertPsPath(childPsNode, haNodePath);
copyChildPSOpToHAPS(childPsNode, haNodePath, haPsPath, tx);
}
}
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project genius by opendaylight.
the class IdManager method createGlobalPool.
private IdPool createGlobalPool(WriteTransaction tx, String poolName, long low, long high, long blockSize) throws ReadFailedException {
IdPool idPool;
InstanceIdentifier<IdPool> idPoolInstanceIdentifier = idUtils.getIdPoolInstance(poolName);
Optional<IdPool> existingIdPool = singleTxDB.syncReadOptional(CONFIGURATION, idPoolInstanceIdentifier);
if (!existingIdPool.isPresent()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating new global pool {}", poolName);
}
idPool = idUtils.createGlobalPool(poolName, low, high, blockSize);
tx.put(CONFIGURATION, idPoolInstanceIdentifier, idPool, true);
} else {
idPool = existingIdPool.get();
if (LOG.isDebugEnabled()) {
LOG.debug("GlobalPool exists {}", idPool);
}
}
return idPool;
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project genius by opendaylight.
the class ItmTunnelAggregationHelper method initTunnelAggregationConfig.
private void initTunnelAggregationConfig(ItmConfig itmConfig) {
// Load balancing of VxLAN feature is guarded by a global configuration option in the ITM,
// only when the feature is enabled, the logical tunnel interfaces should be created.
boolean tunnelAggregationConfigEnabled = false;
List<TunnelAggregation> tunnelsConfig = itmConfig != null ? itmConfig.getTunnelAggregation() : null;
if (tunnelsConfig != null) {
for (TunnelAggregation tnlCfg : tunnelsConfig) {
Class<? extends TunnelTypeBase> tunType = ItmUtils.getTunnelType(tnlCfg.getKey().getTunnelType());
if (tunType.isAssignableFrom(TunnelTypeVxlan.class)) {
tunnelAggregationConfigEnabled = tnlCfg.isEnabled();
LOG.info("MULTIPLE_VxLAN_TUNNELS: tunnelAggregationEnabled {}", tunnelAggregationConfigEnabled);
break;
}
}
}
tunnelAggregationEnabled = tunnelAggregationConfigEnabled;
}
Aggregations