public DeviceNodes build() { return new DeviceNodesImpl(this); }
public Options build() { return new OptionsImpl(this); }
public DeviceLinks build() { return new DeviceLinksImpl(this); }
private List<DeviceNodes> getDeviceNodesInput(List<DeviceNodes> input) { if (input == null) { return null; } List<DeviceNodes> ret = Lists.newArrayList(); for (DeviceNodes node : input) { DeviceNodesBuilder builder = new DeviceNodesBuilder(); builder.setDeviceRef(node.getDeviceRef()); builder.setKey(node.getKey()); builder.setRole(node.getRole()); ret.add(builder.build()); } return ret; }
public DeviceNodesBuilder(DeviceNodes base) { if (base.getKey() == null) { this._key = new DeviceNodesKey( base.getDeviceRef() ); this._deviceRef = base.getDeviceRef(); } else { this._key = base.getKey(); this._deviceRef = _key.getDeviceRef(); } this._role = base.getRole(); if (base instanceof DeviceNodesImpl) { DeviceNodesImpl impl = (DeviceNodesImpl) 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.rev150930.fabric.attributes.DeviceNodes> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_deviceRef, other.getDeviceRef())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_role, other.getRole())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
@Override public void fabricCreated(FabricNode fabric) { List<DeviceLinks> links = fabric.getFabricAttribute().getDeviceLinks(); if (links != null) { for (DeviceLinks link : links) { @SuppressWarnings("unchecked") InstanceIdentifier<Link> linkIId = (InstanceIdentifier<Link>) link.getLinkRef().getValue(); } } List<DeviceNodes> devices = fabric.getFabricAttribute().getDeviceNodes(); if (devices != null) { for (DeviceNodes deviceNode : devices) { @SuppressWarnings("unchecked") InstanceIdentifier<Node> deviceIId = (InstanceIdentifier<Node>) deviceNode.getDeviceRef().getValue(); DeviceRole role = deviceNode.getRole(); deviceAdded(deviceIId, role); } } ResourceManager.initResourceManager(fabricid); }
public DeviceLinksBuilder(DeviceLinks base) { if (base.getKey() == null) { this._key = new DeviceLinksKey( base.getLinkRef() ); this._linkRef = base.getLinkRef(); } else { this._key = base.getKey(); this._linkRef = _key.getLinkRef(); } if (base instanceof DeviceLinksImpl) { DeviceLinksImpl impl = (DeviceLinksImpl) 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.rev150930.fabric.attributes.DeviceLinks> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private DeviceNodesImpl(DeviceNodesBuilder base) { if (base.getKey() == null) { this._key = new DeviceNodesKey( base.getDeviceRef() ); this._deviceRef = base.getDeviceRef(); } else { this._key = base.getKey(); this._deviceRef = _key.getDeviceRef(); } this._role = base.getRole(); 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.rev150930.fabric.attributes.DeviceNodes>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
.child(DeviceLinks.class, new DeviceLinksKey(link)); DeviceLinksBuilder linkBuilder = new DeviceLinksBuilder(); linkBuilder.setKey(new DeviceLinksKey(link)).setLinkRef(link).build(); trans.put(LogicalDatastoreType.OPERATIONAL, path, linkBuilder.build(), false);
private DeviceLinksImpl(DeviceLinksBuilder base) { if (base.getKey() == null) { this._key = new DeviceLinksKey( base.getLinkRef() ); this._linkRef = base.getLinkRef(); } else { this._key = base.getKey(); this._linkRef = _key.getLinkRef(); } 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.rev150930.fabric.attributes.DeviceLinks>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
if (!Objects.equals(_capabilitySupported, other.getCapabilitySupported())) { return false; if (!Objects.equals(_gatewayMode, other.getGatewayMode())) { return false; if (!Objects.equals(_trafficBehavior, other.getTrafficBehavior())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
public OptionsBuilder(Options base) { this._capabilitySupported = base.getCapabilitySupported(); this._gatewayMode = base.getGatewayMode(); this._trafficBehavior = base.getTrafficBehavior(); if (base instanceof OptionsImpl) { OptionsImpl impl = (OptionsImpl) 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.rev150930.fabric.attributes.Options> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_linkRef, other.getLinkRef())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
private OptionsImpl(OptionsBuilder base) { this._capabilitySupported = base.getCapabilitySupported(); this._gatewayMode = base.getGatewayMode(); this._trafficBehavior = base.getTrafficBehavior(); 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.rev150930.fabric.attributes.Options>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
@Override public boolean addNodeToFabric(DeviceNodesBuilder node, AddNodeToFabricInput input) { node.setRole(input.getRole()); return true; }
@Override public Future<RpcResult<Void>> rmLinkFromFabric(RmLinkFromFabricInput input) { final RpcResult<Void> result = RpcResultBuilder.<Void>success().build(); FabricId fabricId = input.getFabricId(); LinkRef link = input.getLinkRef(); InstanceIdentifier<DeviceLinks> devicepath = Constants.DOM_FABRICS_PATH .child(Node.class, new NodeKey(fabricId)).augmentation(FabricNode.class) .child(FabricAttribute.class) .child(DeviceLinks.class, new DeviceLinksKey(link)); WriteTransaction trans = dataBroker.newWriteOnlyTransaction(); trans.delete(LogicalDatastoreType.OPERATIONAL, devicepath); CheckedFuture<Void,TransactionCommitFailedException> future = trans.submit(); return Futures.transform(future, new AsyncFunction<Void, RpcResult<Void>>() { @Override public ListenableFuture<RpcResult<Void>> apply(Void submitResult) throws Exception { return Futures.immediateFuture(result); } }); }
public DeviceNodesBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceNodes> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public OptionsBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.Options> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public DeviceLinksBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.fabric.rev150930.fabric.attributes.DeviceLinks> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }