本文整理匯總了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));
}
示例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());
}
};
}
示例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());
}
};
}
示例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());
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例9: dataExists
import org.opendaylight.controller.cluster.datastore.messages.DataExists; //導入依賴的package包/類
protected final void dataExists(DataExists message) {
super.dataExists(transaction, message);
}
示例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));
}