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
FieldsModifier and TypeFieldDescriptionFull event list.Default event filter.static final intDefault number of receiving worker threads.static final intDefault number of sending worker threads. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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
Modifier and TypeMethodDescriptionGet the full list of supported events.Get the default event filter.intGet the number of events that are supported.Get the list of events that are filtered in.Getter with improved name for configuration-as-code.intThe number of threads to handle incoming events with.intThe number of worker threads that sends approvals/review commands.intReplication cache expiration in minutes.voidsetInterestingEvents(List<String> events) Set events that are filtered in.voidsetNumberOfReceivingWorkerThreads(int numberOfReceivingWorkerThreads) NumberOfReceivingWorkerThreads.voidsetNumberOfSendingWorkerThreads(int numberOfSendingWorkerThreads) NumberOfSendingWorkerThreads.voidsetReplicationCacheExpirationInMinutes(int replicationCacheExpirationInMinutes) Replication cache expiration in minutes.voidsetValues(net.sf.json.JSONObject formData) Sets all config values from the provided JSONObject.voidUpdate the server event filter.
-
Field Details
-
DEFAULT_NR_OF_RECEIVING_WORKER_THREADS
public static final int DEFAULT_NR_OF_RECEIVING_WORKER_THREADSDefault number of receiving worker threads.- See Also:
-
DEFAULT_NR_OF_SENDING_WORKER_THREADS
public static final int DEFAULT_NR_OF_SENDING_WORKER_THREADSDefault number of sending worker threads.- See Also:
-
DEFAULT_EVENT_FILTER
Default event filter. -
ALL_EVENTS
Full event list.
-
-
Constructor Details
-
PluginConfig
@DataBoundConstructor public PluginConfig()Constructs a config with default data. -
PluginConfig
public PluginConfig(net.sf.json.JSONObject formData) Constructor.- Parameters:
formData- the data.
-
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 Details
-
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:
getNumberOfReceivingWorkerThreadsin 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:
-
getNumberOfSendingWorkerThreads
public int getNumberOfSendingWorkerThreads()The number of worker threads that sends approvals/review commands.- Specified by:
getNumberOfSendingWorkerThreadsin 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:
-
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
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
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
Set events that are filtered in.- Parameters:
events- List of events.
-
updateEventFilter
public void updateEventFilter()Update the server event filter. -
getDefaultEventFilter
Get the default event filter.- Returns:
- the event list
-
getAllEvents
Get the full list of supported events.- Returns:
- the event list
-