public abstract class AbstractDOMDataBroker extends Object implements DOMDataBroker
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
DOMDataTreeWriteTransaction.commit() for transaction. |
DOMTransactionChain |
createTransactionChain(DOMTransactionChainListener 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(DOMTransactionChainListener listener)
DOMDataBroker
createTransactionChain
in interface DOMDataBroker
listener
- Transaction chain event listenerprotected abstract com.google.common.util.concurrent.FluentFuture<? extends CommitInfo> commit(DOMDataTreeWriteTransaction transaction, Collection<DOMStoreThreePhaseCommitCohort> cohorts)
DOMDataTreeWriteTransaction.commit()
for transaction.
Callback invoked when DOMDataTreeWriteTransaction.commit()
is invoked on transaction created by this
factory.
transaction
- Transaction on which DOMDataTreeWriteTransaction.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
DOMDataTreeReadOperations.read(LogicalDatastoreType, 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:
DOMDataTreeWriteOperations.put(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.write(YangInstanceIdentifier, NormalizedNode)
is invoked on selected
subtransaction.DOMDataTreeWriteOperations.merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.merge(YangInstanceIdentifier, NormalizedNode)
is invoked on selected
subtransaction.DOMDataTreeWriteOperations.delete(LogicalDatastoreType, YangInstanceIdentifier)
- backing subtransaction is selected by LogicalDatastoreType
,
DOMStoreWriteTransaction.delete(YangInstanceIdentifier)
is invoked on selected subtransaction.
DOMDataTreeWriteTransaction.commit()
- results in invoking DOMStoreWriteTransaction.ready()
,
gathering all resulting cohorts and then invoking finalized implementation callback
commit(DOMDataTreeWriteTransaction, Collection)
with transaction which was committed 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.