public Edge build() { return new EdgeImpl(this); }
/** * Check if an edge object has been cached. * @param edge to be cached. * @return true if found, false otherwise. */ public boolean isEdgeAlreadyCached(Edge edge) { Uuid edgeId = edge.getUuid(); return this.edgeStore.get(edgeId) != null; }
/** * 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()); } } }
/** * Find the right port. * @param edge - the edge to be searched. * @return the right port. */ public PortMappingInfo findRightPortOnEdge(Edge edge) { Uuid rightPortId = edge.getRightPortId(); return this.portStore.get(rightPortId); }
public static InstanceIdentifier<Edge> edgeIid(Uuid tenantId, Uuid edgeId) { return InstanceIdentifier.builder(TenantLogicalNetworks.class) .child(TenantLogicalNetwork.class, new TenantLogicalNetworkKey(tenantId)) .child(Edges.class) .child(Edge.class, new EdgeKey(edgeId)) .build(); }
public EdgeBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.edges.rev151013.edges.container.edges.Edge>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.edges.rev151013.edges.container.edges.Edge> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
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 void removeEdgeFromCache(Edge edge) { this.edgeStore.remove(edge.getUuid()); }
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; }
/** * To mark an edge as rendered. * @param edge rendered object. */ public void markEdgeAsRendered(Edge edge) { Uuid edgeId = edge.getUuid(); this.edgeStore.get(edgeId).setServiceHasBeenRendered(true); }
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; }
public void addRequestRemoveEdge(Edge edge) { Uuid edgeId = edge.getUuid(); EdgeMappingInfo info = this.edgeStore.get(edgeId); if (info == null) { LOG.error("FABMGR: ERROR: removeEdge: info is null"); return; } info.markDeleted(); }
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 boolean isEdgeSubnetToEpLocationType(Edge edge) { EdgeMappingInfo edgeInfo = this.edgeStore.get(edge.getUuid()); if (edgeInfo == null) { // edge should already be cached when this function is called. LOG.error("FABMGR: ERROR: edgeIsSubnetToEpLocationType: edge not in cache: {}", edge.getUuid().getValue()); return false; } if (this.findEdgeType(edgeInfo) == LogicalEdgeType.SUBNET_EPLOCATION) { return true; } return false; }
public boolean isEdgeLrToLrType(Edge edge) { EdgeMappingInfo edgeInfo = this.edgeStore.get(edge.getUuid()); if (edgeInfo == null) { // edge should already be cached when this function is called. LOG.error("FABMGR: ERROR: isEdgeLrToLrType: edge not in cache: {}", edge.getUuid().getValue()); return false; } if (this.findEdgeType(edgeInfo) == LogicalEdgeType.LR_LR) { return true; } return false; }
public boolean isEdgeLswToSubnetType(Edge edge) { EdgeMappingInfo edgeInfo = this.edgeStore.get(edge.getUuid()); if (edgeInfo == null) { // edge should already be cached when this function is called. LOG.error("FABMGR: ERROR: edgeIsLswToSubnetType: edge not in cache: {}", edge.getUuid().getValue()); return false; } if (this.findEdgeType(edgeInfo) == LogicalEdgeType.LSW_SUBNET) { return true; } return false; }
public boolean isEdgeLrToLswType(Edge edge) { EdgeMappingInfo edgeInfo = this.edgeStore.get(edge.getUuid()); if (edgeInfo == null) { // edge should already be cached when this function is called. LOG.error("FABMGR: ERROR: isEdgeLrToLswType: edge not in cache: {}", edge.getUuid().getValue()); return false; } if (this.findEdgeType(edgeInfo) == LogicalEdgeType.LR_LSW) { return true; } return false; }
/** * To cache an edge. * @param edge to be cached. */ public void cacheEdge(Edge edge) { if (!this.isEdgeAlreadyCached(edge)) { this.edgeStore.put(edge.getUuid(), new EdgeMappingInfo(edge)); } }
/** * Check if an Edge has been rendered. * @param edge - the edge to be checked. * @return true if rendered. false otherwise. */ public boolean isEdgeRendered(Edge edge) { if (!this.isEdgeAlreadyCached(edge)) { return false; } return this.edgeStore.get(edge.getUuid()).hasServiceBeenRendered(); }