1   package eu.fbk.knowledgestore.runtime;
2   
3   import java.io.IOException;
4   
5   /**
6    * Signals a non-recoverable data corruption situation.
7    * <p>
8    * This exception is thrown by operation operating on persistent data structures that detect that
9    * those structures are missing or corrupted. The expected recovery procedure consists in
10   * reinitializing those structures and re-populating them: this can be done by the KnowledgeStore
11   * only for some auxiliary structures, while in the general case manual intervention from an
12   * administrator is required.
13   * </p>
14   * <p>
15   * This exception is introduced to differentiate from other <tt>IOException</tt> that do not imply
16   * a corruption of stored data, and as such may be addressed by fixing their cause and re-attempt
17   * the operation. A <tt>DataCorruptedException</tt> provides a trigger for recovery procedures
18   * possibly performed automatically by the system or some external code accessing it.
19   * </p>
20   */
21  public class DataCorruptedException extends IOException {
22  
23      private static final long serialVersionUID = 1L;
24  
25      /**
26       * Creates a new instance with the optional error message specified.
27       * 
28       * @param message
29       *            an optional error message
30       */
31      public DataCorruptedException(final String message) {
32          this(message, null);
33      }
34  
35      /**
36       * Creates a new instance with the optional error message and cause specified.
37       * 
38       * @param message
39       *            an optional message providing additional information
40       * @param cause
41       *            the optional cause of this exception
42       */
43      public DataCorruptedException(final String message, final Throwable cause) {
44          super(message, cause);
45      }
46  
47  }