Class SupportPlugin

  • All Implemented Interfaces:
    Saveable, org.kohsuke.stapler.StaplerProxy

    public class SupportPlugin
    extends Plugin
    Main entry point for the support plugin.
    Author:
    Stephen Connolly
    • Field Detail

      • REMOTE_OPERATION_TIMEOUT_MS

        public static final int REMOTE_OPERATION_TIMEOUT_MS
        How long remote operations can block support bundle generation for.
      • REMOTE_OPERATION_CACHE_TIMEOUT_SEC

        public static final int REMOTE_OPERATION_CACHE_TIMEOUT_SEC
        How long remote operations fallback caching can wait for
      • AUTO_BUNDLE_PERIOD_HOURS

        public static final int AUTO_BUNDLE_PERIOD_HOURS
        How often automatic support bundles should be collected. Should be 1 unless you have very good reason to use a different period. 0 disables bundle generation and 24 is the longest period permitted.
      • SUPPORT_PERMISSIONS

        public static final PermissionGroup SUPPORT_PERMISSIONS
    • Constructor Detail

      • SupportPlugin

        public SupportPlugin()
    • Method Detail

      • getRootDirectory

        public static File getRootDirectory()
        Working directory that the support-core plugin uses to write out files.
        Returns:
        the working directory that the support-core plugin uses to write out files.
      • getLogsDirectory

        public static File getLogsDirectory()
        Working directory that the support-core plugin uses to write out log files.
        Returns:
        the working directory that the support-core plugin uses to write out log files.
      • getRequesterAuthentication

        public static org.springframework.security.core.Authentication getRequesterAuthentication()
      • setRequesterAuthentication

        public static void setRequesterAuthentication​(org.springframework.security.core.Authentication authentication)
      • clearRequesterAuthentication

        public static void clearRequesterAuthentication()
      • getExcludedComponents

        public Set<String> getExcludedComponents()
      • setExcludedComponents

        public void setExcludedComponents​(Set<String> excludedComponents)
                                   throws IOException
        Sets the ids of the components to be excluded.
        Parameters:
        excludedComponents - Component Ids (by default class names) to exclude.
        Throws:
        IOException - if an error occurs while saving the configuration.
        See Also:
        Component.getId()
      • getJenkinsExecutorTotalCount

        public com.codahale.metrics.Histogram getJenkinsExecutorTotalCount()
      • getJenkinsExecutorUsedCount

        public com.codahale.metrics.Histogram getJenkinsExecutorUsedCount()
      • getJenkinsNodeOnlineCount

        public com.codahale.metrics.Histogram getJenkinsNodeOnlineCount()
      • getJenkinsNodeTotalCount

        public com.codahale.metrics.Histogram getJenkinsNodeTotalCount()
      • setLogLevel

        public static void setLogLevel​(String level)
      • setLogLevel

        public static void setLogLevel​(Level level)
      • writeBundle

        @Deprecated
        public static void writeBundle​(OutputStream outputStream)
                                throws IOException
        Deprecated.
        Generate a bundle for all components that are selected in the Global Configuration.
        Parameters:
        outputStream - an OutputStream
        Throws:
        IOException - if an error occurs while generating the bundle.
      • writeBundle

        public static void writeBundle​(OutputStream outputStream,
                                       List<? extends Component> components)
                                throws IOException
        Generate a bundle for all components that are selected in the Global Configuration.
        Parameters:
        outputStream - an OutputStream
        components - a list of Component to include in the bundle
        Throws:
        IOException - if an error occurs while generating the bundle.
      • getContentFilter

        @NonNull
        @Deprecated
        public static Optional<ContentFilter> getContentFilter()
        Deprecated.
        use getDefaultContentFilter()
        Get the filter to be used in an Optional just in case.
        Returns:
        the filter.
      • getContentFilter

        @Deprecated
        public static Optional<ContentFilter> getContentFilter​(boolean ensureLoaded)
        Deprecated.
        use getDefaultContentFilter(ensureLoaded)
        Get the filter to be used in an Optional just in case.
        Parameters:
        ensureLoaded - true to ensure that the filter is loaded. Not necessary if ContentFilter.reload() is done explicitly by the caller.
        Returns:
        the filter.
      • getDefaultContentFilter

        @NonNull
        public static ContentFilter getDefaultContentFilter()
        Get the current ContentFilter.
        Returns:
        the ContentFilter or a pass-through filter if anonymization is off
      • getDefaultContentFilter

        @NonNull
        public static ContentFilter getDefaultContentFilter​(boolean ensureLoaded)
        Get the filter to be used.
        Parameters:
        ensureLoaded - true to ensure that the filter is loaded. Not necessary if ContentFilter.reload() is done explicitly by the caller.
        Returns:
        the filter.
      • completedMilestones

        @Deprecated
        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public static void completedMilestones()
                                        throws IOException
        Deprecated.
        Throws:
        IOException