public Streams build() { return new StreamsImpl(this); }
@Override public synchronized Streams getNotificationPublishers() { return new StreamsBuilder().setStream(Lists.newArrayList(streamMetadata.values())).build(); }
public StreamsBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
public StreamsBuilder(Streams base) { this._stream = base.getStream(); if (base instanceof StreamsImpl) { StreamsImpl impl = (StreamsImpl) 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.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (!Objects.equals(_stream, other.getStream())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
private StreamsImpl(StreamsBuilder base) { this._stream = base.getStream(); 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.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>>, Augmentation<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.Streams>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
@Override public Document handle(final Document requestMessage, final NetconfOperationChainedExecution subsequentOperation) throws NetconfDocumentedException { final Document partialResponse = subsequentOperation.execute(requestMessage); final Streams availableStreams = notificationRegistry.getNotificationPublishers(); if(availableStreams.getStream().isEmpty() == false) { serializeStreamsSubtree(partialResponse, availableStreams); } return partialResponse; }
/** * Returns list of streams avaliable on device * @return list of streams * @throws ReadFailedException if data read fails */ List<Stream> getAvailableStreams() throws ReadFailedException { DOMDataReadOnlyTransaction tx = dataBroker.newReadOnlyTransaction(); CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> checkFeature = tx .read(LogicalDatastoreType.OPERATIONAL, STREAMS_PATH); Optional<NormalizedNode<?, ?>> streams = checkFeature.checkedGet(); if (streams.isPresent()) { Streams s = (Streams) CODEC_REGISTRY.fromNormalizedNode(STREAMS_PATH, streams.get()).getValue(); return s.getStream(); } return Collections.emptyList(); }