public abstract class AbstractDOMDataBroker extends Object implements DOMDataBroker, AutoCloseable
Modifier | Constructor and Description |
---|---|
protected |
AbstractDOMDataBroker(Map<LogicalDatastoreType,DOMStore> datastores) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed()
Checks if instance is not closed.
|
void |
close() |
protected abstract com.google.common.util.concurrent.FluentFuture<? extends CommitInfo> |
commit(DOMDataTreeWriteTransaction transaction,
Collection<DOMStoreThreePhaseCommitCohort> cohorts)
User-supplied implementation of
AsyncWriteTransaction.commit() for transaction. |
DOMTransactionChain |
createTransactionChain(TransactionChainListener listener)
Create a new transaction chain.
|
com.google.common.collect.ClassToInstanceMap<DOMDataBrokerExtension> |
getExtensions()
Return a map of currently-supported extensions, along with accessor services
which provide access to the specific functionality bound to this service.
|
protected Map<LogicalDatastoreType,T> |
getTxFactories()
Convenience accessor of backing factories intended to be used only by
finalization of this class.
|
DOMDataTreeReadTransaction |
newReadOnlyTransaction()
Creates a new composite read-only transaction.
|
DOMDataTreeReadWriteTransaction |
newReadWriteTransaction()
Creates a new composite read-write transaction.
|
protected Object |
newTransactionIdentifier()
Implementations must return unique identifier for each and every call of
this method.
|
DOMDataTreeWriteTransaction |
newWriteOnlyTransaction()
Creates a new composite write-only transaction
|
void |
setCloseable(AutoCloseable closeable) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newReadOnlyTransaction, newReadWriteTransaction, newWriteOnlyTransaction
protected AbstractDOMDataBroker(Map<LogicalDatastoreType,DOMStore> datastores)
public void setCloseable(AutoCloseable closeable)
public void close()
close
in interface AutoCloseable
protected Object newTransactionIdentifier()
public com.google.common.collect.ClassToInstanceMap<DOMDataBrokerExtension> getExtensions()
DOMExtensibleService
getExtensions
in interface DOMExtensibleService<DOMDataBroker,DOMDataBrokerExtension>
public DOMTransactionChain createTransactionChain(TransactionChainListener listener)
TransactionChainFactory
createTransactionChain
in interface TransactionChainFactory<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>>
createTransactionChain
in interface DOMDataBroker
listener
- Transaction chain event listenerprotected abstract com.google.common.util.concurrent.FluentFuture<? extends CommitInfo> commit(DOMDataTreeWriteTransaction transaction, Collection<DOMStoreThreePhaseCommitCohort> cohorts)
AsyncWriteTransaction.commit()
for transaction.
Callback invoked when AsyncWriteTransaction.commit()
is invoked on transaction
created by this factory.
transaction
- Transaction on which AsyncWriteTransaction.commit()
was invoked.cohorts
- Iteratable of cohorts for subtransactions associated with the transaction
being committed.TransactionCommitFailedException
.public final DOMDataTreeReadTransaction newReadOnlyTransaction()
Creates a new composite read-only transaction backed by one transaction per factory in
getTxFactories()
.
Subtransaction for reading is selected by supplied LogicalDatastoreType
as parameter
for
DOMDataTreeReadTransaction.read(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
Id of returned transaction is retrieved via newTransactionIdentifier()
.
public final DOMDataTreeWriteTransaction newWriteOnlyTransaction()
Creates a new composite write-only transaction backed by one write-only transaction per
factory in getTxFactories()
.
Implementation of composite Write-only transaction is following:
DOMDataTreeWriteTransaction.put(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.write(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.DOMDataTreeWriteTransaction.merge(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.merge(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)
is invoked on selected subtransaction.DOMDataTreeWriteTransaction.delete(LogicalDatastoreType,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)
is invoked on selected subtransaction.
AsyncWriteTransaction.commit()
- results in invoking
DOMStoreWriteTransaction.ready()
, gathering all resulting cohorts and then invoking
finalized implementation callback commit(DOMDataTreeWriteTransaction, Collection)
with
transaction which was commited and gathered results.
Id of returned transaction is generated via newTransactionIdentifier()
.
public final DOMDataTreeReadWriteTransaction newReadWriteTransaction()
protected final Map<LogicalDatastoreType,T> getTxFactories()
protected final void checkNotClosed()
IllegalStateException
- If instance of this class was closed.Copyright © 2019 OpenDaylight. All rights reserved.