All Known Subinterfaces:
DeviceContext
All Known Implementing Classes:
DeviceContextImpl

public interface TxFacade
Handles operations with transactions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Method to acquire a write transaction lock to perform atomic transactions to MD-SAL.
    <T extends org.opendaylight.yangtools.yang.binding.DataObject>
    void
    addDeleteToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
    Method creates delete operation for provided path in underlying transaction chain.
    org.opendaylight.mdsal.binding.api.ReadTransaction
    Method exposes transaction created for device represented by this context.
    boolean
    Method returns true if transaction chain manager is enabled.
    void
    Method to release the acquired write transaction lock.
    boolean
    Method submits Transaction to DataStore.
    boolean
    Method submits Transaction to DataStore and wait till completes by doing get on tx future.
    <T extends org.opendaylight.yangtools.yang.binding.DataObject>
    void
    writeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
    Method creates put operation using provided data in underlying transaction chain.
    <T extends org.opendaylight.yangtools.yang.binding.DataObject>
    void
    writeToTransactionWithParentsSlow(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
    Method creates put operation using provided data in underlying transaction chain and flag to create missing parents.
  • Method Details

    • writeToTransaction

      <T extends org.opendaylight.yangtools.yang.binding.DataObject> void writeToTransaction(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
      Method creates put operation using provided data in underlying transaction chain.
    • writeToTransactionWithParentsSlow

      <T extends org.opendaylight.yangtools.yang.binding.DataObject> void writeToTransactionWithParentsSlow(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path, T data)
      Method creates put operation using provided data in underlying transaction chain and flag to create missing parents. WARNING: This method is slow because of additional reading cost. Use it only if you really need to create parents.
    • addDeleteToTxChain

      <T extends org.opendaylight.yangtools.yang.binding.DataObject> void addDeleteToTxChain(org.opendaylight.mdsal.common.api.LogicalDatastoreType store, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
      Method creates delete operation for provided path in underlying transaction chain.
    • submitTransaction

      boolean submitTransaction()
      Method submits Transaction to DataStore.
      Returns:
      transaction is submitted successfully
    • syncSubmitTransaction

      boolean syncSubmitTransaction()
      Method submits Transaction to DataStore and wait till completes by doing get on tx future.
      Returns:
      transaction is submitted successfully
    • getReadTransaction

      org.opendaylight.mdsal.binding.api.ReadTransaction getReadTransaction()
      Method exposes transaction created for device represented by this context. This read only transaction has a fresh dataStore snapshot. There is a possibility to get different data set from DataStore as write transaction in this context.
      Returns:
      readOnlyTransaction - Don't forget to close it after finish reading
    • isTransactionsEnabled

      boolean isTransactionsEnabled()
      Method returns true if transaction chain manager is enabled.
      Returns:
      is transaction chain manager enabled
    • acquireWriteTransactionLock

      void acquireWriteTransactionLock()
      Method to acquire a write transaction lock to perform atomic transactions to MD-SAL.
    • releaseWriteTransactionLock

      void releaseWriteTransactionLock()
      Method to release the acquired write transaction lock.