Search in sources :

Example 1 with DOMDataTreeReadOperations

use of org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations in project mdsal by opendaylight.

the class AbstractForwardedTransaction method doRead.

@NonNull
protected final <D extends DataObject> FluentFuture<Optional<D>> doRead(final DOMDataTreeReadOperations readOps, final LogicalDatastoreType store, final InstanceIdentifier<D> path) {
    checkArgument(!path.isWildcarded(), "Invalid read of wildcarded path %s", path);
    final CurrentAdapterSerializer codec = adapterContext.currentSerializer();
    final YangInstanceIdentifier domPath = codec.toYangInstanceIdentifier(path);
    return readOps.read(store, domPath).transform(optData -> optData.map(domData -> (D) codec.fromNormalizedNode(domPath, domData).getValue()), MoreExecutors.directExecutor());
}
Also used : DOMDataTreeReadOperations(org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) DOMQueryResult(org.opendaylight.mdsal.dom.api.query.DOMQueryResult) Logger(org.slf4j.Logger) QueryResult(org.opendaylight.mdsal.binding.api.query.QueryResult) DOMQuery(org.opendaylight.mdsal.dom.api.query.DOMQuery) LoggerFactory(org.slf4j.LoggerFactory) QueryExpression(org.opendaylight.mdsal.binding.api.query.QueryExpression) Preconditions.checkState(com.google.common.base.Preconditions.checkState) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) DefaultQuery(org.opendaylight.mdsal.binding.dom.adapter.query.DefaultQuery) DOMDataTreeTransaction(org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) DOMQueryEvaluator(org.opendaylight.mdsal.dom.spi.query.DOMQueryEvaluator) Objects.requireNonNull(java.util.Objects.requireNonNull) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) Optional(java.util.Optional) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) Identifiable(org.opendaylight.yangtools.concepts.Identifiable) Delegator(org.opendaylight.yangtools.concepts.Delegator) DataObject(org.opendaylight.yangtools.yang.binding.DataObject) NonNull(org.eclipse.jdt.annotation.NonNull) DOMDataTreeQueryOperations(org.opendaylight.mdsal.dom.api.DOMDataTreeQueryOperations) FluentFuture(com.google.common.util.concurrent.FluentFuture) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) Objects.requireNonNull(java.util.Objects.requireNonNull) NonNull(org.eclipse.jdt.annotation.NonNull)

Aggregations

Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 FluentFuture (com.google.common.util.concurrent.FluentFuture)1 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 Optional (java.util.Optional)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 QueryExpression (org.opendaylight.mdsal.binding.api.query.QueryExpression)1 QueryResult (org.opendaylight.mdsal.binding.api.query.QueryResult)1 DefaultQuery (org.opendaylight.mdsal.binding.dom.adapter.query.DefaultQuery)1 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)1 DOMDataTreeQueryOperations (org.opendaylight.mdsal.dom.api.DOMDataTreeQueryOperations)1 DOMDataTreeReadOperations (org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations)1 DOMDataTreeTransaction (org.opendaylight.mdsal.dom.api.DOMDataTreeTransaction)1 DOMQuery (org.opendaylight.mdsal.dom.api.query.DOMQuery)1 DOMQueryResult (org.opendaylight.mdsal.dom.api.query.DOMQueryResult)1 DOMQueryEvaluator (org.opendaylight.mdsal.dom.spi.query.DOMQueryEvaluator)1 Delegator (org.opendaylight.yangtools.concepts.Delegator)1 Identifiable (org.opendaylight.yangtools.concepts.Identifiable)1 DataObject (org.opendaylight.yangtools.yang.binding.DataObject)1