Class DisplayURLDecorator

java.lang.Object
org.jenkinsci.plugins.displayurlapi.DisplayURLDecorator
All Implemented Interfaces:
ExtensionPoint

public abstract class DisplayURLDecorator extends Object implements ExtensionPoint
An extension point for decorating the URLs presented to users by the DisplayURLProvider. Use cases include decorating URLs with utm_source etc tracking parameters in order to measure the usage rate of different URLs generated by Jenkins.
  • Constructor Details

    • DisplayURLDecorator

      public DisplayURLDecorator()
  • Method Details

    • parameters

      @NonNull protected abstract Map<String,String> parameters(@NonNull DisplayURLContext context)
      Returns a map of query parameters to decorate the URL with. The keys and values will be URL encoded for you. A null value will translate as a query parameter without a value.
      Parameters:
      context - the context within which the URL is being generated.
      Returns:
      the map of parameters to append to the URL.
    • decorate

      @NonNull public static String decorate(@NonNull DisplayURLContext context, @NonNull String url)
      Decorates the URL for the provided context.
      Parameters:
      context - the context.
      url - the URL to decorate.
      Returns:
      the decorated URL.