Updated implementation of broker (data services, generated code), added Integration...
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / data / DataModificationTransaction.java
index 4f69f0b38a1d86550189e1fbcc2db4aa05e563a4..9ce11c71e4b6d1a41fa61a4dfa94401700db97e1 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.sal.binding.api.data;
 
 import java.util.EventListener;
+import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
@@ -15,17 +16,68 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public interface DataModificationTransaction extends DataModification<InstanceIdentifier<? extends DataObject>, DataObject> {
 
+    /**
+     * Returns an unique identifier for transaction
+     * 
+     */
+    @Override
+    public Object getIdentifier();
+    
+    /**
+     * Initiates a two-phase commit of candidate data.
+     * 
+     * <p>
+     * The {@link Consumer} could initiate a commit of candidate data
+     * 
+     * <p>
+     * The successful commit changes the state of the system and may affect
+     * several components.
+     * 
+     * <p>
+     * The effects of successful commit of data are described in the
+     * specifications and YANG models describing the {@link Provider} components
+     * of controller. It is assumed that {@link Consumer} has an understanding
+     * of this changes.
+     * 
+     * 
+     * @see DataCommitHandler for further information how two-phase commit is
+     *      processed.
+     * @param store
+     *            Identifier of the store, where commit should occur.
+     * @return Result of the commit, containing success information or list of
+     *         encountered errors, if commit was not successful.
+     */
+    @Override
+    public Future<RpcResult<TransactionStatus>> commit();
+    
+    
+    
+    /**
+     * Register a listener for transaction
+     * 
+     * @param listener
+     * @return
+     */
     ListenerRegistration<DataTransactionListener> registerListener(DataTransactionListener listener);
 
 
-    //FIXME: After 0.6 Release of YANG-Binding
-    //public <T extends DataObject> T readOperationalData(InstanceIdentifier<T> path);
-    //public <T extends DataObject> T readConfigurationData(InstanceIdentifier<T> path);
 
+    /**
+     * Listener for transaction state changes
+     * 
+     *
+     */
     public interface DataTransactionListener extends EventListener {
+        /**
+         * Callback is invoked after each transaction status change.
+         * 
+         * @param transaction Transaction
+         * @param status New status
+         */
         void onStatusUpdated(DataModificationTransaction transaction,TransactionStatus status);
     }
 }