当前位置: 首页>>代码示例>>Java>>正文


Java ReadDataReply类代码示例

本文整理汇总了Java中org.opendaylight.controller.cluster.datastore.messages.ReadDataReply的典型用法代码示例。如果您正苦于以下问题:Java ReadDataReply类的具体用法?Java ReadDataReply怎么用?Java ReadDataReply使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReadDataReply类属于org.opendaylight.controller.cluster.datastore.messages包,在下文中一共展示了ReadDataReply类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testOnReceiveReadData

import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; //导入依赖的package包/类
@Test
public void testOnReceiveReadData() throws Exception {
    new JavaTestKit(getSystem()) {
        {
            testOnReceiveReadData(newTransactionActor(RO, readOnlyTransaction(), "testReadDataRO"));

            testOnReceiveReadData(newTransactionActor(RW, readWriteTransaction(), "testReadDataRW"));
        }

        private void testOnReceiveReadData(final ActorRef transaction) {
            transaction.tell(new ReadData(YangInstanceIdentifier.EMPTY, DataStoreVersions.CURRENT_VERSION),
                    getRef());

            ReadDataReply reply = expectMsgClass(duration("5 seconds"), ReadDataReply.class);

            assertNotNull(reply.getNormalizedNode());
        }
    };
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:ShardTransactionTest.java

示例2: testOnReceiveReadDataWhenDataNotFound

import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; //导入依赖的package包/类
@Test
public void testOnReceiveReadDataWhenDataNotFound() throws Exception {
    new JavaTestKit(getSystem()) {
        {
            testOnReceiveReadDataWhenDataNotFound(
                    newTransactionActor(RO, readOnlyTransaction(), "testReadDataWhenDataNotFoundRO"));

            testOnReceiveReadDataWhenDataNotFound(
                    newTransactionActor(RW, readWriteTransaction(), "testReadDataWhenDataNotFoundRW"));
        }

        private void testOnReceiveReadDataWhenDataNotFound(final ActorRef transaction) {
            transaction.tell(new ReadData(TestModel.TEST_PATH, DataStoreVersions.CURRENT_VERSION), getRef());

            ReadDataReply reply = expectMsgClass(duration("5 seconds"), ReadDataReply.class);

            assertTrue(reply.getNormalizedNode() == null);
        }
    };
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:ShardTransactionTest.java

示例3: readData

import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; //导入依赖的package包/类
protected void readData(final AbstractShardDataTreeTransaction<?> transaction, final ReadData message) {
    if (checkClosed(transaction)) {
        return;
    }

    final YangInstanceIdentifier path = message.getPath();
    Optional<NormalizedNode<?, ?>> optional = transaction.getSnapshot().readNode(path);
    ReadDataReply readDataReply = new ReadDataReply(optional.orNull(), message.getVersion());
    sender().tell(readDataReply.toSerializable(), self());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:ShardTransaction.java

示例4: readDataReply

import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; //导入依赖的package包/类
protected Future<ReadDataReply> readDataReply(final NormalizedNode<?, ?> data) {
    return Futures.successful(new ReadDataReply(data, DataStoreVersions.CURRENT_VERSION));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:AbstractTransactionProxyTest.java

示例5: testBatchedModificationsOnTransactionChain

import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply; //导入依赖的package包/类
@Test
public void testBatchedModificationsOnTransactionChain() throws Exception {
    new ShardTestKit(getSystem()) {
        {
            final TestActorRef<Shard> shard = actorFactory.createTestActor(
                    newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()),
                    "testBatchedModificationsOnTransactionChain");

            waitUntilLeader(shard);

            final LocalHistoryIdentifier historyId = nextHistoryId();
            final TransactionIdentifier transactionID1 = new TransactionIdentifier(historyId, 0);
            final TransactionIdentifier transactionID2 = new TransactionIdentifier(historyId, 1);

            final FiniteDuration duration = duration("5 seconds");

            // Send a BatchedModifications to start a chained write
            // transaction and ready it.

            final ContainerNode containerNode = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
            final YangInstanceIdentifier path = TestModel.TEST_PATH;
            shard.tell(newBatchedModifications(transactionID1, path, containerNode, true, false, 1), getRef());
            expectMsgClass(duration, ReadyTransactionReply.class);

            // Create a read Tx on the same chain.

            shard.tell(new CreateTransaction(transactionID2, TransactionType.READ_ONLY.ordinal(),
                    DataStoreVersions.CURRENT_VERSION).toSerializable(), getRef());

            final CreateTransactionReply createReply = expectMsgClass(duration("3 seconds"),
                    CreateTransactionReply.class);

            getSystem().actorSelection(createReply.getTransactionPath())
                    .tell(new ReadData(path, DataStoreVersions.CURRENT_VERSION), getRef());
            final ReadDataReply readReply = expectMsgClass(duration("3 seconds"), ReadDataReply.class);
            assertEquals("Read node", containerNode, readReply.getNormalizedNode());

            // Commit the write transaction.

            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
            final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply
                    .fromSerializable(expectMsgClass(duration, CanCommitTransactionReply.class));
            assertEquals("Can commit", true, canCommitReply.getCanCommit());

            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
            expectMsgClass(duration, CommitTransactionReply.class);

            // Verify data in the data store.

            final NormalizedNode<?, ?> actualNode = readStore(shard, path);
            assertEquals("Stored node", containerNode, actualNode);
        }
    };
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:55,代码来源:ShardTest.java


注:本文中的org.opendaylight.controller.cluster.datastore.messages.ReadDataReply类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。