<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>!javax.annotation,*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
package org.opendaylight.mdsal.binding.api;
import com.google.common.util.concurrent.FluentFuture;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
* Write transaction that provides cursor's with write access to the data tree.
*/
public interface CursorAwareWriteTransaction extends DataTreeCursorProvider {
-
/**
* Create a {@link DataTreeWriteCursor} anchored at the specified path.
* There can only be one cursor open at a time.
* @return write cursor at the desired location.
* @throws IllegalStateException when there's an open cursor, or this transaction is closed already.
*/
- @Nullable
@Override
- <T extends DataObject> DataTreeWriteCursor createCursor(@Nonnull DataTreeIdentifier<T> path);
+ <T extends DataObject> DataTreeWriteCursor createCursor(DataTreeIdentifier<T> path);
/**
* Cancels the transaction.
* 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.binding.api;
import java.util.Collection;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.ChildOf;
import org.opendaylight.yangtools.yang.binding.ChoiceIn;
*
* @return type of modified object.
*/
- @Nonnull Class<T> getDataType();
+ @NonNull Class<T> getDataType();
/**
* Returns type of modification.
*
* @return type Type of performed modification.
*/
- @Nonnull ModificationType getModificationType();
+ @NonNull ModificationType getModificationType();
/**
* Returns before-state of top level container. Implementations are encouraged, but not required
*
* @return unmodifiable collection of modified direct children.
*/
- @Nonnull Collection<? extends DataObjectModification<? extends DataObject>> getModifiedChildren();
+ @NonNull Collection<? extends DataObjectModification<? extends DataObject>> getModifiedChildren();
/**
* Returns child list item modification if {@code child} was modified by this modification.
* to generated model.
*/
<C extends ChildOf<? super T>> Collection<DataObjectModification<C>> getModifiedChildren(
- @Nonnull Class<C> childType);
+ @NonNull Class<C> childType);
/**
* Returns child list item modification if {@code child} was modified by this modification. This method should be
* to generated model.
*/
<H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> Collection<DataObjectModification<C>>
- getModifiedChildren(@Nonnull Class<H> caseType, @Nonnull Class<C> childType);
+ getModifiedChildren(@NonNull Class<H> caseType, @NonNull Class<C> childType);
/**
* Returns container child modification if {@code child} was modified by this modification. This method should be
* @throws IllegalArgumentException If supplied {@code child} class is not valid child according
* to generated model.
*/
- @Nullable <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C>
- getModifiedChildContainer(@Nonnull Class<H> caseType, @Nonnull Class<C> child);
+ <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> @Nullable DataObjectModification<C>
+ getModifiedChildContainer(@NonNull Class<H> caseType, @NonNull Class<C> child);
/**
* Returns container child modification if {@code child} was modified by this
* @throws IllegalArgumentException If supplied {@code child} class is not valid child according
* to generated model.
*/
- @Nullable <C extends ChildOf<? super T>> DataObjectModification<C> getModifiedChildContainer(
- @Nonnull Class<C> child);
+ <C extends ChildOf<? super T>> @Nullable DataObjectModification<C> getModifiedChildContainer(
+ @NonNull Class<C> child);
/**
* Returns augmentation child modification if {@code augmentation} was modified by this modification.
* @throws IllegalArgumentException If supplied {@code augmentation} class is not valid augmentation
* according to generated model.
*/
- @Nullable <C extends Augmentation<T> & DataObject> DataObjectModification<C> getModifiedAugmentation(
- @Nonnull Class<C> augmentation);
+ <C extends Augmentation<T> & DataObject> @Nullable DataObjectModification<C> getModifiedAugmentation(
+ @NonNull Class<C> augmentation);
/**
* Returns child list item modification if {@code child} was modified by this modification.
* to generated model.
*/
<N extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<N>> DataObjectModification<N>
- getModifiedChildListItem(@Nonnull Class<N> listItem, @Nonnull K listKey);
+ getModifiedChildListItem(@NonNull Class<N> listItem, @NonNull K listKey);
/**
* Returns child list item modification if {@code child} was modified by this modification.
* to generated model.
*/
<H extends ChoiceIn<? super T> & DataObject, C extends Identifiable<K> & ChildOf<? super H>,
- K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(@Nonnull Class<H> caseType,
- @Nonnull Class<C> listItem, @Nonnull K listKey);
+ K extends Identifier<C>> @Nullable DataObjectModification<C> getModifiedChildListItem(
+ @NonNull Class<H> caseType, @NonNull Class<C> listItem, @NonNull K listKey);
/**
* Returns a child modification if a node identified by {@code childArgument} was modified by this modification.
* generated model.
*/
@Nullable DataObjectModification<? extends DataObject> getModifiedChild(PathArgument childArgument);
-
}
import java.util.Collection;
import java.util.EventListener;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
*
* @param changes Collection of change events, may not be null or empty.
*/
- void onDataTreeChanged(@Nonnull Collection<DataTreeModification<T>> changes);
+ void onDataTreeChanged(@NonNull Collection<DataTreeModification<T>> changes);
}
*/
package org.opendaylight.mdsal.binding.api;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
* your listener using {@link ListenerRegistration#close()} to stop
* delivery of change events.
*/
- @Nonnull <T extends DataObject,L extends DataTreeChangeListener<T>> ListenerRegistration<L>
- registerDataTreeChangeListener(@Nonnull DataTreeIdentifier<T> treeId, @Nonnull L listener);
+ <T extends DataObject, L extends DataTreeChangeListener<T>> @NonNull ListenerRegistration<L>
+ registerDataTreeChangeListener(@NonNull DataTreeIdentifier<T> treeId, @NonNull L listener);
}
\ No newline at end of file
* 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.binding.api;
import com.google.common.annotations.Beta;
import com.google.common.util.concurrent.FluentFuture;
import java.util.Collection;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.DataValidationFailedException;
import org.opendaylight.mdsal.common.api.PostCanCommitStep;
import org.opendaylight.yangtools.yang.binding.DataObject;
* TODO: Provide example and describe more usage patterns
*
* @author Tony Tkacik <ttkacik@cisco.com>
- *
*/
@Beta
public interface DataTreeCommitCohort<T extends DataObject> {
-
/**
* Validates the supplied data tree modifications and associates the cohort-specific steps with data broker
* transaction.
* more specific subclasses of this exception to provide additional information about
* validation failure reason.
*/
- FluentFuture<PostCanCommitStep> canCommit(@Nonnull Object txId,
- @Nonnull Collection<DataTreeModification<T>> modifications);
-
+ FluentFuture<PostCanCommitStep> canCommit(@NonNull Object txId,
+ @NonNull Collection<DataTreeModification<T>> modifications);
}
* 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.binding.api;
import com.google.common.annotations.Beta;
-import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
-
/**
- * A cursor holding a logical position within a conceptual data tree. It allows operations relative
- * to that position, as well as moving the position up or down the tree.
+ * A cursor holding a logical position within a conceptual data tree. It allows operations relative to that position,
+ * as well as moving the position up or down the tree.
*/
@Beta
@NotThreadSafe
* @throws IllegalArgumentException when specified identifier does not identify a valid child,
* or if that child is not an instance of {@link DataContainer}.
*/
- void enter(@Nonnull PathArgument child);
+ void enter(@NonNull PathArgument child);
/**
* Move the cursor to the specified child of the current position. This is the equivalent of
* @throws IllegalArgumentException when specified path does not identify a valid child, or if
* that child is not an instance of {@link DataContainer}.
*/
- void enter(@Nonnull PathArgument... path);
+ void enter(@NonNull PathArgument... path);
/**
* Move the cursor to the specified child of the current position. This is equivalent to
* @throws IllegalArgumentException when specified path does not identify a valid child, or if
* that child is not an instance of {@link DataContainer}.
*/
- void enter(@Nonnull Iterable<PathArgument> path);
+ void enter(@NonNull Iterable<PathArgument> path);
/**
* Move the cursor up to the parent of current position. This is equivalent of invoking
* 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.binding.api;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* Provides access to {#link DataTreeCursor}'s anchored at the specified path.
*/
public interface DataTreeCursorProvider {
-
/**
* Create a new {@link DataTreeCursor} at specified path. May fail if specified path
* does not exist.
* @throws IllegalStateException if there is another cursor currently open, or the transaction
* is already closed (closed or submitted).
*/
- @Nullable
- <T extends DataObject> DataTreeCursor createCursor(@Nonnull DataTreeIdentifier<T> path);
+ <T extends DataObject> @Nullable DataTreeCursor createCursor(@NonNull DataTreeIdentifier<T> path);
}
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import java.io.Serializable;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.concepts.Immutable;
import org.opendaylight.yangtools.concepts.Path;
*
* @return Logical data store type. Guaranteed to be non-null.
*/
- @Nonnull
- public LogicalDatastoreType getDatastoreType() {
+ public @NonNull LogicalDatastoreType getDatastoreType() {
return datastoreType;
}
*
* @return Instance identifier corresponding to the root node.
*/
- @Nonnull
- public InstanceIdentifier<T> getRootIdentifier() {
+ public @NonNull InstanceIdentifier<T> getRootIdentifier() {
return rootIdentifier;
}
import java.util.Collection;
import java.util.EventListener;
import java.util.Map;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* This includes all the subtrees this listener is subscribed to, even those which have
* not changed.
*/
- void onDataTreeChanged(@Nonnull Collection<DataTreeModification<?>> changes,
- @Nonnull Map<DataTreeIdentifier<?>, DataObject> subtrees);
+ void onDataTreeChanged(@NonNull Collection<DataTreeModification<?>> changes,
+ @NonNull Map<DataTreeIdentifier<?>, DataObject> subtrees);
/**
* Invoked when a subtree listening failure occurs. This can be triggered, for example, when a
*
* @param causes Collection of failure causes, may not be null or empty.
*/
- void onDataTreeFailed(@Nonnull Collection<DataTreeListeningException> causes);
-
+ void onDataTreeFailed(@NonNull Collection<DataTreeListeningException> causes);
}
\ No newline at end of file
*/
package org.opendaylight.mdsal.binding.api;
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
+import static java.util.Objects.requireNonNull;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
/**
- * Base exception for various causes why and {@link DataTreeListener} may be terminated by the
- * {@link DataTreeService} implementation.
+ * Base exception for various causes why and {@link DataTreeListener} may be terminated by the {@link DataTreeService}
+ * implementation.
*/
public class DataTreeListeningException extends Exception {
-
-
private static final long serialVersionUID = 1L;
- public DataTreeListeningException(@Nonnull String message, @Nullable Throwable cause) {
- super(Preconditions.checkNotNull(message, "message"), cause);
+ public DataTreeListeningException(final @NonNull String message, final @Nullable Throwable cause) {
+ super(requireNonNull(message, "message"), cause);
}
- public DataTreeListeningException(@Nonnull String message) {
- super(Preconditions.checkNotNull(message, "message"));
+ public DataTreeListeningException(@NonNull final String message) {
+ super(requireNonNull(message, "message"));
}
}
\ No newline at end of file
*/
package org.opendaylight.mdsal.binding.api;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
/**
- * Exception thrown when a loop is detected in the way {@link DataTreeListener} and
- * {@link DataTreeProducer} instances would be connected.
+ * Exception thrown when a loop is detected in the way {@link DataTreeListener} and {@link DataTreeProducer} instances
+ * would be connected.
*/
public class DataTreeLoopException extends DataTreeProducerException {
-
private static final long serialVersionUID = 1L;
- public DataTreeLoopException(@Nonnull final String message, @Nonnull final Throwable cause) {
+ public DataTreeLoopException(final @NonNull String message, final @NonNull Throwable cause) {
super(message, cause);
}
- public DataTreeLoopException(@Nonnull final String message) {
+ public DataTreeLoopException(final @NonNull String message) {
super(message);
}
* 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.binding.api;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.DataObject;
/**
* Represent root of modification.
*
* @author Tony Tkacik <ttkacik@cisco.com>
- *
*/
public interface DataTreeModification<T extends DataObject> {
-
/**
- * Get the modification root path. This is the path of the root node
- * relative to the root of InstanceIdentifier namespace.
+ * Get the modification root path. This is the path of the root node relative to the root of InstanceIdentifier
+ * namespace.
*
* @return absolute path of the root node
*/
- @Nonnull DataTreeIdentifier<T> getRootPath();
+ @NonNull DataTreeIdentifier<T> getRootPath();
/**
* Get the modification root node.
*
* @return modification root node
*/
- @Nonnull DataObjectModification<T> getRootNode();
-
+ @NonNull DataObjectModification<T> getRootNode();
}
package org.opendaylight.mdsal.binding.api;
import java.util.Collection;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
/**
* A data producer context. It allows transactions to be submitted to the subtrees specified at
*
* <p>
* When a producer is referenced in a call to
- * {@link DataTreeService#registerListener(DataTreeListener, java.util.Collection, boolean, java.util.Collection)}
- * , an attempt will be made to bind the producer to the specified {@link DataTreeListener}. Such an
- * attempt will fail the producer is already bound, or it has an open transaction. Once bound, the
- * producer can only be accessed from within the {@link DataTreeListener} callback on that
- * particular instance. Any transaction which is not submitted by the time the callback returns will
- * be implicitly cancelled. A producer becomes unbound when the listener it is bound to becomes
- * unregistered.
- *
+ * {@link DataTreeService#registerListener(DataTreeListener, java.util.Collection, boolean, java.util.Collection)},
+ * an attempt will be made to bind the producer to the specified {@link DataTreeListener}. Such an attempt will fail
+ * the producer is already bound, or it has an open transaction. Once bound, the producer can only be accessed
+ * from within the {@link DataTreeListener} callback on that particular instance. Any transaction which is not submitted
+ * by the time the callback returns will be implicitly cancelled. A producer becomes unbound when the listener it is
+ * bound to becomes unregistered.
*/
public interface DataTreeProducer extends DataTreeProducerFactory, AutoCloseable {
/**
* exception is thrown on a best effort basis and programs should not rely on it for
* correct operation.
*/
- @Nonnull
- CursorAwareWriteTransaction createTransaction(boolean isolated);
+ @NonNull CursorAwareWriteTransaction createTransaction(boolean isolated);
/**
* {@inheritDoc}.
* correct operation.
*/
@Override
- @Nonnull
- DataTreeProducer createProducer(@Nonnull Collection<DataTreeIdentifier<?>> subtrees);
+ DataTreeProducer createProducer(Collection<DataTreeIdentifier<?>> subtrees);
/**
* {@inheritDoc}.
*/
package org.opendaylight.mdsal.binding.api;
-import com.google.common.base.Preconditions;
-import javax.annotation.Nonnull;
+import static java.util.Objects.requireNonNull;
+
+import org.eclipse.jdt.annotation.NonNull;
/**
* Exception indicating that the {@link DataTreeProducer} has an open user transaction and cannot be
* closed.
*/
public class DataTreeProducerBusyException extends DataTreeProducerException {
-
private static final long serialVersionUID = 1L;
-
- public DataTreeProducerBusyException(@Nonnull final String message, @Nonnull final Throwable cause) {
- super(Preconditions.checkNotNull(message, "message"), cause);
+ public DataTreeProducerBusyException(final @NonNull String message, final @NonNull Throwable cause) {
+ super(requireNonNull(message, "message"), cause);
}
- public DataTreeProducerBusyException(@Nonnull final String message) {
- super(Preconditions.checkNotNull(message, "message"));
+ public DataTreeProducerBusyException(final @NonNull String message) {
+ super(requireNonNull(message, "message"));
}
-
}
*/
package org.opendaylight.mdsal.binding.api;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
public class DataTreeProducerException extends Exception {
-
private static final long serialVersionUID = 1L;
- public DataTreeProducerException(@Nonnull final String message, @Nonnull final Throwable cause) {
+ public DataTreeProducerException(final @NonNull String message, final @NonNull Throwable cause) {
super(message, cause);
}
- public DataTreeProducerException(@Nonnull final String message) {
+ public DataTreeProducerException(final @NonNull String message) {
super(message);
}
package org.opendaylight.mdsal.binding.api;
import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
public interface DataTreeProducerFactory {
-
/**
* Create a producer, which is able to access to a set of trees.
*
* @return A {@link DataTreeProducer} instance.
* @throws IllegalArgumentException if subtrees is empty.
*/
- DataTreeProducer createProducer(Collection<DataTreeIdentifier<?>> subtrees);
-
+ @NonNull DataTreeProducer createProducer(@NonNull Collection<DataTreeIdentifier<?>> subtrees);
}
\ No newline at end of file
package org.opendaylight.mdsal.binding.api;
import java.util.Collection;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
/**
* @throws DataTreeLoopException if the registration of the listener to the specified subtrees
* with specified producers would form a feedback loop
*/
- @Nonnull
- <T extends DataTreeListener> ListenerRegistration<T> registerListener(@Nonnull T listener,
- @Nonnull Collection<DataTreeIdentifier<?>> subtrees, boolean allowRxMerges,
- @Nonnull Collection<DataTreeProducer> producers) throws DataTreeLoopException;
+ <T extends DataTreeListener> @NonNull ListenerRegistration<T> registerListener(@NonNull T listener,
+ @NonNull Collection<DataTreeIdentifier<?>> subtrees, boolean allowRxMerges,
+ @NonNull Collection<DataTreeProducer> producers) throws DataTreeLoopException;
}