public class PluginConfigFactory extends Object implements ReloadPluginListener
Modifier and Type | Method and Description |
---|---|
PluginConfig |
getFromGerritConfig(String pluginName)
Returns the configuration for the specified plugin that is stored in the
'gerrit.config' file.
|
PluginConfig |
getFromGerritConfig(String pluginName,
boolean refresh)
Returns the configuration for the specified plugin that is stored in the
'gerrit.config' file.
|
PluginConfig |
getFromProjectConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'project.config' file of the specified project.
|
PluginConfig |
getFromProjectConfig(ProjectState projectState,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'project.config' file of the specified project.
|
PluginConfig |
getFromProjectConfigWithInheritance(com.google.gerrit.reviewdb.client.Project.NameKey projectName,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'project.config' file of the specified project.
|
PluginConfig |
getFromProjectConfigWithInheritance(ProjectState projectState,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'project.config' file of the specified project.
|
org.eclipse.jgit.lib.Config |
getGlobalPluginConfig(String pluginName)
Returns the configuration for the specified plugin that is stored in the
plugin configuration file '
etc/<plugin-name>.config '. |
org.eclipse.jgit.lib.Config |
getProjectPluginConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'
<plugin-name>.config ' file in the 'refs/meta/config' branch of
the specified project. |
org.eclipse.jgit.lib.Config |
getProjectPluginConfig(ProjectState projectState,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'
<plugin-name>.config ' file in the 'refs/meta/config' branch of
the specified project. |
org.eclipse.jgit.lib.Config |
getProjectPluginConfigWithInheritance(com.google.gerrit.reviewdb.client.Project.NameKey projectName,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'
<plugin-name>.config ' file in the 'refs/meta/config' branch of
the specified project. |
org.eclipse.jgit.lib.Config |
getProjectPluginConfigWithInheritance(ProjectState projectState,
String pluginName)
Returns the configuration for the specified plugin that is stored in the
'
<plugin-name>.config ' file in the 'refs/meta/config' branch of
the specified project. |
void |
onReloadPlugin(Plugin oldPlugin,
Plugin newPlugin) |
public PluginConfig getFromGerritConfig(String pluginName)
pluginName
- the name of the plugin for which the configuration should
be returnedpublic PluginConfig getFromGerritConfig(String pluginName, boolean refresh)
pluginName
- the name of the plugin for which the configuration should
be returnedrefresh
- if true
it is checked if the 'gerrit.config'
file was modified and if yes the Gerrit configuration is reloaded,
if false
the cached Gerrit configuration is usedpublic PluginConfig getFromProjectConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName, String pluginName) throws NoSuchProjectException
projectName
- the name of the project for which the plugin
configuration should be returnedpluginName
- the name of the plugin for which the configuration should
be returnedNoSuchProjectException
- thrown if the specified project does not
existpublic PluginConfig getFromProjectConfig(ProjectState projectState, String pluginName)
projectState
- the project for which the plugin configuration should
be returnedpluginName
- the name of the plugin for which the configuration should
be returnedpublic PluginConfig getFromProjectConfigWithInheritance(com.google.gerrit.reviewdb.client.Project.NameKey projectName, String pluginName) throws NoSuchProjectException
projectName
- the name of the project for which the plugin
configuration should be returnedpluginName
- the name of the plugin for which the configuration should
be returnedNoSuchProjectException
- thrown if the specified project does not
existpublic PluginConfig getFromProjectConfigWithInheritance(ProjectState projectState, String pluginName)
projectState
- the project for which the plugin configuration should
be returnedpluginName
- the name of the plugin for which the configuration should
be returnedpublic org.eclipse.jgit.lib.Config getGlobalPluginConfig(String pluginName)
etc/<plugin-name>.config
'.
The plugin configuration is only loaded once and is then cached.pluginName
- the name of the plugin for which the configuration should
be returnedetc/<plugin-name>.config
' filepublic org.eclipse.jgit.lib.Config getProjectPluginConfig(com.google.gerrit.reviewdb.client.Project.NameKey projectName, String pluginName) throws NoSuchProjectException
<plugin-name>.config
' file in the 'refs/meta/config' branch of
the specified project.projectName
- the name of the project for which the plugin
configuration should be returnedpluginName
- the name of the plugin for which the configuration should
be returned<plugin-name>.config
'
file of the specified projectNoSuchProjectException
- thrown if the specified project does not
existpublic org.eclipse.jgit.lib.Config getProjectPluginConfig(ProjectState projectState, String pluginName)
<plugin-name>.config
' file in the 'refs/meta/config' branch of
the specified project.projectState
- the project for which the plugin configuration should
be returnedpluginName
- the name of the plugin for which the configuration should
be returned<plugin-name>.config
'
file of the specified projectpublic org.eclipse.jgit.lib.Config getProjectPluginConfigWithInheritance(com.google.gerrit.reviewdb.client.Project.NameKey projectName, String pluginName) throws NoSuchProjectException
<plugin-name>.config
' file in the 'refs/meta/config' branch of
the specified project. Parameters which are not set in the
'<plugin-name>.config
' of this project are inherited from the
parent project's '<plugin-name>.config
' files.
E.g.: child project: [mySection "mySubsection"] myKey = childValue
parent project: [mySection "mySubsection"] myKey = parentValue anotherKey =
someValue
return: [mySection "mySubsection"] myKey = childValue anotherKey =
someValueprojectName
- the name of the project for which the plugin
configuration should be returnedpluginName
- the name of the plugin for which the configuration should
be returned<plugin-name>.config
'
file of the specified project with inheriting non-set parameters
from the parent projectsNoSuchProjectException
- thrown if the specified project does not
existpublic org.eclipse.jgit.lib.Config getProjectPluginConfigWithInheritance(ProjectState projectState, String pluginName)
<plugin-name>.config
' file in the 'refs/meta/config' branch of
the specified project. Parameters which are not set in the
'<plugin-name>.config
' of this project are inherited from the
parent project's '<plugin-name>.config
' files.
E.g.: child project: [mySection "mySubsection"] myKey = childValue
parent project: [mySection "mySubsection"] myKey = parentValue anotherKey =
someValue
return: [mySection "mySubsection"] myKey = childValue anotherKey =
someValueprojectState
- the project for which the plugin configuration should
be returnedpluginName
- the name of the plugin for which the configuration should
be returned<plugin-name>.config
'
file of the specified project with inheriting non-set parameters
from the parent projectspublic void onReloadPlugin(Plugin oldPlugin, Plugin newPlugin)
onReloadPlugin
in interface ReloadPluginListener