View Javadoc

1   /*
2    * #%L
3    * Bitrepository Integrity Client
4    * 
5    * $Id$
6    * $HeadURL$
7    * %%
8    * Copyright (C) 2010 - 2012 The State and University Library, The Royal Library and The State Archives, Denmark
9    * %%
10   * This program is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU Lesser General Public License as 
12   * published by the Free Software Foundation, either version 2.1 of the 
13   * License, or (at your option) any later version.
14   * 
15   * This program is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   * GNU General Lesser Public License for more details.
19   * 
20   * You should have received a copy of the GNU General Lesser Public 
21   * License along with this program.  If not, see
22   * <http://www.gnu.org/licenses/lgpl-2.1.html>.
23   * #L%
24   */
25  package org.bitrepository.integrityservice.cache.database;
26  
27  /**
28   * Constants for the tables and columns in the database.
29   */
30  public final class DatabaseConstants {
31      
32      /** Private constructor to prevent instantiation of this utility class.*/
33      private DatabaseConstants() { }
34      
35      // THE FILE INFO TABLE.
36      /** The name of the File Info table.*/
37      public static final String FILE_INFO_TABLE = "fileinfo";
38      /** The key of an entry in the File Info table. Primary automatically generated key. A long/bigint value. */
39      public static final String FI_KEY = "fileinfo_key";
40      /** The key of the file for an entry in the File Info table. A long/bigint value.*/
41      public static final String FI_FILE_KEY = "file_key";
42      /** The key of the pillar for an entry in the File Info table. A long/bigint value.*/
43      public static final String FI_PILLAR_KEY = "pillar_key";
44      /** The checksum value of an entry in the File Info table. A String value, which may be null.*/
45      public static final  String FI_CHECKSUM = "checksum";
46      /** The timestamp for the file creation or latest modification. A date/timestamp value, may be null.*/
47      public static final  String FI_LAST_FILE_UPDATE = "last_file_update";
48      /** The timestamp for the latest checksum calculation. A date/timestamp value, may be null.*/
49      public static final  String FI_LAST_CHECKSUM_UPDATE = "last_checksum_update";
50      /** The state of the file. An integer value for the FileState enumerator. @see FileState.*/
51      public static final  String FI_FILE_STATE = "file_state";
52      /** The state of the checksum. An integer value for the ChecksumState enumerator. @see ChecksumState.*/
53      public static final  String FI_CHECKSUM_STATE = "checksum_state";
54      /** The size of the file. An integer value, may be null */
55      public static final String FI_FILE_SIZE = "file_size";
56      
57      // THE FILES TABLE.
58      /** The name of the Files table.*/
59      public static final  String FILES_TABLE = "files";
60      /** The key of an entry in the files table. Primary automatically generated key. A long/bigint value.*/
61      public static final  String FILES_KEY = "file_key";
62      /** The id of the file. String value.*/
63      public static final  String FILES_ID = "file_id";
64      /** The date, when the file has been entered into the database. A date/timestamp value.*/
65      public static final  String FILES_CREATION_DATE = "creation_date";
66      
67      // THE PILLAR TABLE.
68      /** The name of the pillar table.*/
69      public static final  String PILLAR_TABLE = "pillar";
70      /** The key of an entry in the pillar table. Primary automatically generated key. A long/bigint value.*/
71      public static final  String PILLAR_KEY = "pillar_key";
72      /** The id of the pillar. String value.*/
73      public static final  String PILLAR_ID = "pillar_id";
74      
75      // THE COLLECTIONS TABLE
76      /** The name of the collections table. */
77      public static final String COLLECTIONS_TABLE = "collections";
78      /** The key of an entry in the collections table. Primary automatically generated key. A long/bigint value */
79      public static final String COLLECTION_KEY = "collection_key";
80      /** The id of the collection. String value. */
81      public static final String COLLECTION_ID = "collection_id";
82      
83      // THE STATS TABLE
84      /** The name of the statistics table. A long/bigint value. */
85      public static final String STATS_TABLE = "stats";
86      /** The key for an entry in the statistics table. Primary automatically generated key. A long/bigint value */
87      public static final String STATS_KEY = "stat_key";
88      /** The time that the statistics were created. A date/timestamp*/
89      public static final String STATS_TIME = "stat_time";
90      /** The time the statistics were last updated. A date/timestamp, may be null*/
91      public static final String STATS_LAST_UPDATE = "last_update";
92      /** The key for the collection that the statistics belong to.  A long/bigint value.*/
93      public static final String STATS_COLLECTION_KEY = "collection_key";
94      
95      // THE COLLETION STATISTICS TABLE
96      /** The name of the collection statistics table */
97      public static final String COLLECTION_STATS_TABLE = "collectionstats";
98      /** The key for an entry in the collection statistics table. Primary automatically generated key. A long/bigint value */
99      public static final String CS_KEY = "collectionstat_key";
100     /** Foreign key for referring collection statistics entry to statistics entry. A long/bigint value */
101     public static final String CS_STAT_KEY = "stat_key";
102     /** The value of the total number of files in the collection. A long/bigint value. */
103     public static final String CS_FILECOUNT = "file_count";
104     /** The value of the summed size of the files in the collection. A long/bigint value. */
105     public static final String CS_FILESIZE = "file_size";
106     /** The number of checksum errors in the collection. A long/bigint value. */
107     public static final String CS_CHECKSUM_ERRORS = "checksum_errors_count";
108     
109     // THE PILLAR STATISTICS TABLE
110     /** The name of the pillar statistics table */
111     public static final String PILLAR_STATS_TABLE = "pillarstats";
112     /** The key for an entry in the pillar statistics table. Primary automatically generated key. A long/bigint value */
113     public static final String PS_KEY = "pillarstat_key";
114     /** Foreign key for referring pillar statistics entry to statistics entry. A long/bigint value */
115     public static final String PS_STAT_KEY = "stat_key"; 
116     /** Foreign key for referring pillar statistics entry to the pillar. A long/bigint value */
117     public static final String PS_PILLAR_KEY = "pillar_key";
118     /** The value of the total number of files on the pillar in the collection. A long/bigint value. */
119     public static final String PS_FILE_COUNT = "file_count";
120     /** The value of the summed size of the files on the pillar in the collection. A long/bigint value. */
121     public static final String PS_FILE_SIZE = "file_size";
122     /** The number of files missing on the pillar. A long/bigint value. */
123     public static final String PS_MISSING_FILES_COUNT = "missing_files_count";
124     /** The number of files with checksum errors on the pillar in the collection. A long/bigint value. */
125     public static final String PS_CHECKSUM_ERRORS = "checksum_errors_count";
126     
127     /** The name of the version table entry for the database.*/
128     public final static String DATABASE_VERSION_ENTRY = "integritydb";
129     /** The name of the version entry for the fileinfo table.*/
130     public final static String FILEINFO_TABLE_VERSION_ENTRY = "fileinfo";
131     
132 }
133