Package jenkins.fingerprints
Class FingerprintStorage
- All Implemented Interfaces:
ExtensionPoint
,Describable<FingerprintStorage>
- Direct Known Subclasses:
FileFingerprintStorage
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public abstract class FingerprintStorage
extends AbstractDescribableImpl<FingerprintStorage>
implements ExtensionPoint
Pluggable fingerprint storage API for fingerprints.
- Author:
- Sumit Sarin
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
cleanFingerprint
(Fingerprint fingerprint, TaskListener taskListener) This method performs the cleanup of the given fingerprint.abstract void
Deletes the Fingerprint with the given unique ID.static FingerprintStorage
get()
Returns the configuredFingerprintStorage
engine chosen by the user for the system.By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.static FingerprintStorage
Deprecated.protected Fingerprint
abstract boolean
isReady()
Returns true if there's some data in the fingerprint database.abstract void
iterateAndCleanupFingerprints
(TaskListener taskListener) Iterates a set of fingerprints, and cleans them up.abstract Fingerprint
Returns the Fingerprint with the given unique ID.abstract void
save
(Fingerprint fp) Saves the given Fingerprint in the storage.
-
Constructor Details
-
FingerprintStorage
public FingerprintStorage()
-
-
Method Details
-
get
Returns the configuredFingerprintStorage
engine chosen by the user for the system. -
getFileFingerprintStorage
Deprecated.since 2.324, useExtensionList.lookupSingleton(FileFingerprintStorage.class)
instead.Returns the file system basedFileFingerprintStorage
configured on the system. -
save
Saves the given Fingerprint in the storage. This acts as a blocking operation. For file system based default storage, throws IOException when it fails.- Throws:
IOException
- Save error
-
load
Returns the Fingerprint with the given unique ID. The unique ID for a fingerprint is defined byFingerprint.getHashString()
.- Throws:
IOException
- Load error
-
delete
Deletes the Fingerprint with the given unique ID. This acts as a blocking operation. For file system based default storage, throws IOException when it fails. The unique ID for a fingerprint is defined byFingerprint.getHashString()
. TODO: Needed for external storage fingerprint cleanup.- Throws:
IOException
- Deletion error
-
isReady
public abstract boolean isReady()Returns true if there's some data in the fingerprint database. -
iterateAndCleanupFingerprints
Iterates a set of fingerprints, and cleans them up. Cleaning up a fingerprint implies deleting the builds associated with the fingerprints, once they are no longer available on the system. If all the builds have been deleted, the fingerprint itself is deleted. This method is called periodically byFingerprintCleanupThread
. For reference, seeFileFingerprintStorage.iterateAndCleanupFingerprints(TaskListener)
For cleaning up the fingerprintcleanFingerprint(Fingerprint, TaskListener)
may be used.- Since:
- 2.246
-
cleanFingerprint
This method performs the cleanup of the given fingerprint.- Since:
- 2.246
-
getFingerprint
- Throws:
IOException
-
getDescriptor
Description copied from class:AbstractDescribableImpl
By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.Gets the descriptor for this instance.
Descriptor
is a singleton for every concreteDescribable
implementation, so ifa.getClass() == b.getClass()
then by defaulta.getDescriptor() == b.getDescriptor()
as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptor
in interfaceDescribable<FingerprintStorage>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<FingerprintStorage>
- Since:
- 2.246
-
ExtensionList.lookupSingleton(FileFingerprintStorage.class)
instead.