public class PluginConfigFactory extends java.lang.Object implements ReloadPluginListener
Modifier and Type | Method and Description |
---|---|
PluginConfig |
getFromGerritConfig(java.lang.String pluginName)
Returns the configuration for the specified plugin that is stored in the 'gerrit.config' file.
|
PluginConfig |
getFromGerritConfig(java.lang.String pluginName,
boolean refresh)
Returns the configuration for the specified plugin that is stored in the 'gerrit.config' file.
|
PluginConfig |
getFromProjectConfig(Project.NameKey projectName,
java.lang.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,
java.lang.String pluginName)
Returns the configuration for the specified plugin that is stored in the 'project.config' file
of the specified project.
|
PluginConfig |
getFromProjectConfigWithInheritance(Project.NameKey projectName,
java.lang.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,
java.lang.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(java.lang.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(Project.NameKey projectName,
java.lang.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,
java.lang.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(Project.NameKey projectName,
java.lang.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,
java.lang.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 |
getProjectPluginConfigWithMergedInheritance(Project.NameKey projectName,
java.lang.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 |
getProjectPluginConfigWithMergedInheritance(ProjectState projectState,
java.lang.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(java.lang.String pluginName)
The returned plugin configuration provides access to all parameters of the 'gerrit.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: [plugin "my-plugin"] myKey = myValue
pluginName
- the name of the plugin for which the configuration should be returnedpublic PluginConfig getFromGerritConfig(java.lang.String pluginName, boolean refresh)
The returned plugin configuration provides access to all parameters of the 'gerrit.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: [plugin "my-plugin"] myKey = myValue
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(Project.NameKey projectName, java.lang.String pluginName) throws NoSuchProjectException
The returned plugin configuration provides access to all parameters of the 'project.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: [plugin "my-plugin"] myKey = myValue
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, java.lang.String pluginName)
The returned plugin configuration provides access to all parameters of the 'project.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: [plugin "my-plugin"] myKey = myValue
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(Project.NameKey projectName, java.lang.String pluginName) throws NoSuchProjectException
The returned plugin configuration provides access to all parameters of the 'project.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: child project: [plugin "my-plugin"] myKey = childValue
parent project: [plugin "my-plugin"] myKey = parentValue anotherKey = someValue
return: [plugin "my-plugin"] myKey = childValue anotherKey = someValue
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, java.lang.String pluginName)
The returned plugin configuration provides access to all parameters of the 'project.config' file that are set in the 'plugin' subsection of the specified plugin.
E.g.: child project: [plugin "my-plugin"] myKey = childValue
parent project: [plugin "my-plugin"] myKey = parentValue anotherKey = someValue
return: [plugin "my-plugin"] myKey = childValue anotherKey = someValue
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(java.lang.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(Project.NameKey projectName, java.lang.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, java.lang.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(Project.NameKey projectName, java.lang.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 = someValue
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
project with inheriting non-set parameters from the parent projectsNoSuchProjectException
- thrown if the specified project does not existpublic org.eclipse.jgit.lib.Config getProjectPluginConfigWithMergedInheritance(Project.NameKey projectName, java.lang.String pluginName) throws NoSuchProjectException
<plugin-name>.config
' file in the 'refs/meta/config' branch of the specified project.
Parameters from the '<plugin-name>.config
' of the parent project are appended to this
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 myKey = parentValue anotherKey = someValue
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
project with parameters from the parent projects appended to the project valuesNoSuchProjectException
- thrown if the specified project does not existpublic org.eclipse.jgit.lib.Config getProjectPluginConfigWithInheritance(ProjectState projectState, java.lang.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 = someValue
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
project with inheriting non-set parameters from the parent projectspublic org.eclipse.jgit.lib.Config getProjectPluginConfigWithMergedInheritance(ProjectState projectState, java.lang.String pluginName)
<plugin-name>.config
' file in the 'refs/meta/config' branch of the specified project.
Parameters from the '<plugin-name>.config
' of the parent project are appended to this
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 myKey = parentValue anotherKey = someValue
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
project with inheriting non-set parameters from the parent projectspublic void onReloadPlugin(Plugin oldPlugin, Plugin newPlugin)
onReloadPlugin
in interface ReloadPluginListener