public AdjacenciesBuilder(Adjacencies base) { this._adjacency = base.getAdjacency(); }
@Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (!(obj instanceof DataObject)) { return false; } if (!org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.Adjacencies.class.equals(((DataObject)obj).getImplementedInterface())) { return false; } org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.Adjacencies other = (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.Adjacencies)obj; if (!Objects.equals(_adjacency, other.getAdjacency())) { return false; } return true; }
static List<Adjacency> getAdjacenciesForVpnInterfaceFromConfig(DataBroker broker, String intfName) { final InstanceIdentifier<VpnInterface> identifier = getVpnInterfaceIdentifier(intfName); InstanceIdentifier<Adjacencies> path = identifier.augmentation(Adjacencies.class); Optional<Adjacencies> adjacencies = VpnUtil.read(broker, LogicalDatastoreType.CONFIGURATION, path); if (adjacencies.isPresent()) { List<Adjacency> nextHops = adjacencies.get().getAdjacency(); return nextHops; } return null; }
Adjacencies newAdjs = update.getAugmentation(Adjacencies.class); if (oldAdjs != null) { oldAdjsList = oldAdjs.getAdjacency(); newAdjsList = newAdjs.getAdjacency();
Optional<Adjacencies> optAdjacencies = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, path); if (optAdjacencies.isPresent()) { List<Adjacency> adjacencies = optAdjacencies.get().getAdjacency();
intf.getVpnInstanceName(), rd); if (adjacencies.isPresent()) { List<Adjacency> nextHops = adjacencies.get().getAdjacency();
List<Adjacency> nextHops = adjacencies.get().getAdjacency();
Adjacency adjacency = original.getAugmentation(Adjacencies.class).getAdjacency().get(0); List<Prefixes> prefixToInterfaceList = new ArrayList<>(); Optional<Prefixes> prefixToInterface = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL,
vpnName, rd); if (adjacencies.isPresent()) { List<Adjacency> nextHops = adjacencies.get().getAdjacency();
Adjacency adjacency = del.getAugmentation(Adjacencies.class).getAdjacency().get(0); List<Prefixes> prefixToInterface = new ArrayList<>(); Optional<Prefixes> prefix = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL,
int numAdj = 0; if (optAdjacencies.isPresent()) { numAdj = optAdjacencies.get().getAdjacency().size();
LOG.debug("Updating vpn interface {}", infName); if (!isBeingAssociated) { List<Adjacency> adjacencyList = vpnIfBuilder.getAugmentation(Adjacencies.class).getAdjacency(); Iterator<Adjacency> adjacencyIter = adjacencyList.iterator(); while (adjacencyIter.hasNext()) {
String ip = prefix.getIpv4Address().getValue(); if (adjacencies.isPresent()) { List<Adjacency> adjacencyList = adjacencies.get().getAdjacency(); ip = VpnUtil.getIpPrefix(ip); for (Adjacency adjacs : adjacencyList) {
LOG.trace("adjacencies {}", adjacencies); if (adjacencies.isPresent()) { List<Adjacency> adjacencyList = adjacencies.get().getAdjacency(); Iterator<Adjacency> adjacencyIterator = adjacencyList.iterator();
List<Adjacency> nextHops = adjacencies.get().getAdjacency(); List<Adjacency> value = new ArrayList<>(); long vpnId = VpnUtil.getVpnId(dataBroker, vpnName); for (Adjacency nextHop : aug.getAdjacency()) { long label = nextHop.getLabel(); if (rd != null) {
protected void addNewAdjToVpnInterface(InstanceIdentifier<VpnInterface> identifier, Adjacency adj, BigInteger dpnId) { Optional<VpnInterface> optVpnInterface = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, identifier); if (optVpnInterface.isPresent()) { VpnInterface currVpnIntf = optVpnInterface.get(); String prefix = VpnUtil.getIpPrefix(adj.getIpAddress()); String rd = getRouteDistinguisher(currVpnIntf.getVpnInstanceName()); rd = (rd != null) ? rd : currVpnIntf.getVpnInstanceName(); InstanceIdentifier<Adjacencies> adjPath = identifier.augmentation(Adjacencies.class); Optional<Adjacencies> optAdjacencies = VpnUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL, adjPath); long label = VpnUtil.getUniqueId(idManager, VpnConstants.VPN_IDPOOL_NAME, VpnUtil.getNextHopLabelKey(rd, prefix)); List<Adjacency> adjacencies; if (optAdjacencies.isPresent()) { adjacencies = optAdjacencies.get().getAdjacency(); } else { //This code will not be hit since VM adjacency will always be there adjacencies = new ArrayList<>(); } adjacencies.add(new AdjacencyBuilder(adj).setLabel(label).setNextHopIpList(adj.getNextHopIpList()) .setIpAddress(prefix).setKey(new AdjacencyKey(prefix)).build()); Adjacencies aug = VpnUtil.getVpnInterfaceAugmentation(adjacencies); VpnInterface newVpnIntf = VpnUtil.getVpnInterface(currVpnIntf.getName(), currVpnIntf.getVpnInstanceName(), aug, dpnId, currVpnIntf.isScheduledForRemove()); VpnUtil.syncUpdate(dataBroker, LogicalDatastoreType.OPERATIONAL, identifier, newVpnIntf); for (String nh : adj.getNextHopIpList()) { addExtraRoute(adj.getIpAddress(), nh, rd, currVpnIntf.getVpnInstanceName(), (int) label, currVpnIntf.getName()); } } }