package org.opendaylight.mdsal.binding.api;
import com.google.common.util.concurrent.FluentFuture;
+import javax.annotation.CheckReturnValue;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
* operation is complete. A successful commit returns nothing. On failure, the Future will fail with a
* {@link TransactionCommitFailedException} or an exception derived from TransactionCommitFailedException.
*/
- FluentFuture<? extends @NonNull CommitInfo> commit();
+ @CheckReturnValue
+ @NonNull FluentFuture<? extends @NonNull CommitInfo> commit();
}
*/
package org.opendaylight.mdsal.binding.api;
+import org.eclipse.jdt.annotation.NonNull;
+
/**
* Provides access to a conceptual data tree store and also provides the ability to
* subscribe for changes to data under a given branch of the tree.
* @param listener Transaction chain event listener
* @return A new transaction chain.
*/
- TransactionChain createTransactionChain(TransactionChainListener listener);
+ @NonNull TransactionChain createTransactionChain(@NonNull TransactionChainListener listener);
}
* @throws IllegalArgumentException If supplied {@code listItem} class is not valid child according
* to generated model.
*/
- <N extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<N>> DataObjectModification<N>
+ <N extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<N>> @Nullable DataObjectModification<N>
getModifiedChildListItem(@NonNull Class<N> listItem, @NonNull K listKey);
/**
import com.google.common.annotations.Beta;
import com.google.common.util.concurrent.FluentFuture;
import java.util.Collection;
+import javax.annotation.CheckReturnValue;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.DataValidationFailedException;
import org.opendaylight.mdsal.common.api.PostCanCommitStep;
* more specific subclasses of this exception to provide additional information about
* validation failure reason.
*/
- FluentFuture<PostCanCommitStep> canCommit(@NonNull Object txId,
+ @CheckReturnValue
+ @NonNull 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 org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
* See {@link DataTreeCommitCohort} for more details.
*
* @author Tony Tkacik <ttkacik@cisco.com>
- *
*/
public interface DataTreeCommitCohortRegistry {
-
/**
* Register commit cohort which will participate in three-phase commit protocols of write
* transaction in data broker associated with this instance of extension.
* @param cohort Commit cohort
* @return Registaration object for DOM Data Three Commit cohort.
*/
- <D extends DataObject, T extends DataTreeCommitCohort<D>> ObjectRegistration<T> registerCommitCohort(
- DataTreeIdentifier<D> subtree, T cohort);
-
+ <D extends DataObject, T extends DataTreeCommitCohort<D>> @NonNull ObjectRegistration<T> registerCommitCohort(
+ @NonNull DataTreeIdentifier<D> subtree, @NonNull T cohort);
}
*/
package org.opendaylight.mdsal.binding.api;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
import java.io.Serializable;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
public final class DataTreeIdentifier<T extends DataObject> implements Immutable,
Path<DataTreeIdentifier<?>>, Serializable {
private static final long serialVersionUID = 1L;
- private final InstanceIdentifier<T> rootIdentifier;
- private final LogicalDatastoreType datastoreType;
- private DataTreeIdentifier(final LogicalDatastoreType datastoreType, final InstanceIdentifier<T> rootIdentifier) {
- this.datastoreType = Preconditions.checkNotNull(datastoreType);
- this.rootIdentifier = Preconditions.checkNotNull(rootIdentifier);
+ private final @NonNull InstanceIdentifier<T> rootIdentifier;
+ private final @NonNull LogicalDatastoreType datastoreType;
+
+ private DataTreeIdentifier(final @NonNull LogicalDatastoreType datastoreType,
+ final @NonNull InstanceIdentifier<T> rootIdentifier) {
+ this.datastoreType = requireNonNull(datastoreType);
+ this.rootIdentifier = requireNonNull(rootIdentifier);
}
- public static <T extends DataObject> DataTreeIdentifier<T> create(final LogicalDatastoreType datastoreType,
- final InstanceIdentifier<T> rootIdentifier) {
+ public static <T extends DataObject> @NonNull DataTreeIdentifier<T> create(
+ final @NonNull LogicalDatastoreType datastoreType, final @NonNull InstanceIdentifier<T> rootIdentifier) {
return new DataTreeIdentifier<>(datastoreType, rootIdentifier);
}
* 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 org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.tree.BackendFailedException;
* In addition this cursor also provides write operations(delete, merge, write).
*/
public interface DataTreeWriteCursor extends DataTreeCursor {
-
/**
* Delete the specified child.
*
* @throws BackendFailedException when implementation-specific errors occurs while servicing the
* request.
*/
- void delete(PathArgument child);
+ void delete(@NonNull PathArgument child);
/**
* Merge the specified data with the currently-present data at specified path.
* @throws BackendFailedException when implementation-specific errors occurs while servicing the
* request.
*/
- <T extends DataObject> void merge(PathArgument child, T data);
+ <T extends DataObject> void merge(@NonNull PathArgument child, @NonNull T data);
/**
* Replace the data at specified path with supplied data.
* @throws BackendFailedException when implementation-specific errors occurs while servicing the
* request.
*/
- <T extends DataObject> void write(PathArgument child, T data);
+ <T extends DataObject> void write(@NonNull PathArgument child, @NonNull T data);
}
package org.opendaylight.mdsal.binding.api;
import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public interface MountPoint extends Identifiable<InstanceIdentifier<?>> {
- <T extends BindingService> Optional<T> getService(Class<T> service);
-
+ <T extends BindingService> @NonNull Optional<T> getService(@NonNull Class<T> service);
}
*/
package org.opendaylight.mdsal.binding.api;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.Notification;
/**
* - {@link #offerNotification(Notification, int, TimeUnit)}, which may block
* for specified time if resources are thin.
*
- *<p>
+ * <p>
* The actual delivery to listeners is asynchronous and implementation-specific.
* Users of this interface should not make any assumptions as to whether the
* notification has or has not been seen.
* Well-known value indicating that the binding-aware implementation is currently not
* able to accept a notification.
*/
- ListenableFuture<Object> REJECTED = Futures.immediateFailedFuture(
+ ListenableFuture<Object> REJECTED = FluentFutures.immediateFailedFluentFuture(
new NotificationRejectedException("Rejected due to resource constraints."));
/**
* @throws InterruptedException if interrupted while waiting
* @throws NullPointerException if the notification is null
*/
- void putNotification(Notification notification) throws InterruptedException;
+ void putNotification(@NonNull Notification notification) throws InterruptedException;
/**
* Publishes a notification to subscribed listeners. This initiates the process of sending the
* resource constraints prevent
* @throws NullPointerException if the notification is null
*/
- ListenableFuture<? extends Object> offerNotification(Notification notification);
+ @NonNull ListenableFuture<? extends Object> offerNotification(@NonNull Notification notification);
/**
* Publishes a notification to subscribed listeners. This initiates the process of sending the
* @throws NullPointerException if the notification or unit is null
* @throws IllegalArgumentException if timeout is negative.
*/
- ListenableFuture<? extends Object> offerNotification(Notification notification, int timeout, TimeUnit unit)
- throws InterruptedException;
-
+ @NonNull ListenableFuture<? extends Object> offerNotification(@NonNull Notification notification,
+ int timeout, @NonNull TimeUnit unit) throws InterruptedException;
}
*/
package org.opendaylight.mdsal.binding.api;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
* @return a {@link ListenerRegistration} instance that should be used to unregister the listener
* by invoking the {@link ListenerRegistration#close()} method when no longer needed.
*/
- <T extends NotificationListener> ListenerRegistration<T> registerNotificationListener(T listener);
+ <T extends NotificationListener> @NonNull ListenerRegistration<T> registerNotificationListener(@NonNull T listener);
}
import com.google.common.util.concurrent.FluentFuture;
import java.util.Optional;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yangtools.yang.binding.DataObject;
* <li>If the read of the data fails, the Future will fail with a {@link ReadFailedException} or
* an exception derived from ReadFailedException.</li>
* </ul>
+ * @throws NullPointerException if any of the arguments is null
*/
- <T extends DataObject> FluentFuture<Optional<T>> read(LogicalDatastoreType store, InstanceIdentifier<T> path);
+ <T extends DataObject> @NonNull FluentFuture<Optional<T>> read(@NonNull LogicalDatastoreType store,
+ @NonNull InstanceIdentifier<T> path);
}
*/
package org.opendaylight.mdsal.binding.api;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.binding.RpcService;
/**
* generated from a YANG model.
* @return the proxy for the requested RPC service. This method never returns null.
*/
- <T extends RpcService> T getRpcService(Class<T> serviceInterface);
+ <T extends RpcService> @NonNull T getRpcService(@NonNull Class<T> serviceInterface);
}
package org.opendaylight.mdsal.binding.api;
import java.util.EventListener;
+import org.eclipse.jdt.annotation.NonNull;
/**
* Listener for transaction chain events.
* @param transaction Transaction which caused the chain to fail
* @param cause The cause of transaction failure
*/
- void onTransactionChainFailed(TransactionChain chain, Transaction transaction, Throwable cause);
+ void onTransactionChainFailed(@NonNull TransactionChain chain, @NonNull Transaction transaction,
+ @NonNull Throwable cause);
/**
* Invoked when a transaction chain is completed. A transaction chain is considered completed when it has been
*
* @param chain Transaction chain which completed
*/
- void onTransactionChainSuccessful(TransactionChain chain);
+ void onTransactionChainSuccessful(@NonNull TransactionChain chain);
}
*/
package org.opendaylight.mdsal.binding.api;
+import org.eclipse.jdt.annotation.NonNull;
+
/**
* A factory which allocates new transactions to operate on the data tree.
*
*
* @return A new read-only transaction
*/
- ReadTransaction newReadOnlyTransaction();
+ @NonNull ReadTransaction newReadOnlyTransaction();
/**
* Allocates new read-write transaction which provides a mutable view of the data tree.
*
* @return new read-write transaction
*/
- ReadWriteTransaction newReadWriteTransaction();
+ @NonNull ReadWriteTransaction newReadWriteTransaction();
/**
* Allocates new write-only transaction based on latest state of data tree.
*
* @return new write-only transaction
*/
- WriteTransaction newWriteOnlyTransaction();
+ @NonNull WriteTransaction newWriteOnlyTransaction();
}
*/
package org.opendaylight.mdsal.binding.api;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
* @throws IllegalStateException if the transaction has already been submitted
* @throws NullPointerException if any of the arguments is null
*/
- <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data);
+ <T extends DataObject> void put(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<T> path,
+ @NonNull T data);
/**
* Stores a piece of data at the specified path. This acts as an add / replace operation, which is to say that whole
* @throws IllegalStateException if the transaction has already been submitted
* @throws NullPointerException if any of the arguments is null
*/
- <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
- boolean createMissingParents);
+ <T extends DataObject> void put(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<T> path,
+ @NonNull T data, boolean createMissingParents);
/**
* Merges a piece of data with the existing data at a specified path. Any pre-existing data which is not explicitly
* @throws IllegalStateException if the transaction has already been submitted
* @throws NullPointerException if any of the arguments is null
*/
- <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data);
+ <T extends DataObject> void merge(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<T> path,
+ @NonNull T data);
/**
* Merges a piece of data with the existing data at a specified path. Any pre-existing data which is not explicitly
* @throws IllegalStateException if the transaction has already been submitted
* @throws NullPointerException if any of the arguments is null
*/
- <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
- boolean createMissingParents);
+ <T extends DataObject> void merge(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<T> path,
+ @NonNull T data, boolean createMissingParents);
/**
* Removes a piece of data from specified path. This operation does not fail if the specified path does not exist.
* @param path Data object path
* @throws IllegalStateException if the transaction was committed or canceled.
*/
- void delete(LogicalDatastoreType store, InstanceIdentifier<?> path);
+ void delete(@NonNull LogicalDatastoreType store, @NonNull InstanceIdentifier<?> path);
/**
* Flag value indicating that missing parents should be created.