public AddPortFunctionInputBuilder(AddPortFunctionInput base) { this._fabricId = base.getFabricId(); this._logicalDevice = base.getLogicalDevice(); this._logicalPort = base.getLogicalPort(); this._portFunction = base.getPortFunction(); if (base instanceof AddPortFunctionInputImpl) { AddPortFunctionInputImpl impl = (AddPortFunctionInputImpl) 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.services.rev150930.AddPortFunctionInput> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddPortFunctionInput>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_fabricId, other.getFabricId())) { return false; if (!Objects.equals(_logicalDevice, other.getLogicalDevice())) { return false; if (!Objects.equals(_logicalPort, other.getLogicalPort())) { return false; if (!Objects.equals(_portFunction, other.getPortFunction())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
@Override public Future<RpcResult<Void>> addPortFunction(AddPortFunctionInput input) { final PortFunction function = input.getPortFunction(); FabricId fabricId = input.getFabricId(); TpId tpid = input.getLogicalPort(); NodeId ldev = input.getLogicalDevice(); final FabricInstance fabricObj = FabricInstanceCache.INSTANCE.retrieveFabric(fabricId); if (fabricObj == null) { return Futures.immediateFailedFuture( new IllegalArgumentException(String.format("fabric %s does not exist", fabricId))); } final InstanceIdentifier<PortFunction> fncIId = MdSalUtils.createLogicPortIId(fabricId, ldev, tpid) .augmentation(LogicalPortAugment.class) .child(LportAttribute.class) .child(PortFunction.class); WriteTransaction trans = dataBroker.newWriteOnlyTransaction(); trans.merge(LogicalDatastoreType.OPERATIONAL,fncIId, function, false); return Futures.transform(trans.submit(), new AsyncFunction<Void, RpcResult<Void>>() { @Override public ListenableFuture<RpcResult<Void>> apply(Void submitResult) throws Exception { fabricObj.notifyPortFuncUpdated(fncIId, function, false); return Futures.immediateFuture(RpcResultBuilder.<Void>success().build()); } }, executor); }