Search in sources :

Example 1 with TestExec

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec in project controller by opendaylight.

the class DsbenchmarkProvider method cleanupTestStore.

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.submit().checkedGet();
        LOG.debug("DataStore config test data cleaned up");
    } catch (final TransactionCommitFailedException 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.submit().checkedGet();
        LOG.debug("DataStore operational test data cleaned up");
    } catch (final TransactionCommitFailedException e) {
        LOG.info("Failed to cleanup DataStore operational test data");
        throw new IllegalStateException(e);
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) TestExecBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExecBuilder) OuterList(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList) TestExec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec)

Example 2 with TestExec

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec in project controller by opendaylight.

the class DsbenchmarkListener method logDataTreeChangeEvent.

private static synchronized void logDataTreeChangeEvent(final int eventNum, final Collection<DataTreeModification<TestExec>> changes) {
    LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
    for (DataTreeModification<TestExec> change : changes) {
        final DataObjectModification<TestExec> rootNode = change.getRootNode();
        final ModificationType modType = rootNode.getModificationType();
        final PathArgument changeId = rootNode.getIdentifier();
        final Collection<DataObjectModification<? extends DataObject>> modifications = rootNode.getModifiedChildren();
        LOG.debug("    changeId {}, modType {}, mods: {}", changeId, modType, modifications.size());
        for (DataObjectModification<? extends DataObject> mod : modifications) {
            LOG.debug("      mod-getDataAfter: {}", mod.getDataAfter());
        }
    }
}
Also used : DataObject(org.opendaylight.yangtools.yang.binding.DataObject) ModificationType(org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType) DataObjectModification(org.opendaylight.controller.md.sal.binding.api.DataObjectModification) TestExec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec) PathArgument(org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument)

Aggregations

TestExec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExec)2 DataObjectModification (org.opendaylight.controller.md.sal.binding.api.DataObjectModification)1 ModificationType (org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType)1 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)1 TestExecBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestExecBuilder)1 OuterList (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1 PathArgument (org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument)1