+ * write {@link Streams} data to operational device datastore.
+ *
+ * @return result {@link Boolean}
+ */
+ public boolean writeNetconfStream() {
+ Boolean result = false;
+ LOG.info("writting netconf stream to oper datastore");
+ Streams streams = this.netconfConfiguration.getNetconfStreamsData();
+ if (streams != null) {
+ LOG.info("Netconf Data gets from xml file is present");
+ InstanceIdentifier<Streams> iid = InstanceIdentifier.create(Netconf.class).child(Streams.class);
+ Streams netconfStreams = new StreamsBuilder(streams).build();
+ WriteTransaction writeTx = this.dataBroker.newWriteOnlyTransaction();
+ if (writeTx != null) {
+ LOG.info("WriteTransaction is ok");
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, iid, netconfStreams);
+ Future<Void> future = writeTx.submit();
+ try {
+ Futures.getChecked(future, ExecutionException.class);
+ LOG.info("netconf stream writed to oper datastore");
+ result = true;
+ } catch (ExecutionException e) {
+ LOG.error("Failed to write netconf stream to oper datastore");
+ }
+ } else {
+ LOG.error("WriteTransaction object is null");
+ }
+ } else {
+ LOG.error("Netconf data gets from xml file is null !");
+ }
+ return result;
+ }
+
+ /**
+ * Write {@link NetconfState} data to operational device datastore.