Configuration.java revision 106
8N/A/*
8N/A * CDDL HEADER START
98N/A *
8N/A * The contents of this file are subject to the terms of the
8N/A * Common Development and Distribution License (the "License").
8N/A * You may not use this file except in compliance with the License.
8N/A *
8N/A * See LICENSE.txt included in this distribution for the specific
8N/A * language governing permissions and limitations under the License.
8N/A *
8N/A * When distributing Covered Code, include this CDDL HEADER in each
8N/A * file and include the License file at LICENSE.txt.
8N/A * If applicable, add the following below this CDDL HEADER, with the
8N/A * fields enclosed by brackets "[]" replaced with your own identifying
8N/A * information: Portions Copyright [yyyy] [name of copyright owner]
8N/A *
8N/A * CDDL HEADER END
8N/A */
8N/A
8N/A/*
8N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
8N/A * Use is subject to license terms.
8N/A */
8N/Apackage org.opensolaris.opengrok.configuration;
8N/A
8N/Aimport java.util.ArrayList;
8N/Aimport java.util.HashMap;
8N/Aimport java.util.List;
8N/Aimport java.util.Map;
8N/Aimport org.opensolaris.opengrok.history.ExternalRepository;
258N/A
8N/A/**
8N/A * Placeholder class for all configuration variables. Due to the multithreaded
8N/A * nature of the web application, each thread will use the same instance of the
253N/A * configuration object for each page request. Class and methods should have
253N/A * package scope, but that didn't work with the XMLDecoder/XMLEncoder.
253N/A */
253N/Apublic class Configuration {
253N/A private String ctags;
253N/A private boolean historyCache;
258N/A private int historyCacheTime;
98N/A private List<Project> projects;
156N/A private String sourceRoot;
98N/A private String dataRoot;
156N/A private Map<String, ExternalRepository> repositories;
98N/A private String urlPrefix;
98N/A private boolean generateHtml;
156N/A private Project defaultProject;
156N/A private int indexWordLimit;
8N/A private boolean verbose;
8N/A
8N/A /** Creates a new instance of Configuration */
8N/A public Configuration() {
8N/A setHistoryCache(true);
8N/A setHistoryCacheTime(30);
8N/A setProjects(new ArrayList<Project>());
8N/A setRepositories(new HashMap<String, ExternalRepository>());
8N/A setUrlPrefix("/source/s?");
8N/A setCtags("ctags");
8N/A setIndexWordLimit(60000);
8N/A setVerbose(false);
8N/A setGenerateHtml(true);
8N/A setQuickContextScan(true);
8N/A }
8N/A
8N/A public String getCtags() {
8N/A return ctags;
8N/A }
8N/A
8N/A public void setCtags(String ctags) {
8N/A this.ctags = ctags;
8N/A }
public boolean isHistoryCache() {
return historyCache;
}
public void setHistoryCache(boolean historyCache) {
this.historyCache = historyCache;
}
public int getHistoryCacheTime() {
return historyCacheTime;
}
public void setHistoryCacheTime(int historyCacheTime) {
this.historyCacheTime = historyCacheTime;
}
public List<Project> getProjects() {
return projects;
}
public void setProjects(List<Project> projects) {
this.projects = projects;
}
public String getSourceRoot() {
return sourceRoot;
}
public void setSourceRoot(String sourceRoot) {
this.sourceRoot = sourceRoot;
}
public String getDataRoot() {
return dataRoot;
}
public void setDataRoot(String dataRoot) {
this.dataRoot = dataRoot;
}
public Map<String, ExternalRepository> getRepositories() {
return repositories;
}
public void setRepositories(Map<String, ExternalRepository> repositories) {
this.repositories = repositories;
}
public String getUrlPrefix() {
return urlPrefix;
}
public void setUrlPrefix(String urlPrefix) {
this.urlPrefix = urlPrefix;
}
public void setGenerateHtml(boolean generateHtml) {
this.generateHtml = generateHtml;
}
public boolean isGenerateHtml() {
return generateHtml;
}
public void setDefaultProject(Project defaultProject) {
this.defaultProject = defaultProject;
}
public Project getDefaultProject() {
return defaultProject;
}
public int getIndexWordLimit() {
return indexWordLimit;
}
public void setIndexWordLimit(int indexWordLimit) {
this.indexWordLimit = indexWordLimit;
}
public boolean isVerbose() {
return verbose;
}
public void setVerbose(boolean verbose) {
this.verbose = verbose;
}
private boolean quickContextScan;
public boolean isQuickContextScan() {
return quickContextScan;
}
public void setQuickContextScan(boolean quickContextScan) {
this.quickContextScan = quickContextScan;
}
}