public final class RuntimeEnvironment
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBugPage()
Returns the bug page for the history listing
|
java.lang.String |
getBugPattern()
Returns the bug regex for the history listing
|
int |
getCachePages() |
Configuration |
getConfiguration() |
java.lang.String |
getCtags()
Get the name of the ctags program in use
|
java.lang.String |
getDatabaseDriver() |
java.lang.String |
getDatabaseUrl() |
java.io.File |
getDataRootFile()
Get a file representing the index database
|
java.lang.String |
getDataRootPath()
Get the path to the where the index database is stored
|
java.util.Date |
getDateForLastIndexRun() |
Project |
getDefaultProject()
Get the project that is specified to be the default project to use.
|
int |
getHistoryReaderTimeLimit()
Get the max time a SMC operation may use to avoid beeing cached
|
int |
getHitsPerPage() |
IgnoredNames |
getIgnoredNames() |
int |
getIndexWordLimit()
Chandan wrote the following answer on the opengrok-discuss list:
"Traditionally search engines (specially spiders) think that large files
are junk.
|
static RuntimeEnvironment |
getInstance()
Get the one and only instance of the RuntimeEnvironment
|
java.util.List<Project> |
getProjects()
Get all of the projects
|
java.util.List<RepositoryInfo> |
getRepositories() |
java.lang.String |
getReviewPage()
Returns the review(ARC) page for the history listing
|
java.lang.String |
getReviewPattern()
Returns the review(ARC) regex for the history listing
|
java.lang.Integer |
getScanningDepth() |
java.io.File |
getSourceRootFile()
Get a file representing the directory where the sources are located
|
java.lang.String |
getSourceRootPath()
Get the path to where the sources are located
|
java.lang.String |
getUrlPrefix()
Get the context name of the web application
|
java.lang.String |
getUserPage()
Returns the user page for the history listing
|
java.lang.String |
getWebappLAF() |
boolean |
hasProjects()
Do we have projects?
|
boolean |
isAllowLeadingWildcard()
Is leading wildcards allowed?
|
boolean |
isCompressXref()
Are we using copressed HTML files?
|
boolean |
isGenerateHtml()
Should we generate HTML or not during the indexing phase
|
boolean |
isIndexVersionedFilesOnly() |
boolean |
isOptimizeDatabase() |
boolean |
isQuickContextScan() |
boolean |
isRemoteScmSupported() |
boolean |
isUsingLuceneLocking() |
boolean |
isVerbose()
Is the verbosity flag turned on?
|
void |
readConfiguration(java.io.File file)
Read an configuration file and set it as the current configuration.
|
void |
register()
Register this thread in the thread/configuration map (so that all
subsequent calls to the RuntimeEnvironment from this thread will use
the same configuration
|
void |
setAllowLeadingWildcard(boolean allowLeadingWildcard)
Specify if a search may start with a wildcard.
|
void |
setBugPage(java.lang.String bugPage)
Sets the bug page for the history listing
|
void |
setBugPattern(java.lang.String bugPattern)
Sets the bug regex for the history listing
|
void |
setCachePages(int cachePages) |
void |
setCompressXref(boolean compressXref)
Set if we should compress the xref files or not
|
void |
setConfiguration(Configuration configuration) |
void |
setCtags(java.lang.String ctags)
Specify the CTags program to use
|
void |
setDatabaseDriver(java.lang.String databaseDriver) |
void |
setDatabaseUrl(java.lang.String databaseUrl) |
void |
setDataRoot(java.lang.String dataRoot)
Set the path to where the index database is stored
|
void |
setDefaultProject(Project defaultProject)
Set the project that is specified to be the default project to use.
|
void |
setGenerateHtml(boolean generateHtml)
Specify if we should generate HTML or not during the indexing phase
|
void |
setHistoryReaderTimeLimit(int historyReaderTimeLimit)
Specify the maximum time a SCM operation should take before it will
be cached (in ms)
|
void |
setHitsPerPage(int hitsPerPage) |
void |
setIgnoredNames(IgnoredNames ignoredNames) |
void |
setIndexVersionedFilesOnly(boolean indexVersionedFilesOnly) |
void |
setIndexWordLimit(int indexWordLimit)
Set the number of words in a file Lucene will index.
|
void |
setOptimizeDatabase(boolean optimizeDatabase) |
void |
setProjects(java.util.List<Project> projects)
Set the list of the projects
|
void |
setQuickContextScan(boolean quickContextScan) |
void |
setRemoteScmSupported(boolean supported) |
void |
setRepositories(java.util.List<RepositoryInfo> repositories)
Set the map of external SCM repositories
|
void |
setReviewPage(java.lang.String reviewPage)
Sets the review(ARC) page for the history listing
|
void |
setReviewPattern(java.lang.String reviewPattern)
Sets the review(ARC) regex for the history listing
|
void |
setScanningDepth(java.lang.Integer scanningDepth) |
void |
setSourceRoot(java.lang.String sourceRoot)
Specify the source root
|
void |
setStoreHistoryCacheInDB(boolean store)
Set whether the history cache should be stored in a database.
|
void |
setUrlPrefix(java.lang.String urlPrefix)
Set the web context name
|
void |
setUseHistoryCache(boolean useHistoryCache)
Specify if we should use history cache or not
|
void |
setUserPage(java.lang.String userPage)
Sets the user page for the history listing
|
void |
setUsingLuceneLocking(boolean useLuceneLocking) |
void |
setVerbose(boolean verbose)
Set the verbosity flag (to add extra debug information in output)
|
void |
setWebappLAF(java.lang.String laf) |
boolean |
startConfigurationListenerThread(java.net.SocketAddress endpoint)
Start a thread to listen on a socket to receive new configurations
to use.
|
void |
stopConfigurationListenerThread()
Try to stop the configuration listener thread
|
boolean |
storeHistoryCacheInDB()
Should the history cache be stored in a database instead of in XML
files?
|
boolean |
useHistoryCache()
Is history cache currently enabled?
|
boolean |
validateExuberantCtags()
Validate that I have a Exuberant ctags program I may use
|
protected void |
writeConfiguration() |
void |
writeConfiguration(java.io.File file)
Write the current configuration to a file
|
void |
writeConfiguration(java.net.InetAddress host,
int port)
Write the current configuration to a socket
|
public static RuntimeEnvironment getInstance()
public java.lang.Integer getScanningDepth()
public void setScanningDepth(java.lang.Integer scanningDepth)
public java.lang.String getDataRootPath()
public java.io.File getDataRootFile()
public void setDataRoot(java.lang.String dataRoot)
dataRoot
- the index databasepublic java.lang.String getSourceRootPath()
public java.io.File getSourceRootFile()
public void setSourceRoot(java.lang.String sourceRoot)
sourceRoot
- the location of the sourcespublic boolean hasProjects()
public java.util.List<Project> getProjects()
public void setProjects(java.util.List<Project> projects)
projects
- the list of projects to usepublic void register()
public java.lang.String getUrlPrefix()
public void setUrlPrefix(java.lang.String urlPrefix)
urlPrefix
- the web applications context namepublic java.lang.String getCtags()
public void setCtags(java.lang.String ctags)
ctags
- the ctags program to usepublic int getCachePages()
public void setCachePages(int cachePages)
public int getHitsPerPage()
public void setHitsPerPage(int hitsPerPage)
public boolean validateExuberantCtags()
public int getHistoryReaderTimeLimit()
public void setHistoryReaderTimeLimit(int historyReaderTimeLimit)
historyReaderTimeLimit
- the max time in ms before it is cachedpublic boolean useHistoryCache()
public void setUseHistoryCache(boolean useHistoryCache)
useHistoryCache
- set false if you do not want to use history cachepublic boolean storeHistoryCacheInDB()
true
if the cache should be stored in a databasepublic void setStoreHistoryCacheInDB(boolean store)
store
- true
if the cache should be stored in a databasepublic boolean isGenerateHtml()
public void setGenerateHtml(boolean generateHtml)
generateHtml
- set this to true to pregenerate HTMLpublic void setCompressXref(boolean compressXref)
compressXref
- set to true if the generated html files should be
compressedpublic boolean isCompressXref()
public boolean isQuickContextScan()
public void setQuickContextScan(boolean quickContextScan)
public java.util.List<RepositoryInfo> getRepositories()
public void setRepositories(java.util.List<RepositoryInfo> repositories)
repositories
- the repositories to usepublic void setDefaultProject(Project defaultProject)
defaultProject
- The default project to usepublic Project getDefaultProject()
public int getIndexWordLimit()
public void setIndexWordLimit(int indexWordLimit)
indexWordLimit
- the number of words to index in a single filepublic boolean isVerbose()
public void setVerbose(boolean verbose)
verbose
- new valuepublic void setAllowLeadingWildcard(boolean allowLeadingWildcard)
allowLeadingWildcard
- set to true to activate (disabled by default)public boolean isAllowLeadingWildcard()
public IgnoredNames getIgnoredNames()
public void setIgnoredNames(IgnoredNames ignoredNames)
public java.lang.String getUserPage()
public void setUserPage(java.lang.String userPage)
userPage
- the URL fragment preceeding the username from historypublic java.lang.String getBugPage()
public void setBugPage(java.lang.String bugPage)
bugPage
- the URL fragment preceeding the bug IDpublic java.lang.String getBugPattern()
public void setBugPattern(java.lang.String bugPattern)
bugPattern
- the regex to search history commentspublic java.lang.String getReviewPage()
public void setReviewPage(java.lang.String reviewPage)
reviewPage
- the URL fragment preceeding the review page IDpublic java.lang.String getReviewPattern()
public void setReviewPattern(java.lang.String reviewPattern)
reviewPattern
- the regex to search history commentspublic java.lang.String getWebappLAF()
public void setWebappLAF(java.lang.String laf)
public boolean isRemoteScmSupported()
public void setRemoteScmSupported(boolean supported)
public boolean isOptimizeDatabase()
public void setOptimizeDatabase(boolean optimizeDatabase)
public boolean isUsingLuceneLocking()
public void setUsingLuceneLocking(boolean useLuceneLocking)
public boolean isIndexVersionedFilesOnly()
public void setIndexVersionedFilesOnly(boolean indexVersionedFilesOnly)
public java.util.Date getDateForLastIndexRun()
public java.lang.String getDatabaseDriver()
public void setDatabaseDriver(java.lang.String databaseDriver)
public java.lang.String getDatabaseUrl()
public void setDatabaseUrl(java.lang.String databaseUrl)
public void readConfiguration(java.io.File file) throws java.io.IOException
file
- the file to readjava.io.IOException
- if an error occurspublic void writeConfiguration(java.io.File file) throws java.io.IOException
file
- the file to write the configuration intojava.io.IOException
- if an error occurspublic void writeConfiguration(java.net.InetAddress host, int port) throws java.io.IOException
host
- the host address to receive the configurationport
- the port to use on the hostjava.io.IOException
- if an error occursprotected void writeConfiguration() throws java.io.IOException
java.io.IOException
public void setConfiguration(Configuration configuration)
public Configuration getConfiguration()
public void stopConfigurationListenerThread()
public boolean startConfigurationListenerThread(java.net.SocketAddress endpoint)
endpoint
- The socket address to listen on