001/*
002 * #%L
003 * Netarchivesuite - wayback
004 * %%
005 * Copyright (C) 2005 - 2014 The Royal Danish Library, the Danish State and University Library,
006 *             the National Library of France and the Austrian National Library.
007 * %%
008 * This program is free software: you can redistribute it and/or modify
009 * it under the terms of the GNU Lesser General Public License as
010 * published by the Free Software Foundation, either version 2.1 of the
011 * License, or (at your option) any later version.
012 * 
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Lesser Public License for more details.
017 * 
018 * You should have received a copy of the GNU General Lesser Public
019 * License along with this program.  If not, see
020 * <http://www.gnu.org/licenses/lgpl-2.1.html>.
021 * #L%
022 */
023
024package dk.netarkivet.wayback;
025
026import dk.netarkivet.common.utils.Settings;
027
028/**
029 * Settings specific to the wayback module of NetarchiveSuite.
030 */
031public class WaybackSettings {
032    /**
033     * The default place in classpath where the settings file can be found.
034     */
035    private static final String DEFAULT_SETTINGS_CLASSPATH = "dk/netarkivet/wayback/settings.xml";
036
037    /*
038     * The static initialiser is called when the class is loaded. It will add default values for all settings defined in
039     * this class, by loading them from a settings.xml file in classpath.
040     */
041    static {
042        Settings.addDefaultClasspathSettings(DEFAULT_SETTINGS_CLASSPATH);
043    }
044
045    /**
046     * Setting specifying the name of the class used to canonicalize urls. This class must implement the interface
047     * org.archive.wayback.UrlCanonicalizer .
048     */
049    public static String URL_CANONICALIZER_CLASSNAME = "settings.wayback.urlcanonicalizer.classname";
050
051    /**
052     * There now follows a list of hibernate-related properties.
053     */
054
055    /**
056     * c3p0 is the database connection manager used by hibernate. See c3p0 documentation for their meaning.
057     */
058    public static String C3P0_ACQUIRE_INCREMENT = "settings.wayback.hibernate.c3p0.acquireIncrement";
059    public static String C3P0_IDLE_PERIOD = "settings.wayback.hibernate.c3p0.idleTestPeriod";
060    public static String C3P0_MAX_SIZE = "settings.wayback.hibernate.c3p0.maxSize";
061    public static String C3P0_MAX_STATEMENTS = "settings.wayback.hibernate.c3p0.maxStatements";
062    public static String C3P0_MIN_SIZE = "settings.wayback.hibernate.c3p0.minSize";
063    public static String C3P0_TIMEOUT = "settings.wayback.hibernate.c3p0.timeout";
064    /**
065     * These are the hibernate specific properties. See hibernate documentation for their meaning.
066     */
067    public static String HIBERNATE_DB_URL = "settings.wayback.hibernate.connectionUrl";
068    public static String HIBERNATE_DB_DRIVER = "settings.wayback.hibernate.dbDriverClass";
069    public static String HIBERNATE_REFLECTION_OPTIMIZER = "settings.wayback.hibernate.useReflectionOptimizer";
070    public static String HIBERNATE_TRANSACTION_FACTORY = "settings.wayback.hibernate.transactionFactory";
071    public static String HIBERNATE_DIALECT = "settings.wayback.hibernate.dialect";
072    public static String HIBERNATE_SHOW_SQL = "settings.wayback.hibernate.showSql";
073    public static String HIBERNATE_FORMAT_SQL = "settings.wayback.hibernate.formatSql";
074    public static String HIBERNATE_HBM2DDL_AUTO = "settings.wayback.hibernate.hbm2ddlAuto";
075    public static String HIBERNATE_USERNAME = "settings.wayback.hibernate.user";
076    public static String HIBERNATE_PASSWORD = "settings.wayback.hibernate.password";
077
078    /**
079     * The replica to be used by the wayback indexer.
080     */
081    public static String WAYBACK_REPLICA = "settings.wayback.indexer.replicaId";
082
083    /**
084     * The directory to which batch output is written during indexing.
085     */
086    public static String WAYBACK_INDEX_TEMPDIR = "settings.wayback.indexer.tempBatchOutputDir";
087
088    /**
089     * The directory to which batch output is moved after a batch indexing job is successfully completed, and from which
090     * the output is read by the aggregator.
091     */
092    public static String WAYBACK_BATCH_OUTPUTDIR = "settings.wayback.indexer.finalBatchOutputDir";
093
094    /**
095     * The maximum number of times an archive file may generate a batch error during indexing before we give up on it.
096     */
097    public static String WAYBACK_INDEXER_MAXFAILEDATTEMPTS = "settings.wayback.indexer.maxFailedAttempts";
098
099    /**
100     * The delay in milliseconds before the producer thread is started.
101     */
102    public static String WAYBACK_INDEXER_PRODUCER_DELAY = "settings.wayback.indexer.producerDelay";
103
104    /**
105     * The interval, in milliseconds, between successive fecthes of the complete file list from the archive.
106     */
107    public static String WAYBACK_INDEXER_PRODUCER_INTERVAL = "settings.wayback.indexer.producerInterval";
108
109    /**
110     * How long ago to fetch newer files from the archive for indexing, measured in milliseconds since now. Default
111     * values is one day (86400000)
112     */
113    public static final String WAYBACK_INDEXER_RECENT_PRODUCER_SINCE = "settings.wayback.indexer.recentProducerSince";
114
115    /**
116     * How often to fetch recent files from the archive (milliseconds). Default values is a half hour (1800000).
117     */
118    public static final String WAYBACK_INDEXER_RECENT_PRODUCER_INTERVAL = "settings.wayback.indexer.recentProducerInterval";
119
120    /**
121     * The number of consumer threads to run.
122     */
123    public static String WAYBACK_INDEXER_CONSUMER_THREADS = "settings.wayback.indexer.consumerThreads";
124
125    /**
126     * A file containing a list of files which have been archived and therefore do not need to be archived again. This
127     * key may be unset.
128     */
129    public static String WAYBACK_INDEXER_INITIAL_FILES = "settings.wayback.indexer.initialFiles";
130
131    /** -------------------------Aggregator Settings--------------------------- */
132
133    /** The directory the Aggregator places the Aggregated and sorted files into. */
134    public static String WAYBACK_AGGREGATOR_OUTPUT_DIR = "settings.wayback.aggregator.indexFileOutputDir";
135
136    /** The directory used by the aggregator to store temporary files. */
137    public static String WAYBACK_AGGREGATOR_TEMP_DIR = "settings.wayback.aggregator.tempAggregatorDir";
138
139    /** The time to between each scheduled aggregation run (in milliseconds). */
140    public static String WAYBACK_AGGREGATOR_AGGREGATION_INTERVAL = "settings.wayback.aggregator.aggregationInterval";
141
142    /**
143     * The maximum size of the Intermediate index file in MB. When this limit is reached a new index file is created and
144     * new indexes are added to this file. In the case of a 0 value, the intermediate index file will always be merged
145     * into the main index file.
146     */
147    public static String WAYBACK_AGGREGATOR_MAX_INTERMEDIATE_INDEX_FILE_SIZE = "settings.wayback.aggregator.maxIntermediateIndexFileSize";
148
149    /**
150     * The maximum size of the main wayback index file in MB. When this limit is reached a new index file is created and
151     * new indexes are added to this file. The old index file will be rename to ${finalIndexFileSizeLimit}.
152     */
153    public static String WAYBACK_AGGREGATOR_MAX_MAIN_INDEX_FILE_SIZE = "settings.wayback.aggregator.maxMainIndexFileSize";
154
155    /**
156     * The maximum number of files in the resourcestore cache. The default is 100.
157     */
158    public static String WAYBACK_RESOURCESTORE_CACHE_MAXFILES = "settings.wayback.resourcestore.maxfiles";
159
160    /** The cachedirectory. */
161    public static String WAYBACK_RESOURCESTORE_CACHE_DIR = "settings.wayback.resourcestore.cachedir";
162
163}