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