Class LegacyIdStore<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    ExtensionPoint
    Direct Known Subclasses:
    FolderIdStore, JobIdStore, RunIdStore

    @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    @Deprecated
    public abstract class LegacyIdStore<T>
    extends Object
    implements ExtensionPoint
    Deprecated.
    An abstraction to persistently store and retrieve unique id's for various Jenkins model objects. These keys are guaranteed to be unique with a Jenkins and immutable across the lifetime of the given object. Implementations should not store the ID inside any specific item configuration as it is common for users top copy items either through the UI or manually and this will cause the IDs to become non-unique.
    • Constructor Detail

      • LegacyIdStore

        public LegacyIdStore​(Class<T> forType)
        Deprecated.
    • Method Detail

      • remove

        public abstract void remove​(T object)
                             throws IOException
        Deprecated.
        Remove the unique id associated with the given object.
        Parameters:
        object -
        Throws:
        IOException
      • get

        @Nullable
        public abstract String get​(T object)
        Deprecated.
        Get the id for this given object.
        Parameters:
        object -
        Returns:
        the id or null if none assigned.
      • supports

        public boolean supports​(Class clazz)
        Deprecated.
      • forClass

        @Nullable
        public static <C> LegacyIdStore<C> forClass​(Class<C> clazz)
        Deprecated.
        Retrieve an LegacyIdStore for the given type
        Type Parameters:
        C -
        Parameters:
        clazz -
        Returns:
        the store which supports the type, or null if none
      • removeId

        public static void removeId​(Object object)
                             throws IOException
        Deprecated.
        Convenience method which makes the id for the given object.
        Throws:
        IllegalArgumentException - if the type is not supported.
        IOException - if we could not remove the ID from the Object.
      • getId

        public static String getId​(Object object)
        Deprecated.
        Convenience method which retrieves the id for the given object.
        Throws:
        IllegalArgumentException - if the type is not supported.