public LocationBuilder(Location base) { this._accessSegment = base.getAccessSegment(); this._accessType = base.getAccessType(); this._nodeRef = base.getNodeRef(); this._tpRef = base.getTpRef(); if (base instanceof LocationImpl) { LocationImpl impl = (LocationImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.endpoint.rev150930.endpoint.attributes.Location>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
return false; if (!Objects.equals(_nodeRef, other.getNodeRef())) { return false;
@SuppressWarnings("unchecked") public void createEpAccessPort(WriteTransaction trans, Endpoint ep, InstanceIdentifier<BdPort> bdPortIid) throws Exception { if (!calcLogicPortIId(ep)) { return; } InstanceIdentifier<Node> devNode = (InstanceIdentifier<Node>) ep.getLocation().getNodeRef().getValue(); Optional<TerminationPoint> optional = readTp(); InstanceIdentifier<UnderlayerPorts> iid = lportIid.augmentation(LogicalPortAugment.class) .child(LportAttribute.class) .child(UnderlayerPorts.class, new UnderlayerPortsKey(bdPortIid)); UnderlayerPortsBuilder builder = new UnderlayerPortsBuilder(); builder.setPortRef(bdPortIid); trans.put(LogicalDatastoreType.OPERATIONAL, iid, builder.build()); if (optional.isPresent()) { LogicalPortAugment lpAug = optional.get().getAugmentation(LogicalPortAugment.class); if (lpAug != null) { LportAttribute lattr = lpAug.getLportAttribute(); List<FabricAcl> acls = lattr.getFabricAcl(); if (acls != null && acls.isEmpty()) { cpAcls(acls, bdPortIid, trans); } } } }
private void rendererEndpoint(Endpoint ep) throws Exception { // 1, create bridge domain port NodeId logicNode = ep.getLogicalLocation().getNodeId(); LogicSwitchContext switchCtx = fabricCtx.getLogicSwitchCtx(logicNode); if (switchCtx == null) { LOG.warn("There are no such switch's context.({})", logicNode.getValue()); return; } final int vlan = switchCtx.getVlan(); TpId destTpPort = ep.getLocation().getTpRef().getValue().firstKeyOf(TerminationPoint.class).getTpId(); InstanceIdentifier<Node> devIid = (InstanceIdentifier<Node>) ep.getLocation().getNodeRef().getValue(); DeviceContext devCtx = fabricCtx.getDeviceCtx(DeviceKey.newInstance(devIid)); String bdPortId = devCtx.createBdPort(vlan, destTpPort, ep.getLocation().getAccessType(), ep.getLocation().getAccessSegment()); InstanceIdentifier<BdPort> bdPortIid = devIid.augmentation(FabricCapableDevice.class) .child(Config.class).child(BdPort.class, new BdPortKey(bdPortId)); // 2, use bridge domain port to renderer logic port WriteTransaction trans = databroker.newWriteOnlyTransaction(); EpAccessPortRenderer portRender = EpAccessPortRenderer.newRenderer(databroker); portRender.createEpAccessPort(trans, ep, bdPortIid); MdSalUtils.wrapperSubmit(trans); } }