Class 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 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
      • DEFAULT_EVENT_FILTER

        public static final List<String> DEFAULT_EVENT_FILTER
        Default event filter.
      • ALL_EVENTS

        public static final List<String> ALL_EVENTS
        Full event list.
    • 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 data
        req - 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 interface com.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 interface com.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
      • getAllEvents

        public static List<String> getAllEvents()
        Get the full list of supported events.
        Returns:
        the event list