- @Override public Object toSerializable() {
- return ShardTransactionMessages.DataExists.newBuilder()
- .setInstanceIdentifierPathArguments(
- InstanceIdentifierUtils.toSerializable(path)).build();
+ @Override
+ public void processResponse(Object response, SettableFuture<Boolean> returnFuture) {
+ if(DataExistsReply.isSerializedType(response)) {
+ returnFuture.set(Boolean.valueOf(DataExistsReply.fromSerializable(response).exists()));
+ } else {
+ returnFuture.setException(new ReadFailedException("Invalid response checking exists for path " + getPath()));
+ }
+ }
+
+ @Override
+ protected AbstractRead<Boolean> newInstance(short withVersion) {
+ return new DataExists(getPath(), withVersion);