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