Class PluginConfig
- java.lang.Object
-
- com.sonyericsson.hudson.plugins.gerrit.trigger.config.PluginConfig
-
- All Implemented Interfaces:
com.sonymobile.tools.gerrit.gerritevents.workers.GerritWorkersConfig
public class PluginConfig extends Object implements com.sonymobile.tools.gerrit.gerritevents.workers.GerritWorkersConfig
Configuration bean for the global plugin configuration.- Author:
- rinrinne <rinrin.ne@gmail.com>
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
ALL_EVENTS
Full event list.static List<String>
DEFAULT_EVENT_FILTER
Default event filter.static int
DEFAULT_NR_OF_RECEIVING_WORKER_THREADS
Default number of receiving worker threads.static int
DEFAULT_NR_OF_SENDING_WORKER_THREADS
Default number of sending worker threads.
-
Constructor Summary
Constructors Constructor Description PluginConfig()
Constructs a config with default data.PluginConfig(PluginConfig pluginConfig)
Copy constructor.PluginConfig(net.sf.json.JSONObject formData)
Constructor.PluginConfig(net.sf.json.JSONObject formData, org.kohsuke.stapler.StaplerRequest req)
Unused Constructor?
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>
getAllEvents()
Get the full list of supported events.static List<String>
getDefaultEventFilter()
Get the default event filter.int
getEventTypesSize()
Get the number of events that are supported.List<String>
getFilterIn()
Get the list of events that are filtered in.List<String>
getInterestingEvents()
Getter with improved name for configuration-as-code.int
getNumberOfReceivingWorkerThreads()
The number of threads to handle incoming events with.int
getNumberOfSendingWorkerThreads()
The number of worker threads that sends approvals/review commands.int
getReplicationCacheExpirationInMinutes()
Replication cache expiration in minutes.void
setInterestingEvents(List<String> events)
Set events that are filtered in.void
setNumberOfReceivingWorkerThreads(int numberOfReceivingWorkerThreads)
NumberOfReceivingWorkerThreads.void
setNumberOfSendingWorkerThreads(int numberOfSendingWorkerThreads)
NumberOfSendingWorkerThreads.void
setReplicationCacheExpirationInMinutes(int replicationCacheExpirationInMinutes)
Replication cache expiration in minutes.void
setValues(net.sf.json.JSONObject formData)
Sets all config values from the provided JSONObject.void
updateEventFilter()
Update the server event filter.
-
-
-
Field Detail
-
DEFAULT_NR_OF_RECEIVING_WORKER_THREADS
public static final int DEFAULT_NR_OF_RECEIVING_WORKER_THREADS
Default number of receiving worker threads.- See Also:
- Constant Field Values
-
DEFAULT_NR_OF_SENDING_WORKER_THREADS
public static final int DEFAULT_NR_OF_SENDING_WORKER_THREADS
Default number of sending worker threads.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PluginConfig
@DataBoundConstructor public PluginConfig()
Constructs a config with default data.
-
PluginConfig
public PluginConfig(net.sf.json.JSONObject formData)
Constructor.- Parameters:
formData
- the data.
-
PluginConfig
public PluginConfig(PluginConfig pluginConfig)
Copy constructor.- Parameters:
pluginConfig
- the PluginConfig object to be copied.
-
PluginConfig
public PluginConfig(net.sf.json.JSONObject formData, org.kohsuke.stapler.StaplerRequest req)
Unused Constructor?- Parameters:
formData
- the datareq
- a path.
-
-
Method Detail
-
setValues
public void setValues(net.sf.json.JSONObject formData)
Sets all config values from the provided JSONObject.- Parameters:
formData
- the JSON object with form data.
-
getNumberOfReceivingWorkerThreads
public int getNumberOfReceivingWorkerThreads()
The number of threads to handle incoming events with.- Specified by:
getNumberOfReceivingWorkerThreads
in interfacecom.sonymobile.tools.gerrit.gerritevents.workers.GerritWorkersConfig
- Returns:
- the number of worker threads.
-
setNumberOfReceivingWorkerThreads
public void setNumberOfReceivingWorkerThreads(int numberOfReceivingWorkerThreads)
NumberOfReceivingWorkerThreads.- Parameters:
numberOfReceivingWorkerThreads
- nr of threads.- See Also:
getNumberOfReceivingWorkerThreads()
-
getNumberOfSendingWorkerThreads
public int getNumberOfSendingWorkerThreads()
The number of worker threads that sends approvals/review commands.- Specified by:
getNumberOfSendingWorkerThreads
in interfacecom.sonymobile.tools.gerrit.gerritevents.workers.GerritWorkersConfig
- Returns:
- the number of worker threads.
-
setNumberOfSendingWorkerThreads
public void setNumberOfSendingWorkerThreads(int numberOfSendingWorkerThreads)
NumberOfSendingWorkerThreads.- Parameters:
numberOfSendingWorkerThreads
- nr of threads.- See Also:
getNumberOfSendingWorkerThreads()
-
getReplicationCacheExpirationInMinutes
public int getReplicationCacheExpirationInMinutes()
Replication cache expiration in minutes.- Returns:
- the replicationCacheExpirationInMinutes
-
setReplicationCacheExpirationInMinutes
public void setReplicationCacheExpirationInMinutes(int replicationCacheExpirationInMinutes)
Replication cache expiration in minutes.- Parameters:
replicationCacheExpirationInMinutes
- expiration time to set
-
getEventTypesSize
public int getEventTypesSize()
Get the number of events that are supported.- Returns:
- the size of gerrit event type enum.
-
getFilterIn
public List<String> getFilterIn()
Get the list of events that are filtered in.- Returns:
- the list of events that are filtered in, if all events are included then it will return null.
-
getInterestingEvents
public List<String> getInterestingEvents()
Getter with improved name for configuration-as-code.- Returns:
- the list of events that are filtered in, if all events are included then it will return null.
-
setInterestingEvents
public void setInterestingEvents(List<String> events)
Set events that are filtered in.- Parameters:
events
- List of events.
-
updateEventFilter
public void updateEventFilter()
Update the server event filter.
-
getDefaultEventFilter
public static List<String> getDefaultEventFilter()
Get the default event filter.- Returns:
- the event list
-
-