public final class RuntimeEnvironment
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getAllowedSymlinks() |
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() |
Filter |
getIncludedNames() |
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.lang.String |
getPathRelativeToSourceRoot(java.io.File file,
int stripCount)
Returns a path relative to source root.
|
java.util.List<Project> |
getProjects()
Get all of the projects
|
java.lang.String |
getRepoCmd(java.lang.String clazzName)
Get the client command to use to access the repository for the given
fully quallified classname.
|
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
|
int |
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 |
getUserPageSuffix()
Returns the user page suffix for the history listing
|
java.lang.String |
getWebappLAF() |
boolean |
hasProjects()
Do we have projects?
|
boolean |
isAllowLeadingWildcard()
Is leading wildcards allowed?
|
boolean |
isChattyStatusPage()
Should status.jsp print internal settings, like paths and database
URLs?
|
boolean |
isCompressXref()
Are we using compressed HTML files?
|
boolean |
isGenerateHtml()
Should we generate HTML or not during the indexing phase
|
boolean |
isIndexVersionedFilesOnly() |
boolean |
isObfuscatingEMailAddresses()
Return whether e-mail addresses should be obfuscated in the xref.
|
boolean |
isOptimizeDatabase() |
boolean |
isPrintProgress()
Is the progress print flag turned on?
|
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.
|
RuntimeEnvironment |
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 |
setAllowedSymlinks(java.util.Set<java.lang.String> allowedSymlinks) |
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 |
setChattyStatusPage(boolean chatty)
Set whether status.jsp should print internal settings.
|
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 |
setIncludedNames(Filter includedNames) |
void |
setIndexVersionedFilesOnly(boolean indexVersionedFilesOnly) |
void |
setIndexWordLimit(int indexWordLimit)
Set the number of words in a file Lucene will index.
|
void |
setObfuscatingEMailAddresses(boolean obfuscate)
Set whether e-mail addresses should be obfuscated in the xref.
|
void |
setOptimizeDatabase(boolean optimizeDatabase) |
void |
setPrintProgress(boolean printP)
Set the printing of progress % flag (user convenience)
|
void |
setProjects(java.util.List<Project> projects)
Set the list of the projects
|
void |
setQuickContextScan(boolean quickContextScan) |
void |
setRemoteScmSupported(boolean supported) |
java.lang.String |
setRepoCmd(java.lang.String clazzName,
java.lang.String cmd)
Set the client command to use to access the repository for the given
fully quallified classname.
|
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(int 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 |
setUserPageSuffix(java.lang.String userPageSuffix)
Sets the user page suffix 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 int getScanningDepth()
public void setScanningDepth(int 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 java.lang.String getPathRelativeToSourceRoot(java.io.File file, int stripCount) throws java.io.IOException
file
- A file to resolvestripCount
- Number of characters past source root to stripjava.io.IOException
- If an IO error occursjava.io.FileNotFoundException
- If the file is not relative to source rootpublic boolean hasProjects()
public java.util.List<Project> getProjects()
public void setProjects(java.util.List<Project> projects)
projects
- the list of projects to usepublic RuntimeEnvironment 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()
true
if the html-files should be compressed.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 boolean isPrintProgress()
public void setPrintProgress(boolean printP)
printP
- 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 Filter getIncludedNames()
public void setIncludedNames(Filter includedNames)
public java.lang.String getUserPage()
public java.lang.String getRepoCmd(java.lang.String clazzName)
clazzName
- name of the targeting classnull
if not yet set, the client command otherwise.public java.lang.String setRepoCmd(java.lang.String clazzName, java.lang.String cmd)
clazzName
- name of the targeting class. If null
this method
does nothing.cmd
- the client command to use. If null
the corresponding
entry for the given clazzName get removed.null
.public void setUserPage(java.lang.String userPage)
userPage
- the URL fragment preceeding the username from historypublic java.lang.String getUserPageSuffix()
public void setUserPageSuffix(java.lang.String userPageSuffix)
userPageSuffix
- the URL fragment following 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 java.util.Set<java.lang.String> getAllowedSymlinks()
public void setAllowedSymlinks(java.util.Set<java.lang.String> allowedSymlinks)
public boolean isObfuscatingEMailAddresses()
public void setObfuscatingEMailAddresses(boolean obfuscate)
public boolean isChattyStatusPage()
true
if status.jsp should show the configuration,
false
otherwisepublic void setChattyStatusPage(boolean chatty)
chatty
- true
if internal settings should be printed,
false
otherwisepublic 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