public AddAclInputBuilder(AddAclInput base) { this._aclName = base.getAclName(); this._fabricId = base.getFabricId(); this._logicalDevice = base.getLogicalDevice(); this._logicalPort = base.getLogicalPort(); if (base instanceof AddAclInputImpl) { AddAclInputImpl impl = (AddAclInputImpl) 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.AddAclInput> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
return false; if (!Objects.equals(_fabricId, other.getFabricId())) { return false;
@Override public Future<RpcResult<Void>> addAcl(AddAclInput input) { String aclName = input.getAclName(); FabricId fabricId = input.getFabricId(); NodeId ldev = input.getLogicalDevice(); TpId tpId = input.getLogicalPort(); 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<FabricAcl> aclIId = fabricObj.addAcl(ldev, tpId, aclName); if (aclIId == null) { return Futures.immediateFailedFuture( new IllegalArgumentException("Can not add acl, maybe the target is not exists !")); } FabricAclBuilder aclBuilder = new FabricAclBuilder(); aclBuilder.setFabricAclName(aclName); aclBuilder.setKey(new FabricAclKey(aclName)); WriteTransaction trans = dataBroker.newWriteOnlyTransaction(); trans.merge(LogicalDatastoreType.OPERATIONAL,aclIId, aclBuilder.build(), false); return Futures.transform(trans.submit(), new AsyncFunction<Void, RpcResult<Void>>() { @Override public ListenableFuture<RpcResult<Void>> apply(Void submitResult) throws Exception { fabricObj.notifyAclUpdated(aclIId, false); return Futures.immediateFuture(RpcResultBuilder.<Void>success().build()); } }, executor); }