org.opensolaris.opengrok.configuration
Class Configuration

java.lang.Object
  extended by org.opensolaris.opengrok.configuration.Configuration

public final class Configuration
extends java.lang.Object

Placeholder class for all configuration variables. Due to the multithreaded nature of the web application, each thread will use the same instance of the configuration object for each page request. Class and methods should have package scope, but that didn't work with the XMLDecoder/XMLEncoder.


Constructor Summary
Configuration()
          Creates a new instance of Configuration
 
Method Summary
 java.lang.String getBugPage()
           
 java.lang.String getBugPattern()
           
 int getCachePages()
           
 java.lang.String getCtags()
           
 java.lang.String getDatabaseDriver()
           
 java.lang.String getDatabaseUrl()
           
 java.lang.String getDataRoot()
           
 java.util.Date getDateForLastIndexRun()
           
 Project getDefaultProject()
           
 int getHistoryCacheTime()
          How long can a history request take before it's cached? If the time is exceeded, the result is cached.
 int getHitsPerPage()
           
 IgnoredNames getIgnoredNames()
           
 int getIndexWordLimit()
           
 java.util.List<Project> getProjects()
           
 java.util.List<RepositoryInfo> getRepositories()
           
 java.lang.String getReviewPage()
           
 java.lang.String getReviewPattern()
           
 java.lang.Integer getScanningDepth()
           
 java.lang.String getSourceRoot()
           
 java.lang.String getUrlPrefix()
           
 java.lang.String getUserPage()
           
 java.lang.String getWebappLAF()
           
 java.lang.String getXMLRepresentationAsString()
           
 boolean isAllowLeadingWildcard()
           
 boolean isCompressXref()
           
 boolean isGenerateHtml()
           
 boolean isHistoryCache()
          Should the history log be cached?
 boolean isHistoryCacheInDB()
          Should the history cache be stored in a database? If yes, JDBCHistoryCache will be used to cache the history; otherwise, FileHistoryCache is used.
 boolean isIndexVersionedFilesOnly()
           
 boolean isOptimizeDatabase()
           
 boolean isQuickContextScan()
           
 boolean isRemoteScmSupported()
           
 boolean isUsingLuceneLocking()
           
 boolean isVerbose()
           
static Configuration makeXMLStringAsConfiguration(java.lang.String xmlconfig)
           
static Configuration read(java.io.File file)
           
 void setAllowLeadingWildcard(boolean allowLeadingWildcard)
           
 void setBugPage(java.lang.String bugPage)
           
 void setBugPattern(java.lang.String bugPattern)
           
 void setCachePages(int cachePages)
           
 void setCompressXref(boolean compressXref)
           
 void setCtags(java.lang.String ctags)
           
 void setDatabaseDriver(java.lang.String databaseDriver)
           
 void setDatabaseUrl(java.lang.String databaseUrl)
           
 void setDataRoot(java.lang.String dataRoot)
           
 void setDefaultProject(Project defaultProject)
           
 void setGenerateHtml(boolean generateHtml)
           
 void setHistoryCache(boolean historyCache)
          Set whether history should be cached.
 void setHistoryCacheInDB(boolean historyCacheInDB)
          Set whether the history cache should be stored in a database, and JDBCHistoryCache should be used instead of FileHistoryCache.
 void setHistoryCacheTime(int historyCacheTime)
          Set the maximum time a history request can take before it's cached.
 void setHitsPerPage(int hitsPerPage)
           
 void setIgnoredNames(IgnoredNames ignoredNames)
           
 void setIndexVersionedFilesOnly(boolean indexVersionedFilesOnly)
           
 void setIndexWordLimit(int indexWordLimit)
           
 void setOptimizeDatabase(boolean optimizeDatabase)
           
 void setProjects(java.util.List<Project> projects)
           
 void setQuickContextScan(boolean quickContextScan)
           
 void setRemoteScmSupported(boolean remoteScmSupported)
           
 void setRepositories(java.util.List<RepositoryInfo> repositories)
           
 void setReviewPage(java.lang.String reviewPage)
           
 void setReviewPattern(java.lang.String reviewPattern)
           
 void setScanningDepth(java.lang.Integer scanningDepth)
           
 void setSourceRoot(java.lang.String sourceRoot)
           
 void setUrlPrefix(java.lang.String urlPrefix)
           
 void setUserPage(java.lang.String userPage)
           
 void setUsingLuceneLocking(boolean useLuceneLocking)
           
 void setVerbose(boolean verbose)
           
 void setWebappLAF(java.lang.String webappLAF)
           
 void write(java.io.File file)
          Write the current configuration to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Creates a new instance of Configuration

Method Detail

getScanningDepth

public java.lang.Integer getScanningDepth()

setScanningDepth

public void setScanningDepth(java.lang.Integer scanningDepth)

getCtags

public java.lang.String getCtags()

setCtags

public void setCtags(java.lang.String ctags)

getCachePages

public int getCachePages()

setCachePages

public void setCachePages(int cachePages)

getHitsPerPage

public int getHitsPerPage()

setHitsPerPage

public void setHitsPerPage(int hitsPerPage)

isHistoryCache

public boolean isHistoryCache()
Should the history log be cached?

Returns:
true if a HistoryCache implementation should be used, false otherwise

setHistoryCache

public void setHistoryCache(boolean historyCache)
Set whether history should be cached.

Parameters:
historyCache - if true enable history cache

getHistoryCacheTime

public int getHistoryCacheTime()
How long can a history request take before it's cached? If the time is exceeded, the result is cached. This setting only affects FileHistoryCache.

Returns:
the maximum time in milliseconds a history request can take before it's cached

setHistoryCacheTime

public void setHistoryCacheTime(int historyCacheTime)
Set the maximum time a history request can take before it's cached. This setting is only respected if FileHistoryCache is used.

Parameters:
historyCacheTime - maximum time in milliseconds

isHistoryCacheInDB

public boolean isHistoryCacheInDB()
Should the history cache be stored in a database? If yes, JDBCHistoryCache will be used to cache the history; otherwise, FileHistoryCache is used.

Returns:
whether the history cache should be stored in a database

setHistoryCacheInDB

public void setHistoryCacheInDB(boolean historyCacheInDB)
Set whether the history cache should be stored in a database, and JDBCHistoryCache should be used instead of FileHistoryCache.

Parameters:
historyCacheInDB - whether the history cached should be stored in a database

getProjects

public java.util.List<Project> getProjects()

setProjects

public void setProjects(java.util.List<Project> projects)

getSourceRoot

public java.lang.String getSourceRoot()

setSourceRoot

public void setSourceRoot(java.lang.String sourceRoot)

getDataRoot

public java.lang.String getDataRoot()

setDataRoot

public void setDataRoot(java.lang.String dataRoot)

getRepositories

public java.util.List<RepositoryInfo> getRepositories()

setRepositories

public void setRepositories(java.util.List<RepositoryInfo> repositories)

getUrlPrefix

public java.lang.String getUrlPrefix()

setUrlPrefix

public void setUrlPrefix(java.lang.String urlPrefix)

setGenerateHtml

public void setGenerateHtml(boolean generateHtml)

isGenerateHtml

public boolean isGenerateHtml()

setDefaultProject

public void setDefaultProject(Project defaultProject)

getDefaultProject

public Project getDefaultProject()

getIndexWordLimit

public int getIndexWordLimit()

setIndexWordLimit

public void setIndexWordLimit(int indexWordLimit)

isVerbose

public boolean isVerbose()

setVerbose

public void setVerbose(boolean verbose)

setAllowLeadingWildcard

public void setAllowLeadingWildcard(boolean allowLeadingWildcard)

isAllowLeadingWildcard

public boolean isAllowLeadingWildcard()

isQuickContextScan

public boolean isQuickContextScan()

setQuickContextScan

public void setQuickContextScan(boolean quickContextScan)

setIgnoredNames

public void setIgnoredNames(IgnoredNames ignoredNames)

getIgnoredNames

public IgnoredNames getIgnoredNames()

setUserPage

public void setUserPage(java.lang.String userPage)

getUserPage

public java.lang.String getUserPage()

setBugPage

public void setBugPage(java.lang.String bugPage)

getBugPage

public java.lang.String getBugPage()

setBugPattern

public void setBugPattern(java.lang.String bugPattern)

getBugPattern

public java.lang.String getBugPattern()

getReviewPage

public java.lang.String getReviewPage()

setReviewPage

public void setReviewPage(java.lang.String reviewPage)

getReviewPattern

public java.lang.String getReviewPattern()

setReviewPattern

public void setReviewPattern(java.lang.String reviewPattern)

getWebappLAF

public java.lang.String getWebappLAF()

setWebappLAF

public void setWebappLAF(java.lang.String webappLAF)

isRemoteScmSupported

public boolean isRemoteScmSupported()

setRemoteScmSupported

public void setRemoteScmSupported(boolean remoteScmSupported)

isOptimizeDatabase

public boolean isOptimizeDatabase()

setOptimizeDatabase

public void setOptimizeDatabase(boolean optimizeDatabase)

isUsingLuceneLocking

public boolean isUsingLuceneLocking()

setUsingLuceneLocking

public void setUsingLuceneLocking(boolean useLuceneLocking)

setCompressXref

public void setCompressXref(boolean compressXref)

isCompressXref

public boolean isCompressXref()

isIndexVersionedFilesOnly

public boolean isIndexVersionedFilesOnly()

setIndexVersionedFilesOnly

public void setIndexVersionedFilesOnly(boolean indexVersionedFilesOnly)

getDateForLastIndexRun

public java.util.Date getDateForLastIndexRun()

getDatabaseDriver

public java.lang.String getDatabaseDriver()

setDatabaseDriver

public void setDatabaseDriver(java.lang.String databaseDriver)

getDatabaseUrl

public java.lang.String getDatabaseUrl()

setDatabaseUrl

public void setDatabaseUrl(java.lang.String databaseUrl)

write

public void write(java.io.File file)
           throws java.io.IOException
Write the current configuration to a file

Parameters:
file - the file to write the configuration into
Throws:
java.io.IOException - if an error occurs

getXMLRepresentationAsString

public java.lang.String getXMLRepresentationAsString()

read

public static Configuration read(java.io.File file)
                          throws java.io.IOException
Throws:
java.io.IOException

makeXMLStringAsConfiguration

public static Configuration makeXMLStringAsConfiguration(java.lang.String xmlconfig)
                                                  throws java.io.IOException
Throws:
java.io.IOException