/*
* Copyright (c) 2014 Cisco 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.controller.md.sal.dom.broker.impl;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.CheckedFuture;
import java.util.Map;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
import org.opendaylight.controller.sal.core.spi.data.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 #commit()} will result in invocation of
* {@link DOMDataCommitImplementation#submit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, Iterable)}
* invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
* transactions.
*
*/
final class DOMForwardedReadWriteTransaction extends DOMForwardedWriteTransaction implements DOMDataReadWriteTransaction {
protected DOMForwardedReadWriteTransaction(final Object identifier,
final Map backingTxs,
final AbstractDOMForwardedTransactionFactory> commitImpl) {
super(identifier, backingTxs, commitImpl);
}
@Override
public CheckedFuture>, ReadFailedException> read(
final LogicalDatastoreType store, final YangInstanceIdentifier path) {
return getSubtransaction(store).read(path);
}
@Override
public CheckedFuture exists(
final LogicalDatastoreType store,
final YangInstanceIdentifier path) {
return getSubtransaction(store).exists(path);
}
}