/** * Find the left port. * @param edge - the edge to be searched. * @return the left port. */ public PortMappingInfo findLeftPortOnEdge(Edge edge) { Uuid leftPortId = edge.getLeftPortId(); return this.portStore.get(leftPortId); }
public static void removeEdgeFromDsIfExists(Uuid tenantId, Uuid edgeId) { Optional<Edge> oldOptional = removeIfExists(UlnIidFactory.edgeIid(tenantId, edgeId)); /* * Make sure other logical network nodes links are updated as well */ if (oldOptional.isPresent()) { Edge edge = oldOptional.get(); if (edge.getLeftPortId() != null) { removePortFromDsIfExists(tenantId, edge.getLeftPortId()); } if (edge.getRightPortId() != null) { removePortFromDsIfExists(tenantId, edge.getRightPortId()); } } }
public PortMappingInfo findLrPortOnEdge(EdgeMappingInfo edge) { Uuid leftPortId = edge.getEdge().getLeftPortId(); if (this.isPortLrType(leftPortId)) { return this.portStore.get(leftPortId); } Uuid rightPortId = edge.getEdge().getRightPortId(); if (this.isPortLrType(rightPortId)) { return this.portStore.get(rightPortId); } return null; }
public PortMappingInfo findLswPortOnEdge(EdgeMappingInfo edge) { Uuid leftPortId = edge.getEdge().getLeftPortId(); if (this.isPortLswType(leftPortId)) { return this.portStore.get(leftPortId); } Uuid rightPortId = edge.getEdge().getRightPortId(); if (this.isPortLswType(rightPortId)) { return this.portStore.get(rightPortId); } return null; }
public PortMappingInfo findSubnetPortInEdge(EdgeMappingInfo edge, Uuid subnetId) { PortMappingInfo subnetPort = null; Uuid leftPortId = edge.getEdge().getLeftPortId(); Uuid rightPortId = edge.getEdge().getRightPortId(); if (this.isPortInSubnet(leftPortId, subnetId) == true) { subnetPort = this.portStore.get(leftPortId); } else if (this.isPortInSubnet(rightPortId, subnetId) == true) { subnetPort = this.portStore.get(rightPortId); } return subnetPort; }
public PortMappingInfo findSubnetPortOnEdge(EdgeMappingInfo edge) { Uuid leftPortId = edge.getEdge().getLeftPortId(); if (this.isPortSubnetType(leftPortId) == true) { return this.portStore.get(leftPortId); } Uuid rightPortId = edge.getEdge().getRightPortId(); if (this.isPortSubnetType(rightPortId) == true) { return this.portStore.get(rightPortId); } return null; }
return false; if (!Objects.equals(_leftPortId, other.getLeftPortId())) { return false;
EdgeMappingInfo info = entry.getValue(); sb.append("edgeId=" + entry.getKey().getValue() + ", type=" + this.findEdgeType(info).toString()); sb.append(", leftPort=" + info.getEdge().getLeftPortId().getValue()); sb.append(", rightPort=" + info.getEdge().getRightPortId().getValue()); sb.append(", isRendered=" + info.hasServiceBeenRendered() + "\n");
/** * Given an edge and one port, find the other port. * @param epEdge - the edge. * @param epPortId - one known port. * @return the other port. */ public PortMappingInfo findOtherPortInEdge(EdgeMappingInfo epEdge, Uuid epPortId) { Uuid leftPortId = epEdge.getEdge().getLeftPortId(); Uuid rightPortId = epEdge.getEdge().getRightPortId(); Uuid otherPortId; if (leftPortId.equals(epPortId)) { otherPortId = rightPortId; } else if (rightPortId.equals(epPortId)) { otherPortId = leftPortId; } else { LOG.error("FABMGR: ERROR: findOtherPortInEdge: port id is wrong: ep={}, left={}, right={}", epPortId.getValue(), leftPortId.getValue(), rightPortId.getValue()); return null; } return this.portStore.get(otherPortId); }
this._leftPortId = base.getLeftPortId(); this._name = base.getName(); this._qosAttributes = base.getQosAttributes();
public static void submitEdgeToDs(Edge edge) { if (edge.getLeftPortId() == null || edge.getRightPortId() == null) { LOG.error("Trying to Subnit an edge Edge with less than two ports -- Ignored Request"); return; } Port lport = UlnDatastoreApi.readPortFromDs(edge.getTenantId(), edge.getLeftPortId()); if (lport != null && lport.getEdgeId() != null && !edge.getUuid().equals(lport.getEdgeId())) { LOG.error( "Trying to Submit Edge {} that references Port {}, but that Port already references Edge {}. Ignored Request.", edge.getUuid().getValue(), lport.getUuid().getValue(), lport.getEdgeId().getValue()); return; } Port rport = UlnDatastoreApi.readPortFromDs(edge.getTenantId(), edge.getRightPortId()); if (rport != null && rport.getEdgeId() != null && !edge.getUuid().equals(rport.getEdgeId())) { LOG.error( "Trying to Submit Edge {} that references Port {}, but that Port already references Edge {}. Ignored Request.", edge.getUuid().getValue(), rport.getUuid().getValue(), rport.getEdgeId().getValue()); return; } WriteTransaction t = UlnMapperDatastoreDependency.getDataProvider().newWriteOnlyTransaction(); t.put(logicalDatastoreType, UlnIidFactory.edgeIid(edge.getTenantId(), edge.getUuid()), edge, true); if (submitToDs(t)) { LOG.debug("Wrote logical edge {} to datastore.", edge.getUuid().getValue()); } else { LOG.error("Failed to write logical edge {} to datastore.", edge.getUuid().getValue()); } }
Edge edge = UlnDatastoreApi.readEdgeFromDs(updatedPort.getTenantId(), updatedPort.getEdgeId()); if (edge != null) { if (!updatedPort.getEdgeId().equals(edge.getLeftPortId()) && !updatedPort.getEdgeId().equals(edge.getRightPortId())) { PortBuilder builder = new PortBuilder(updatedPort);
public LogicalEdgeType findEdgeType(EdgeMappingInfo edge) { LogicalEdgeType edgeType = LogicalEdgeType.UNKNOWNTYPE; Uuid leftPortId = edge.getEdge().getLeftPortId(); Uuid rightPortId = edge.getEdge().getRightPortId(); if (this.isPortLrType(leftPortId) && this.isPortLrType(rightPortId)) { edgeType = LogicalEdgeType.LR_LR; } else if (this.isPortLswType(leftPortId) && this.isPortLswType(rightPortId)) { edgeType = LogicalEdgeType.LSW_LSW; } else if (this.isPortLswType(leftPortId) && this.isPortLrType(rightPortId) || this.isPortLrType(leftPortId) && this.isPortLswType(rightPortId)) { edgeType = LogicalEdgeType.LR_LSW; } else if (this.isPortLswType(leftPortId) && this.isPortSubnetType(rightPortId) || this.isPortSubnetType(leftPortId) && this.isPortLswType(rightPortId)) { edgeType = LogicalEdgeType.LSW_SUBNET; } else if (this.isPortSubnetType(leftPortId) && this.isPortEpLocationType(rightPortId) || this.isPortEpLocationType(leftPortId) && this.isPortSubnetType(rightPortId)) { edgeType = LogicalEdgeType.SUBNET_EPLOCATION; } else { LOG.trace("FABMGR: findEdgeType: unknown type: leftPortId={}, rightPortId={}", leftPortId.getValue(), rightPortId.getValue()); } return edgeType; }