org.opendaylight.mdsal.dom.spi.DOMForwardedReadWriteTransaction Maven / Gradle / Ivy
Show all versions of mdsal-dom-spi Show documentation
/*
* Copyright (c) 2017 Brocade Communications Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* 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.dom.spi;
import com.google.common.util.concurrent.FluentFuture;
import java.util.Optional;
import java.util.function.Function;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.mdsal.dom.api.DOMDataTreeQueryReadWriteTransaction;
import org.opendaylight.mdsal.dom.api.query.DOMQuery;
import org.opendaylight.mdsal.dom.api.query.DOMQueryResult;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
/**
* Read-Write Transaction, which is composed of several
* {@link DOMStoreReadWriteTransaction} transactions. Subtransaction is selected by
* {@link LogicalDatastoreType} type parameter in:
*
*
* - {@link #read(LogicalDatastoreType, YangInstanceIdentifier)}
*
- {@link #put(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
*
- {@link #delete(LogicalDatastoreType, YangInstanceIdentifier)}
*
- {@link #merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
*
*
* {@link #submit()} will result in invocation of
* {@link DOMDataCommitImplementation#submit(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, Iterable)}
* invocation with all
* {@link org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort} for
* underlying transactions.
*/
final class DOMForwardedReadWriteTransaction extends DOMForwardedWriteTransaction
implements DOMDataTreeQueryReadWriteTransaction {
DOMForwardedReadWriteTransaction(final Object identifier,
final Function txSupplier,
final AbstractDOMForwardedTransactionFactory> commitImpl) {
super(identifier, txSupplier, commitImpl);
}
@Override
public FluentFuture> read(final LogicalDatastoreType store,
final YangInstanceIdentifier path) {
return getSubtransaction(store).read(path);
}
@Override
public FluentFuture exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
return getSubtransaction(store).exists(path);
}
@Override
public FluentFuture execute(final LogicalDatastoreType store, final DOMQuery query) {
return getSubtransaction(store).execute(query);
}
}