當前位置: 首頁>>代碼示例>>Java>>正文


Java DataExists類代碼示例

本文整理匯總了Java中org.opendaylight.controller.cluster.datastore.messages.DataExists的典型用法代碼示例。如果您正苦於以下問題:Java DataExists類的具體用法?Java DataExists怎麽用?Java DataExists使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataExists類屬於org.opendaylight.controller.cluster.datastore.messages包,在下文中一共展示了DataExists類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testNegativeExistsWithReadWriteTransactionClosed

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Test(expected = ReadFailedException.class)
public void testNegativeExistsWithReadWriteTransactionClosed() throws Exception {

    final ActorRef shard = createShard();
    final Props props = ShardTransaction.props(RW, STORE.newReadWriteTransaction(nextTransactionId()), shard,
            datastoreContext, shardStats);

    final TestActorRef<ShardTransaction> subject = TestActorRef.create(getSystem(), props,
            "testNegativeExistsWithReadWriteTransactionClosed");

    Future<Object> future = akka.pattern.Patterns.ask(subject,
            new DataExists(YangInstanceIdentifier.EMPTY, DataStoreVersions.CURRENT_VERSION), 3000);
    Await.result(future, Duration.create(3, TimeUnit.SECONDS));

    subject.underlyingActor().getDOMStoreTransaction().abortFromTransactionActor();

    future = akka.pattern.Patterns.ask(subject,
            new DataExists(YangInstanceIdentifier.EMPTY, DataStoreVersions.CURRENT_VERSION), 3000);
    Await.result(future, Duration.create(3, TimeUnit.SECONDS));
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:21,代碼來源:ShardTransactionFailureTest.java

示例2: testOnReceiveDataExistsPositive

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Test
public void testOnReceiveDataExistsPositive() throws Exception {
    new JavaTestKit(getSystem()) {
        {
            testOnReceiveDataExistsPositive(
                    newTransactionActor(RO, readOnlyTransaction(), "testDataExistsPositiveRO"));

            testOnReceiveDataExistsPositive(
                    newTransactionActor(RW, readWriteTransaction(), "testDataExistsPositiveRW"));
        }

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

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

            assertTrue(reply.exists());
        }
    };
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:22,代碼來源:ShardTransactionTest.java

示例3: testOnReceiveDataExistsNegative

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Test
public void testOnReceiveDataExistsNegative() throws Exception {
    new JavaTestKit(getSystem()) {
        {
            testOnReceiveDataExistsNegative(
                    newTransactionActor(RO, readOnlyTransaction(), "testDataExistsNegativeRO"));

            testOnReceiveDataExistsNegative(
                    newTransactionActor(RW, readWriteTransaction(), "testDataExistsNegativeRW"));
        }

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

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

            assertFalse(reply.exists());
        }
    };
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:21,代碼來源:ShardTransactionTest.java

示例4: dataExists

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
protected void dataExists(final AbstractShardDataTreeTransaction<?> transaction, final DataExists message) {
    if (checkClosed(transaction)) {
        return;
    }

    final YangInstanceIdentifier path = message.getPath();
    boolean exists = transaction.getSnapshot().readNode(path).isPresent();
    getSender().tell(new DataExistsReply(exists, message.getVersion()).toSerializable(), getSelf());
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:10,代碼來源:ShardTransaction.java

示例5: handleReceive

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Override
public void handleReceive(Object message) {
    if (ReadData.isSerializedType(message)) {
        readData(ReadData.fromSerializable(message));
    } else if (DataExists.isSerializedType(message)) {
        dataExists((DataExists) message);
    } else {
        super.handleReceive(message);
    }
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:11,代碼來源:ShardReadWriteTransaction.java

示例6: handleReceive

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Override
public void handleReceive(Object message) {
    if (ReadData.isSerializedType(message)) {
        readData(transaction, ReadData.fromSerializable(message));
    } else if (DataExists.isSerializedType(message)) {
        dataExists(transaction, DataExists.fromSerializable(message));
    } else {
        super.handleReceive(message);
    }
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:11,代碼來源:ShardReadTransaction.java

示例7: eqDataExists

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
protected DataExists eqDataExists() {
    ArgumentMatcher<DataExists> matcher = new ArgumentMatcher<DataExists>() {
        @Override
        public boolean matches(final Object argument) {
            return argument instanceof DataExists && ((DataExists)argument).getPath().equals(TestModel.TEST_PATH);
        }
    };

    return argThat(matcher);
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:11,代碼來源:AbstractTransactionProxyTest.java

示例8: testExists

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Test
public void testExists() {
    YangInstanceIdentifier yangInstanceIdentifier = YangInstanceIdentifier.EMPTY;
    doReturn(Futures.immediateCheckedFuture(true)).when(readWriteTransaction).exists(yangInstanceIdentifier);
    localTransactionContext.executeRead(new DataExists(yangInstanceIdentifier, DataStoreVersions.CURRENT_VERSION),
            SettableFuture.<Boolean>create());
    verify(readWriteTransaction).exists(yangInstanceIdentifier);
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:9,代碼來源:LocalTransactionContextTest.java

示例9: dataExists

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
protected final void dataExists(DataExists message) {
    super.dataExists(transaction, message);
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:4,代碼來源:ShardWriteTransaction.java

示例10: exists

import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
@Override
public CheckedFuture<Boolean, ReadFailedException> exists(final YangInstanceIdentifier path) {
    return executeRead(shardNameFromIdentifier(path), new DataExists(path, DataStoreVersions.CURRENT_VERSION));
}
 
開發者ID:hashsdn,項目名稱:hashsdn-controller,代碼行數:5,代碼來源:TransactionProxy.java


注:本文中的org.opendaylight.controller.cluster.datastore.messages.DataExists類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。