private AddAclInputImpl(AddAclInputBuilder base) { this._aclName = base.getAclName(); this._fabricId = base.getFabricId(); this._logicalDevice = base.getLogicalDevice(); this._logicalPort = base.getLogicalPort(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public AddAclInputBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.services.rev150930.AddAclInput> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public void createAcl(String vfabricId, NodeId nodeId, String aclName) { AddAclInputBuilder inputBuilder = new AddAclInputBuilder(); FabricId fabricId = new FabricId(vfabricId); inputBuilder.setFabricId(fabricId); inputBuilder.setAclName(aclName); /* * NOTE: The NodeId must be new'd before passing to RPC. Otherwise, * addAcl() PRC return failure, because Fabric cannot find the logic * device in its Cache map using the nodeId as search key. */ NodeId deviceId = new NodeId(nodeId.getValue()); inputBuilder.setLogicalDevice(deviceId); LOG.debug("FABMGR: createAcl: fabricId={}, deviceId={}, aclName={}", fabricId.getValue(), deviceId.getValue(), aclName); Future<RpcResult<Void>> result = this.fabServiceService.addAcl(inputBuilder.build()); try { RpcResult<Void> output = result.get(); if (output.isSuccessful()) { LOG.debug("FABMGR: createAcl: addAcl RPC success"); } } catch (Exception e) { LOG.error("FABMGR: ERROR: createAcl: addAcl RPC failed.", e); } }