Package jenkins.fingerprints
Class FingerprintStorage
java.lang.Object
jenkins.fingerprints.FingerprintStorage
- All Implemented Interfaces:
ExtensionPoint,Describable<FingerprintStorage>
- Direct Known Subclasses:
FileFingerprintStorage
@Restricted(org.kohsuke.accmod.restrictions.Beta.class)
public abstract class FingerprintStorage
extends Object
implements Describable<FingerprintStorage>, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancleanFingerprint(Fingerprint fingerprint, TaskListener taskListener) This method performs the cleanup of the given fingerprint.abstract voidDeletes the Fingerprint with the given unique ID.static FingerprintStorageget()Returns the configuredFingerprintStorageengine chosen by the user for the system.Gets the descriptor for this instance.static FingerprintStorageDeprecated.protected Fingerprintabstract booleanisReady()Returns true if there's some data in the fingerprint database.abstract voiditerateAndCleanupFingerprints(TaskListener taskListener) Iterates a set of fingerprints, and cleans them up.abstract FingerprintReturns the Fingerprint with the given unique ID.abstract voidsave(Fingerprint fp) Saves the given Fingerprint in the storage.
-
Constructor Details
-
FingerprintStorage
public FingerprintStorage()
-
-
Method Details
-
get
Returns the configuredFingerprintStorageengine chosen by the user for the system. -
getFileFingerprintStorage
Deprecated.since 2.324, useExtensionList.lookupSingleton(FileFingerprintStorage.class)instead.Returns the file system basedFileFingerprintStorageconfigured 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 interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, 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.)By default looks for a nested class (conventionally named
DescriptorImpl) implementingDescriptorand marked withExtension.- Specified by:
getDescriptorin interfaceDescribable<FingerprintStorage>- Since:
- 2.246
-
ExtensionList.lookupSingleton(FileFingerprintStorage.class)instead.