Package com.cloudbees.jenkins.support
Class SupportPlugin
- java.lang.Object
-
- hudson.Plugin
-
- com.cloudbees.jenkins.support.SupportPlugin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SupportPlugin.ComputerListenerImpl
static class
SupportPlugin.GlobalConfigurationImpl
static class
SupportPlugin.LogFetcher
static class
SupportPlugin.LogHolder
static class
SupportPlugin.LogUpdater
static class
SupportPlugin.PeriodicWorkImpl
-
Nested classes/interfaces inherited from class hudson.Plugin
Plugin.DummyImpl
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUTO_BUNDLE_PERIOD_HOURS
How often automatic support bundles should be collected.static Permission
CREATE_BUNDLE
Deprecated.not used anymore as the usage has now been limited toJenkins.ADMINISTER
static int
REMOTE_OPERATION_CACHE_TIMEOUT_SEC
How long remote operations fallback caching can wait forstatic int
REMOTE_OPERATION_TIMEOUT_MS
How long remote operations can block support bundle generation for.static String
SUPPORT_DIRECTORY_NAME
static PermissionGroup
SUPPORT_PERMISSIONS
-
Fields inherited from class hudson.Plugin
SKIP_PERMISSION_CHECK
-
-
Constructor Summary
Constructors Constructor Description SupportPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
clearRequesterAuthentication()
static void
completedMilestones()
Deprecated.List<LogRecord>
getAllLogRecords()
List<LogRecord>
getAllLogRecords(Node node)
static String
getBundleFileName()
Deprecated.useBundleFileName.generate()
insteadstatic ExtensionList<Component>
getComponents()
static Optional<ContentFilter>
getContentFilter()
Get the filter to be used in anOptional
just in case.static Optional<ContentFilter>
getContentFilter(boolean ensureLoaded)
Get the filter to be used in anOptional
just in case.SupportContextImpl
getContext()
Deprecated.usage removedSet<String>
getExcludedComponents()
static SupportPlugin
getInstance()
com.codahale.metrics.Histogram
getJenkinsExecutorTotalCount()
com.codahale.metrics.Histogram
getJenkinsExecutorUsedCount()
com.codahale.metrics.Histogram
getJenkinsNodeOnlineCount()
com.codahale.metrics.Histogram
getJenkinsNodeTotalCount()
static File
getLogsDirectory()
Working directory that the support-core plugin uses to write out log files.static org.springframework.security.core.Authentication
getRequesterAuthentication()
static File
getRootDirectory()
Working directory that the support-core plugin uses to write out files.SupportProvider
getSupportProvider()
static void
loadConfig()
static void
migrateExistingLogs()
void
setExcludedComponents(Set<String> excludedComponents)
Sets the ids of the components to be excluded.static void
setLogLevel(String level)
static void
setLogLevel(Level level)
static void
setRequesterAuthentication(org.springframework.security.core.Authentication authentication)
void
setSupportProvider(SupportProvider supportProvider)
void
start()
void
stop()
static void
threadDumpStartup()
static void
writeBundle(OutputStream outputStream)
Deprecated.static void
writeBundle(OutputStream outputStream, List<? extends Component> components)
Generate a bundle for all components that are selected in the Global Configuration.static void
writeBundle(OutputStream outputStream, List<? extends Component> components, ComponentVisitor componentConsumer)
Generate a bundle for all components that are selected in the Global Configuration.-
Methods inherited from class hudson.Plugin
configure, configure, doDynamic, getConfigXml, getTarget, getWrapper, load, postInitialize, save, setServletContext
-
-
-
-
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 be1
unless you have very good reason to use a different period.0
disables bundle generation and24
is the longest period permitted.
-
SUPPORT_PERMISSIONS
public static final PermissionGroup SUPPORT_PERMISSIONS
-
CREATE_BUNDLE
@Deprecated public static final Permission CREATE_BUNDLE
Deprecated.not used anymore as the usage has now been limited toJenkins.ADMINISTER
-
SUPPORT_DIRECTORY_NAME
public static final String SUPPORT_DIRECTORY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
migrateExistingLogs
@Initializer(after=EXTENSIONS_AUGMENTED) public static void migrateExistingLogs()
-
getSupportProvider
public SupportProvider getSupportProvider()
-
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()
-
setSupportProvider
public void setSupportProvider(SupportProvider supportProvider) throws IOException
- Throws:
IOException
-
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)
-
getInstance
public static SupportPlugin getInstance()
-
getComponents
public static ExtensionList<Component> getComponents()
-
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
- anOutputStream
- 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
- anOutputStream
components
- a list ofComponent
to include in the bundle- Throws:
IOException
- if an error occurs while generating the bundle.
-
writeBundle
public static void writeBundle(OutputStream outputStream, List<? extends Component> components, ComponentVisitor componentConsumer) throws IOException
Generate a bundle for all components that are selected in the Global Configuration.- Parameters:
outputStream
- anOutputStream
components
- a list ofComponent
to include in the bundlecomponentConsumer
- aComponentVisitor
- Throws:
IOException
- if an error occurs while generating the bundle.
-
getContentFilter
public static Optional<ContentFilter> getContentFilter()
Get the filter to be used in anOptional
just in case.- Returns:
- the filter.
-
getContentFilter
public static Optional<ContentFilter> getContentFilter(boolean ensureLoaded)
Get the filter to be used in anOptional
just in case.- Parameters:
ensureLoaded
- true to ensure that the filter is loaded. Not necessary ifContentFilter.reload()
is done explicitly by the caller.- Returns:
- the filter.
-
loadConfig
@Initializer(after=EXTENSIONS_AUGMENTED, before=JOB_LOADED) public static void loadConfig() throws IOException
- Throws:
IOException
-
completedMilestones
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void completedMilestones() throws IOException
Deprecated.- Throws:
IOException
-
threadDumpStartup
@Initializer(after=STARTED) public static void threadDumpStartup() throws Exception
- Throws:
Exception
-
getContext
@NonNull @Deprecated public SupportContextImpl getContext()
Deprecated.usage removed- Returns:
- the
SupportContext
-
getAllLogRecords
public List<LogRecord> getAllLogRecords(Node node) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
getBundleFileName
@Deprecated @NonNull public static String getBundleFileName()
Deprecated.useBundleFileName.generate()
insteadReturns the full bundle name.- Returns:
- the full bundle name.
-
-