View Javadoc

1   /**
2    * 
3    */
4   package org.treetank.api;
5   
6   import org.treetank.exception.TTException;
7   
8   /**
9    * Write-Transaction of a bucket ensuring read- and write access to any buckets.
10   * The transaction is bound on the very last revision and bases on a session.
11   * 
12   * Each {@link IBucketWriteTrx} can afterwards get datas from the bucket-layer and the underlaying backend as well
13   * as store new {@link IData}s in the backend.
14   * 
15   * 
16   * @author Sebastian Graf, University of Konstanz
17   * 
18   */
19  public interface IBucketWriteTrx extends IBucketReadTrx {
20  
21      /**
22       * Getting most recent data key and incrementing it.
23       * 
24       * @return the most recent data key.
25       */
26      long incrementDataKey();
27  
28      /**
29       * Setting a data and storing the data in the bucket-layer.
30       * 
31       * @param pData
32       *            the data to be stored.
33       * @throws TTException
34       *             if anything weird happens.
35       */
36      long setData(IData pData) throws TTException;
37  
38      /**
39       * Removing the data from the storage.
40       * 
41       * @param pData
42       *            to be removed
43       * @throws TTException
44       */
45      void removeData(final IData pData) throws TTException;
46  
47      /**
48       * Simple commit of this bucket transaction to store the newest version.
49       * 
50       * @throws if
51       *             anything weird happens
52       */
53      void commit() throws TTException;
54  
55      /**
56       * Simple commit blocked of this bucket transaction to store the newest version.
57       * 
58       * @throws if
59       *             anything weird happens
60       */
61      void commitBlocked() throws TTException;
62      
63  }