Class PortletUtils
java.lang.Object
io.jenkins.plugins.monitoring.util.PortletUtils
A utility class for the portlets.
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<? extends MonitorPortlet> getAvailablePortlets(Run<?, ?> build) Gets allMonitorPortletfor correspondingMonitorPortletFactory.static List<? extends MonitorPortlet> getAvailablePortletsForFactory(Run<?, ?> build, MonitorPortletFactory factory) Gets allMonitorPortletfor oneMonitorPortletFactory.static StringgetDefaultPortletsAsConfiguration(Run<?, ?> build) Get all the default portlets as configuration.static List<? extends MonitorPortletFactory> Get all portlet factories, type ofMonitorPortletFactory.static booleanisValidConfiguration(String configuration) Validate the json configuration.
-
Method Details
-
getAvailablePortlets
Gets allMonitorPortletfor correspondingMonitorPortletFactory.- Parameters:
build- the reference build.- Returns:
- all available
MonitorPortlet.
-
getFactories
Get all portlet factories, type ofMonitorPortletFactory.- Returns:
- all factories as list.
-
getAvailablePortletsForFactory
public static List<? extends MonitorPortlet> getAvailablePortletsForFactory(Run<?, ?> build, MonitorPortletFactory factory) Gets allMonitorPortletfor oneMonitorPortletFactory.- Parameters:
build- the build to get the portlets for.factory- the factory to get the portlets for.- Returns:
- the filtered portlets.
-
getDefaultPortletsAsConfiguration
Get all the default portlets as configuration.- Parameters:
build- the build to get the portlets for.- Returns:
- the json array configuration as string.
-
isValidConfiguration
Validate the json configuration.- Parameters:
configuration- the configuration as json- Returns:
- true, if the configuration is valid, else false.
-