@Override public <T extends DataObject> void put(final LogicalDatastoreType store, final InstanceIdentifier<T> path, final T data) { delegate.put(store, path, data); }
@Override @Deprecated public <T extends DataObject> void put(final LogicalDatastoreType store, final InstanceIdentifier<T> path, final T data, final boolean createMissingParents) { delegate.put(store, path, data, createMissingParents); }
@Override @Deprecated public final <T extends DataObject> void put(final InstanceIdentifier<T> path, final T data, final boolean createMissingParents) { delegate().put(getDatastoreType(), path, data, createMissingParents); postOperation(); }
private void setToasterStatusUp(final Function<Boolean, MakeToastOutput> resultCallback) { WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.put(OPERATIONAL,TOASTER_IID, buildToaster(ToasterStatus.Up)); Futures.addCallback(tx.commit(), new FutureCallback<CommitInfo>() { @Override public void onSuccess(final CommitInfo result) { LOG.info("Successfully set ToasterStatus to Up"); notifyCallback(true); } @Override public void onFailure(final Throwable failure) { // We shouldn't get an OptimisticLockFailedException (or any ex) as no // other component should be updating the operational state. LOG.error("Failed to update toaster status", failure); notifyCallback(false); } void notifyCallback(final boolean result) { if (resultCallback != null) { resultCallback.apply(result); } } }, MoreExecutors.directExecutor()); }
@Override public final <T extends DataObject> void put(final InstanceIdentifier<T> path, final T data) { delegate().put(getDatastoreType(), path, data); postOperation(); }
private void cleanupTestStore() { TestExec data = new TestExecBuilder() .setOuterList(Collections.<OuterList>emptyList()) .build(); WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data); try { tx.commit().get(); LOG.debug("DataStore config test data cleaned up"); } catch (final InterruptedException | ExecutionException e) { LOG.info("Failed to cleanup DataStore configtest data"); throw new IllegalStateException(e); } tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data); try { tx.commit().get(); LOG.debug("DataStore operational test data cleaned up"); } catch (final InterruptedException | ExecutionException e) { LOG.info("Failed to cleanup DataStore operational test data"); throw new IllegalStateException(e); } }
private void setTestOperData(final ExecStatus sts, final long tstCompl) { TestStatus status = new TestStatusBuilder() .setExecStatus(sts) .setTestsCompleted(tstCompl) .build(); WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status); try { tx.commit().get(); } catch (final InterruptedException | ExecutionException e) { throw new IllegalStateException(e); } LOG.debug("DataStore test oper status populated: {}", status); }
.child(OuterList.class, element.key()); if (oper == StartTestInput.Operation.PUT) { tx.put(dsType, iid, element); } else { tx.merge(dsType, iid, element);
tx.put(dsType, iid, element); } else { tx.merge(dsType, iid, element);