import com.google.common.annotations.Beta;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.ListenableFuture;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
/**
* User implementation of steps following can-commit in three phase protocol.
* If no additional visibility into transaction and data being aborted or committed is needed, use
* {@link #NOOP} implementation.
- *
*/
@Beta
public interface PostCanCommitStep extends ThreePhaseCommitStep {
-
/**
* No-op implementation of abort, pre-commit and commit steps.
* This implementation should be used if user logic does only validation of data and does not
}
};
- FluentFuture<PostCanCommitStep> NOOP_SUCCESSFUL_FUTURE = FluentFutures.immediateFluentFuture(NOOP);
+ @NonNull FluentFuture<PostCanCommitStep> NOOP_SUCCESSFUL_FUTURE = FluentFutures.immediateFluentFuture(NOOP);
/**
* Initiates a pre-commit of associated request
* object.
*
* @return Future which is completed once pre-commit phase for this request is finished.
- *
*/
- @Nonnull
- ListenableFuture<? extends PostPreCommitStep> preCommit();
-
+ @NonNull ListenableFuture<? extends PostPreCommitStep> preCommit();
}
package org.opendaylight.mdsal.common.api;
import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
/**
* User implementation of steps following pre-commit from Three-Phase Protocol.
- *
*/
@Beta
public interface PostPreCommitStep extends ThreePhaseCommitStep {
-
/**
* No-op implementation of {@link #abort()} and {@link #commit()} method, which always success
* calls.
}
};
- ListenableFuture<?> NOOP_COMMIT_FUTURE = Futures.immediateFuture(null);
+ @NonNull ListenableFuture<?> NOOP_COMMIT_FUTURE = FluentFutures.immediateNullFluentFuture();
- ListenableFuture<? extends PostPreCommitStep> NOOP_FUTURE = Futures.immediateFuture(NOOP);
+ @NonNull ListenableFuture<? extends PostPreCommitStep> NOOP_FUTURE = FluentFutures.immediateFluentFuture(NOOP);
/**
* Commits cohort transaction.
*
* @return Listenable Future which will complete once commit is finished.
*/
- ListenableFuture<?> commit();
-
+ @NonNull ListenableFuture<?> commit();
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.mdsal.common.api;
import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
/**
* Common interface for implementing three-phase commit steps.
*/
@Beta
public interface ThreePhaseCommitStep {
-
- ListenableFuture<?> NOOP_ABORT_FUTURE = Futures.immediateFuture(null);
+ @NonNull ListenableFuture<?> NOOP_ABORT_FUTURE = FluentFutures.immediateNullFluentFuture();
/**
* Invoked on transaction aborted.
*
* @return ListenableFuture which will complete once abort is completed.
*/
- @Nonnull
- ListenableFuture<?> abort();
+ @NonNull ListenableFuture<?> abort();
}
import static org.junit.Assert.assertEquals;
-import javax.annotation.Nonnull;
import org.junit.Test;
import org.opendaylight.yangtools.concepts.Path;
private final class TestClass implements Path<TestClass> {
@Override
- public boolean contains(@Nonnull final TestClass other) {
+ public boolean contains(final TestClass other) {
return false;
}
}
-}
\ No newline at end of file
+}