Class PortletUtils

java.lang.Object
io.jenkins.plugins.monitoring.util.PortletUtils

public final class PortletUtils extends Object
A utility class for the portlets.
  • Method Details

    • getAvailablePortlets

      public static List<? extends MonitorPortlet> getAvailablePortlets(Run<?,?> build)
      Gets all MonitorPortlet for corresponding MonitorPortletFactory.
      Parameters:
      build - the reference build.
      Returns:
      all available MonitorPortlet.
    • getFactories

      public static List<? extends MonitorPortletFactory> getFactories()
      Get all portlet factories, type of MonitorPortletFactory.
      Returns:
      all factories as list.
    • getAvailablePortletsForFactory

      public static List<? extends MonitorPortlet> getAvailablePortletsForFactory(Run<?,?> build, MonitorPortletFactory factory)
      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.