View Javadoc

1   package org.treetank.api;
2   
3   import java.io.File;
4   import java.io.IOException;
5   
6   import org.treetank.exception.TTException;
7   import org.treetank.exception.TTIOException;
8   
9   /**
10   * 
11   * @author Andreas Rain
12   * 
13   */
14  public interface IFilelistenerWriteTrx extends IFilelistenerReadTrx {
15  
16      /**
17       * Add a new file to the system
18       * 
19       * @param file
20       * @param relativePath
21       */
22      public void addFile(File pFile, String pRelativePath) throws TTException, IOException;
23  
24      /**
25       * Remove file from desired path
26       * 
27       * @throws TTException
28       *             if node couldn't be removed
29       */
30      public void removeFile(String pRelativePath) throws TTException;
31      
32      /**
33       * 
34       * @return int - amount of buckets
35       */
36      public int getCount();
37  
38      /**
39       * Non-blocking commit in TT
40       * @throws TTException
41       *             if this revision couldn't be commited
42       */
43      public void commit() throws TTException;
44      
45      /**
46       * Blocking commit in TT
47       * @throws TTException
48       *             if this revision couldn't be commited
49       */
50      public void commitBlocked() throws TTException;
51  
52      /**
53       * Abort all modifications of the exclusive write transaction.
54       * 
55       * @throws TTIOException
56       *             if this revision couldn't be aborted
57       */
58      public void abort() throws TTException;
59  
60      /**
61       * Add an empty file in case of ENTRY_CREATE event.
62       * @param pRelativePath
63       * @throws TTException
64       * @throws IOException
65       */
66      void addEmptyFile(String pRelativePath) throws TTException, IOException;
67  }