Package hudson.model

Class UsageStatistics

All Implemented Interfaces:
ExtensionPoint, Describable<PageDecorator>, PersistentDescriptor, Saveable, Loadable, OnMaster

@Extension public class UsageStatistics extends PageDecorator implements PersistentDescriptor
Author:
Kohsuke Kawaguchi
  • Field Details

    • DISABLED

      public static boolean DISABLED
  • Constructor Details

    • UsageStatistics

      public UsageStatistics()
    • UsageStatistics

      public UsageStatistics(String keyImage)
      Creates an instance with a specific public key image.
  • Method Details

    • isDue

      public boolean isDue()
      Returns true if it's time for us to check for new version.
    • isEnabled

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isEnabled()
      Returns whether between UI configuration, system property, and environment, usage statistics should be submitted.
      Returns:
      true if and only if usage stats should be submitted
      Since:
      TODO
    • getStatData

      public String getStatData() throws IOException
      Gets the encrypted usage stat data to be sent to the Hudson server. Used exclusively by jelly: resources/hudson/model/UsageStatistics/footer.jelly
      Throws:
      IOException
    • getRequiredGlobalConfigPagePermission

      @NonNull public Permission getRequiredGlobalConfigPagePermission()
      Description copied from class: Descriptor
      Returns the permission type needed in order to access the Descriptor.getGlobalConfigPage() for this descriptor. By default, requires Jenkins.ADMINISTER permission. For now this only applies to descriptors configured through the global (GlobalConfigurationCategory.Unclassified) configuration. Override to return something different if appropriate. The only currently supported alternative return value is Jenkins.MANAGE.
      Overrides:
      getRequiredGlobalConfigPagePermission in class Descriptor<PageDecorator>
      Returns:
      Permission required to globally configure this descriptor.
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException
      Description copied from class: Descriptor
      Invoked when the global configuration page is submitted. Can be overridden to store descriptor-specific information.
      Overrides:
      configure in class Descriptor<PageDecorator>
      Parameters:
      json - The JSON object that captures the configuration data for this Descriptor. See the developer documentation.
      Returns:
      false to keep the client in the same config page.
      Throws:
      Descriptor.FormException