Class LegacyIdStore<T>
- java.lang.Object
-
- org.jenkinsci.plugins.uniqueid.impl.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description LegacyIdStore(Class<T> forType)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <C> LegacyIdStore<C>
forClass(Class<C> clazz)
Deprecated.Retrieve anLegacyIdStore
for the given typeabstract String
get(T object)
Deprecated.Get the id for this given object.static String
getId(Object object)
Deprecated.Convenience method which retrieves the id for the given object.abstract void
remove(T object)
Deprecated.Remove the unique id associated with the given object.static void
removeId(Object object)
Deprecated.Convenience method which makes the id for the given object.boolean
supports(Class clazz)
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 anLegacyIdStore
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.
-
-