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()); } } }
if (!Objects.equals(_accessSegment, other.getAccessSegment())) { return false;
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); } }