Class SnapshotBackedWriteTransaction<T>
- java.lang.Object
-
- org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction<T>
-
- org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction<T>
-
- Type Parameters:
T
- Identifier type
- All Implemented Interfaces:
AutoCloseable
,DOMStoreTransaction
,DOMStoreWriteTransaction
,SnapshotBackedTransaction
,Identifiable<Object>
- Direct Known Subclasses:
SnapshotBackedReadWriteTransaction
@Beta public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction, SnapshotBackedTransaction
Implementation of Write transaction which is backed byDataTreeSnapshot
and executed according toSnapshotBackedWriteTransaction.TransactionReadyPrototype
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnapshotBackedWriteTransaction.TransactionReadyPrototype<T>
Prototype implementation ofready()
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MoreObjects.ToStringHelper
addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
Add class-specific toString attributes.void
close()
void
delete(YangInstanceIdentifier path)
Deletes data and whole subtree located at provided path.Optional<DataTreeSnapshot>
getSnapshot()
Returns theDataTreeSnapshot
underlying this transaction.void
merge(YangInstanceIdentifier path, NormalizedNode data)
Store a provided data at specified path.DOMStoreThreePhaseCommitCohort
ready()
Seals transaction, and returns three-phase commit cohort associated with this transaction and DOM Store to be coordinated by coordinator.void
write(YangInstanceIdentifier path, NormalizedNode data)
Store a provided data at specified path.-
Methods inherited from class org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction
getDebugContext, getIdentifier, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction
getIdentifier
-
-
-
-
Method Detail
-
write
public void write(YangInstanceIdentifier path, NormalizedNode data)
Description copied from interface:DOMStoreWriteTransaction
Store a provided data at specified path. This acts as a add / replace operation, which is to say that whole subtree will be replaced by specified path.If you need add or merge of current object with specified use
DOMStoreWriteTransaction.merge(YangInstanceIdentifier, NormalizedNode)
- Specified by:
write
in interfaceDOMStoreWriteTransaction
- Parameters:
path
- YangInstanceIdentifier object to be writtendata
- Data object to be written
-
merge
public void merge(YangInstanceIdentifier path, NormalizedNode data)
Description copied from interface:DOMStoreWriteTransaction
Store a provided data at specified path. This acts as a add / replace operation, which is to say that whole subtree will be replaced by specified path.If you need add or merge of current object with specified use
DOMStoreWriteTransaction.merge(YangInstanceIdentifier, NormalizedNode)
- Specified by:
merge
in interfaceDOMStoreWriteTransaction
- Parameters:
path
- YangInstanceIdentifier object to be mergeddata
- Data object to be written
-
delete
public void delete(YangInstanceIdentifier path)
Description copied from interface:DOMStoreWriteTransaction
Deletes data and whole subtree located at provided path.- Specified by:
delete
in interfaceDOMStoreWriteTransaction
- Parameters:
path
- Path to delete
-
ready
public DOMStoreThreePhaseCommitCohort ready()
Description copied from interface:DOMStoreWriteTransaction
Seals transaction, and returns three-phase commit cohort associated with this transaction and DOM Store to be coordinated by coordinator.- Specified by:
ready
in interfaceDOMStoreWriteTransaction
- Returns:
- Three Phase Commit Cohort instance for this transaction.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDOMStoreTransaction
-
getSnapshot
public Optional<DataTreeSnapshot> getSnapshot()
Description copied from interface:SnapshotBackedTransaction
Returns theDataTreeSnapshot
underlying this transaction. If this transaction is no longer open,Optional.empty()
is returned.- Specified by:
getSnapshot
in interfaceSnapshotBackedTransaction
- Returns:
- DataTreeSnapshot attached to this transaction if this transaction is still open.
-
addToStringAttributes
protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper)
Description copied from class:AbstractDOMStoreTransaction
Add class-specific toString attributes.- Overrides:
addToStringAttributes
in classAbstractDOMStoreTransaction<T>
- Parameters:
toStringHelper
- ToStringHelper instance- Returns:
- ToStringHelper instance which was passed in
-
-