import java.util.concurrent.CompletionStage;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+import org.opendaylight.yangtools.yang.common.Empty;
import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateTip;
import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModification;
}
@Override
- public void canCommit(final FutureCallback<Void> newCallback) {
+ public void canCommit(final FutureCallback<Empty> newCallback) {
if (state == State.CAN_COMMIT_PENDING) {
return;
}
}
@Override
- public void abort(final FutureCallback<Void> abortCallback) {
+ public void abort(final FutureCallback<Empty> abortCallback) {
if (!dataTree.startAbort(this)) {
- abortCallback.onSuccess(null);
+ abortCallback.onSuccess(Empty.value());
return;
}
final Optional<CompletionStage<?>> maybeAborts = userCohorts.abort();
if (!maybeAborts.isPresent()) {
- abortCallback.onSuccess(null);
+ abortCallback.onSuccess(Empty.value());
return;
}
if (failure != null) {
abortCallback.onFailure(failure);
} else {
- abortCallback.onSuccess(null);
+ abortCallback.onSuccess(Empty.value());
}
});
}
}
void successfulCanCommit() {
- switchState(State.CAN_COMMIT_COMPLETE).onSuccess(null);
+ switchState(State.CAN_COMMIT_COMPLETE).onSuccess(Empty.value());
}
void failedCanCommit(final Exception cause) {
* @param dataTreeCandidate {@link DataTreeCandidate} under consideration
* @param futureCallback the callback to invoke on completion, which may be immediate or async.
*/
- void userPreCommit(final DataTreeCandidate dataTreeCandidate, final FutureCallback<Void> futureCallback) {
+ void userPreCommit(final DataTreeCandidate dataTreeCandidate, final FutureCallback<Empty> futureCallback) {
userCohorts.reset();
- final Optional<CompletionStage<Void>> maybeCanCommitFuture = userCohorts.canCommit(dataTreeCandidate);
+ final Optional<CompletionStage<Empty>> maybeCanCommitFuture = userCohorts.canCommit(dataTreeCandidate);
if (!maybeCanCommitFuture.isPresent()) {
doUserPreCommit(futureCallback);
return;
});
}
- private void doUserPreCommit(final FutureCallback<Void> futureCallback) {
- final Optional<CompletionStage<Void>> maybePreCommitFuture = userCohorts.preCommit();
+ private void doUserPreCommit(final FutureCallback<Empty> futureCallback) {
+ final Optional<CompletionStage<Empty>> maybePreCommitFuture = userCohorts.preCommit();
if (!maybePreCommitFuture.isPresent()) {
- futureCallback.onSuccess(null);
+ futureCallback.onSuccess(Empty.value());
return;
}
if (failure != null) {
futureCallback.onFailure(failure);
} else {
- futureCallback.onSuccess(null);
+ futureCallback.onSuccess(Empty.value());
}
});
}
}
void successfulCommit(final UnsignedLong journalIndex, final Runnable onComplete) {
- final Optional<CompletionStage<Void>> maybeCommitFuture = userCohorts.commit();
+ final Optional<CompletionStage<Empty>> maybeCommitFuture = userCohorts.commit();
if (!maybeCommitFuture.isPresent()) {
finishSuccessfulCommit(journalIndex, onComplete);
return;