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;
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; }
for (DeviceNodes device : devices) { @SuppressWarnings("unchecked") InstanceIdentifier<Node> devIid = (InstanceIdentifier<Node>) device.getDeviceRef().getValue(); CheckedFuture<Optional<FabricCapableDevice>,ReadFailedException> future = rt.read(LogicalDatastoreType.OPERATIONAL, devIid.augmentation(FabricCapableDevice.class));
private void buildNodeAttribute(NodeBuilder builder, ComposeFabricInput input, FabricId fabricId) { builder.setKey(new NodeKey(fabricId)); List<DeviceNodes> devices = input.getDeviceNodes(); if (devices != null) { List<SupportingNode> snodes = Lists.newArrayList(); for (DeviceNodes device : devices) { InstanceIdentifier<?> nodeRef = device.getDeviceRef().getValue(); NodeId nodeid = nodeRef.firstKeyOf(Node.class).getNodeId(); TopologyId topoId = nodeRef.firstKeyOf(Topology.class).getTopologyId(); SupportingNodeBuilder snodeBuilder = new SupportingNodeBuilder(); snodeBuilder.setNodeRef(nodeid); snodeBuilder.setTopologyRef(topoId); snodeBuilder.setKey(new SupportingNodeKey(nodeid, topoId)); snodes.add(snodeBuilder.build()); } builder.setSupportingNode(snodes); } }
@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); }