Class DomainRequirementProvider

java.lang.Object
com.google.jenkins.plugins.credentials.domains.DomainRequirementProvider
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
DescribableDomainRequirementProvider

public abstract class DomainRequirementProvider extends Object implements ExtensionPoint
This ExtensionPoint serves as a means for plugins to augment the domain-requirement discovery process. The intended usage is: List<T> list = DomainRequirementProvider.lookupRequirements( FooRequirement.class); This will delegate to the various extension implementations to provide(Class) a List of requirements from things it understands how to discover. The expectation is that it will call: of(discoveredClass, type /* parameter to provide */); in order to perform the RequiresDomain resolution.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface hudson.ExtensionPoint

    ExtensionPoint.LegacyInstancesAreScopedToHudson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement>
    List<T>
    The the entrypoint for requirement gathering, this static method delegates to any registered providers to provide their set of discoverable requirements.
    static <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement>
    T
    of(Class<?> type, Class<T> requirementType)
    This is called by implementations of provide() to instantiate the class specified by an actual attribute, if present.
    protected abstract <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement>
    List<T>
    provide(Class<T> type)
    This hook is intended for providers to implement such that they can surface custom class-discovery logic, on which they will call of() to instantiate the elements returned.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DomainRequirementProvider

      public DomainRequirementProvider()
  • Method Details

    • provide

      protected abstract <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement> List<T> provide(Class<T> type)
      This hook is intended for providers to implement such that they can surface custom class-discovery logic, on which they will call of() to instantiate the elements returned.
    • lookupRequirements

      public static <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement> List<T> lookupRequirements(Class<T> type)
      The the entrypoint for requirement gathering, this static method delegates to any registered providers to provide their set of discoverable requirements.
    • of

      @Nullable public static <T extends com.cloudbees.plugins.credentials.domains.DomainRequirement> T of(Class<?> type, Class<T> requirementType)
      This is called by implementations of provide() to instantiate the class specified by an actual attribute, if present. It returns null otherwise.