Class BuildStatusConfig

java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
org.jenkinsci.plugins.githubautostatus.BuildStatusConfig
All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, Saveable, Loadable, OnMaster

@Extension @Symbol("buildStatusConfig") public class BuildStatusConfig extends GlobalConfiguration
Provides configuration options for this plugin.
Author:
Jeff Pearce (GitHub jeffpearce)
  • Constructor Details

    • BuildStatusConfig

      public BuildStatusConfig()
  • Method Details

    • addCompatibilityAliases

      @Initializer(before=PLUGINS_STARTED) public static void addCompatibilityAliases()
      Adds compatibility aliases to prevent "old data" warnings.
    • get

      public static BuildStatusConfig get()
      Convenience method to get the configuration object
      Returns:
      the configuration object
    • load

      public void load()
      Specified by:
      load in interface Loadable
      Overrides:
      load in class Descriptor<GlobalConfiguration>
    • getDisplayName

      public String getDisplayName()
      Gets human readable name.
      Overrides:
      getDisplayName in class Descriptor<GlobalConfiguration>
      Returns:
      human readable name
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
      Invoked when the global configuration page is submitted
      Overrides:
      configure in class GlobalConfiguration
      Parameters:
      req - Request that represents the form submission
      json - The JSON object that captures the configuration data
      Returns:
      always returns true (allow config page to be closed)
      Throws:
      Descriptor.FormException - exception if a form field is invalid
    • getEnableGithub

      public boolean getEnableGithub()
      Gets whether sending status to GitHub is enabled. For compatibility reasons the flag is stored as the inverse (disableGithub) so that GitHub is enabled by default for users who upgrade from a version prior to the flag.
      Returns:
      true if writing to GitHub is enabled
    • setEnableGithub

      @DataBoundSetter public void setEnableGithub(boolean enableGithub)
      Sets whether sending status to GitHub is enabled.
      Parameters:
      enableGithub - true to enable sending status to GitHub
    • getEnableHttp

      public boolean getEnableHttp()
      Gets whether sending status to HTTP endpoint is enabled.
      Returns:
      true if writing to HTTP is enabled
    • setEnableHttp

      @DataBoundSetter public void setEnableHttp(boolean enableHttp)
      Sets whether sending status to HTTP endpoint is enabled.
      Parameters:
      enableHttp - true to enable sending status to HTTP endpoint
    • getHttpVerifySSL

      public boolean getHttpVerifySSL()
      Gets whether SSL verify is enabled.
      Returns:
      true if verify SSL is enabled
    • setHttpVerifySSL

      @DataBoundSetter public void setHttpVerifySSL(boolean httpVerifySSL)
      Sets whether SSL verify is enabled.
      Parameters:
      httpVerifySSL - true to verify SSL
    • getCredentialsId

      public String getCredentialsId()
      Gets the credentials id.
      Returns:
      the credentials id
    • setCredentialsId

      @DataBoundSetter public void setCredentialsId(String credentialsId)
      Sets the credentials id.
      Parameters:
      credentialsId - the credentials id
    • getHttpCredentialsId

      public String getHttpCredentialsId()
      Gets the HTTP credentials id.
      Returns:
      the credentials id
    • setHttpCredentialsId

      @DataBoundSetter public void setHttpCredentialsId(String httpCredentialsId)
      Sets the HTTP credentials id.
      Parameters:
      httpCredentialsId - the credentials id
    • getHttpEndpoint

      public String getHttpEndpoint()
      Gets the HTTP endpoint URL.
      Returns:
      the endpoint URL
    • setHttpEndpoint

      @DataBoundSetter public void setHttpEndpoint(String httpEndpoint)
      Sets the HTTP endpoint URL.
      Parameters:
      httpEndpoint - the endpoint URL
    • getEnableInfluxDb

      public boolean getEnableInfluxDb()
      Gets whether writing to InfluxDB is enabled.
      Returns:
      true if writing to InfluxDB is enabled
    • setEnableInfluxDb

      @DataBoundSetter public void setEnableInfluxDb(boolean enableInfluxDb)
      Sets whether writing to InfluxDB is enabled.
      Parameters:
      enableInfluxDb - true to enable writing to InfluxDB
    • getInfluxDbUrl

      public String getInfluxDbUrl()
      Gets the InfluxDB URL.
      Returns:
      the URL
    • setInfluxDbUrl

      @DataBoundSetter public void setInfluxDbUrl(String influxDbUrl)
      Sets the InfluxDB URL.
      Parameters:
      influxDbUrl - the URL
    • getInfluxDbDatabase

      public String getInfluxDbDatabase()
      Gets the InfluxDB database.
      Returns:
      the database
    • setInfluxDbDatabase

      @DataBoundSetter public void setInfluxDbDatabase(String influxDbDatabase)
      Sets the InfluxDB database.
      Parameters:
      influxDbDatabase - the database
    • getIgnoreSendingTestResultsToInflux

      public boolean getIgnoreSendingTestResultsToInflux()
      Gets whether to ignore sending test results.
      Returns:
      whether to ignore sending test results
    • setIgnoreSendingTestResultsToInflux

      @DataBoundSetter public void setIgnoreSendingTestResultsToInflux(boolean ignoreSendingTestResultsToInflux)
      2ets whether to ignore sending test results.
      Parameters:
      ignoreSendingTestResultsToInflux - whether to ignore sending test results
    • getIgnoreSendingTestCoverageToInflux

      public boolean getIgnoreSendingTestCoverageToInflux()
      Gets whether to ignore sending test coverage.
      Returns:
      whether to ignore sending test coverage
    • setIgnoreSendingTestCoverageToInflux

      @DataBoundSetter public void setIgnoreSendingTestCoverageToInflux(boolean ignoreSendingTestCoverageToInflux)
      Sets whether to ignore sending test results.
      Parameters:
      ignoreSendingTestCoverageToInflux - whether to ignore sending test results
    • getInfluxDbRetentionPolicy

      public String getInfluxDbRetentionPolicy()
      Gets the InfluxDB retention policy.
      Returns:
      the retention policy
    • setInfluxDbRetentionPolicy

      @DataBoundSetter public void setInfluxDbRetentionPolicy(String influxDbRetentionPolicy)
      Sets the InfluxDB retention policy.
      Parameters:
      influxDbRetentionPolicy - the retention policy
    • getDbVersion

      public Integer getDbVersion()
      Gets the InfluxDB database version.
      Returns:
      the database version
    • setDbVersion

      @DataBoundSetter public void setDbVersion(String dbVersion)
      Sets the InfluxDB database version.
      Parameters:
      dbVersion - the database version
    • setDbVersion

      @DataBoundSetter public void setDbVersion(Integer dbVersion)
    • doFillDbVersionItems

      public ListBoxModel doFillDbVersionItems()
      Fills the list box in the settings page with valid database versions.
    • getEnableStatsd

      public boolean getEnableStatsd()
      Gets whether writing to StatsD is enabled.
      Returns:
      true if writing to StatsD is enabled
    • setEnableStatsd

      @DataBoundSetter public void setEnableStatsd(boolean enableStatsd)
      Sets whether writing to StatsD is enabled.
      Parameters:
      enableStatsd - true to enable writing to StatsD
    • getStatsdHost

      public String getStatsdHost()
      Gets the StatsD host.
      Returns:
      the host
    • setStatsdHost

      @DataBoundSetter public void setStatsdHost(String statsdHost)
      Sets the StatsD host.
      Parameters:
      statsdHost - the host
    • getStatsdPort

      public String getStatsdPort()
      Gets the StatsD port.
      Returns:
      the port
    • setStatsdPort

      @DataBoundSetter public void setStatsdPort(String statsdPort)
      Sets the StatsD port.
      Parameters:
      statsdPort - the port
    • getStatsdBucket

      public String getStatsdBucket()
      Gets the StatsD bucket.
      Returns:
      the bucket
    • setStatsdBucket

      @DataBoundSetter public void setStatsdBucket(String statsdBucket)
      Sets the StatsD bucket.
      Parameters:
      statsdBucket - the bucket
    • getStatsdMaxSize

      public String getStatsdMaxSize()
      Gets the StatsD maximum packet size.
      Returns:
      the maximum packet size
    • setStatsdMaxSize

      @DataBoundSetter public void setStatsdMaxSize(String statsdMaxSize)
      Sets the StatsD maximum packet size.
      Parameters:
      statsdMaxSize - the maximum packet size
    • doFillCredentialsIdItems

      public ListBoxModel doFillCredentialsIdItems(@QueryParameter String credentialsId)
      Fills the list box in the settings page with valid credentials.
      Parameters:
      credentialsId - the current credentials id
      Returns:
      ListBoxModel containing credentials to show
    • doFillHttpCredentialsIdItems

      public ListBoxModel doFillHttpCredentialsIdItems(@QueryParameter String credentialsId)
      Fills the list box in the settings page with valid HTTP credentials.
      Parameters:
      credentialsId - the current credentials id
      Returns:
      ListBoxModel containing credentials to show
    • doCheckCredentialsId

      public FormValidation doCheckCredentialsId(@AncestorInPath Item item, @QueryParameter String value)
      Validates the credentials id.
      Parameters:
      item - context for validation
      value - to validate
      Returns:
      FormValidation
    • doCheckHttpCredentialsId

      public FormValidation doCheckHttpCredentialsId(@AncestorInPath Item item, @QueryParameter String value)
      Validates the HTTP credentials id.
      Parameters:
      item - context for validation
      value - to validate
      Returns:
      FormValidation
    • doCheckHttpEndpoint

      public FormValidation doCheckHttpEndpoint(@AncestorInPath Item item, @QueryParameter String value)
    • getCredentials

      public static <T extends com.cloudbees.plugins.credentials.Credentials> T getCredentials(@Nonnull Class<T> type, @Nonnull String credentialsId)