@Restricted(value=org.kohsuke.accmod.restrictions.Beta.class) public abstract class FingerprintStorage extends AbstractDescribableImpl<FingerprintStorage> implements ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
FingerprintStorage() |
Modifier and Type | Method and Description |
---|---|
boolean |
cleanFingerprint(Fingerprint fingerprint,
TaskListener taskListener)
This method performs the cleanup of the given fingerprint.
|
abstract void |
delete(String id)
Deletes the Fingerprint with the given unique ID.
|
static FingerprintStorage |
get()
Returns the configured
FingerprintStorage engine chosen by the user for the system. |
FingerprintStorageDescriptor |
getDescriptor()
By default looks for a nested class (conventionally named
DescriptorImpl ) implementing Descriptor and marked with Extension . |
static FingerprintStorage |
getFileFingerprintStorage()
Returns the file system based
FileFingerprintStorage configured on the system. |
protected Fingerprint |
getFingerprint(Fingerprint fp) |
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 |
load(String id)
Returns the Fingerprint with the given unique ID.
|
abstract void |
save(Fingerprint fp)
Saves the given Fingerprint in the storage.
|
public static FingerprintStorage get()
FingerprintStorage
engine chosen by the user for the system.public static FingerprintStorage getFileFingerprintStorage()
FileFingerprintStorage
configured on the system.public abstract void save(Fingerprint fp) throws IOException
IOException
- Save error@CheckForNull public abstract Fingerprint load(String id) throws IOException
Fingerprint.getHashString()
.IOException
- Load errorpublic abstract void delete(String id) throws IOException
Fingerprint.getHashString()
.
TODO: Needed for external storage fingerprint cleanup.IOException
- Deletion errorpublic abstract boolean isReady()
public abstract void iterateAndCleanupFingerprints(TaskListener taskListener)
FingerprintCleanupThread
.
For reference, see FileFingerprintStorage.iterateAndCleanupFingerprints(TaskListener)
For cleaning up the fingerprint cleanFingerprint(Fingerprint, TaskListener)
may be used.public boolean cleanFingerprint(@NonNull Fingerprint fingerprint, TaskListener taskListener)
protected Fingerprint getFingerprint(Fingerprint fp) throws IOException
IOException
public FingerprintStorageDescriptor getDescriptor()
AbstractDescribableImpl
DescriptorImpl
) implementing Descriptor
and marked with Extension
.
Gets the descriptor for this instance.
Descriptor
is a singleton for every concrete Describable
implementation, so if a.getClass() == b.getClass()
then by default
a.getDescriptor() == b.getDescriptor()
as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
getDescriptor
in interface Describable<FingerprintStorage>
getDescriptor
in class AbstractDescribableImpl<FingerprintStorage>
Copyright © 2004–2021. All rights reserved.