@ExportedBean public class Fingerprint extends Object implements ModelObject, Saveable
Lifecycle is managed by FingerprintMap.
FingerprintMap| Modifier and Type | Class and Description |
|---|---|
static class |
Fingerprint.BuildPtr
Pointer to a
Build. |
static class |
Fingerprint.ProjectRenameListener |
static class |
Fingerprint.Range
Range of build numbers [start,end).
|
static class |
Fingerprint.RangeItem |
static class |
Fingerprint.RangeSet
Set of
Fingerprint.Ranges. |
| Constructor and Description |
|---|
Fingerprint(Run build,
String fileName,
byte[] md5sum) |
| Modifier and Type | Method and Description |
|---|---|
List<Fingerprint.RangeItem> |
_getUsages() |
void |
add(AbstractBuild b)
Deprecated.
|
void |
add(String jobFullName,
int n)
Records that a build of a job has used this file.
|
void |
addFor(Run b)
Adds a usage reference to the build.
|
List<Action> |
getActions()
Returns the actions contributed from
getFacets() |
Api |
getApi() |
String |
getDisplayName() |
<T extends FingerprintFacet> |
getFacet(Class<T> type)
Finds a facet of the specific type (including subtypes.)
|
Collection<FingerprintFacet> |
getFacets()
Gets the associated
FingerprintFacets. |
String |
getFileName()
The file name (like "foo.jar" without path).
|
String |
getHashString()
Gets the MD5 hash string.
|
List<String> |
getJobs()
Gets the sorted list of job names where this jar is used.
|
Fingerprint.BuildPtr |
getOriginal()
The first build in which this file showed up,
if the file looked like it's created there.
|
Fingerprint.RangeSet |
getRangeSet(Job job) |
Fingerprint.RangeSet |
getRangeSet(String jobFullName)
Gets the build range set for the given job name.
|
Collection<FingerprintFacet> |
getSortedFacets()
Sorts
FingerprintFacets by their timestamps. |
Date |
getTimestamp()
Gets the timestamp when this record is created.
|
String |
getTimestampString()
Gets the string that says how long since this build has scheduled.
|
Hashtable<String,Fingerprint.RangeSet> |
getUsages() |
boolean |
isAlive()
Returns true if any of the builds recorded in this fingerprint
is still retained.
|
void |
rename(String oldName,
String newName)
Update references to a renamed job in the fingerprint
|
void |
save()
Save the settings to a file.
|
String |
toString() |
boolean |
trim()
Trim off references to non-existent builds and jobs, thereby making the fingerprint smaller.
|
public Fingerprint(@CheckForNull Run build, @Nonnull String fileName, @Nonnull byte[] md5sum) throws IOException
IOException@Exported @CheckForNull public Fingerprint.BuildPtr getOriginal()
This is considered as the "source" of this file, or the owner, in the sense that this project "owns" this file.
@Nonnull public String getDisplayName()
getDisplayName in interface ModelObject@Exported @Nonnull public String getFileName()
@Exported(name="hash") @Nonnull public String getHashString()
@Exported @Nonnull public Date getTimestamp()
@Nonnull public String getTimestampString()
@Nonnull public Fingerprint.RangeSet getRangeSet(String jobFullName)
These builds of this job has used this file.
public Fingerprint.RangeSet getRangeSet(Job job)
@Nonnull public List<String> getJobs()
@Nonnull public Hashtable<String,Fingerprint.RangeSet> getUsages()
@Exported(name="usage") @Nonnull public List<Fingerprint.RangeItem> _getUsages()
@Deprecated public void add(@Nonnull AbstractBuild b) throws IOException
addFor(hudson.model.Run)IOExceptionpublic void addFor(@Nonnull Run b) throws IOException
b - Run to be referenced in usagesIOExceptionpublic void add(@Nonnull String jobFullName, int n) throws IOException
IOExceptionpublic boolean isAlive()
This is used to find out old fingerprint records that can be removed without losing too much information.
public boolean trim()
throws IOException
IOException - Save failure@Nonnull public Collection<FingerprintFacet> getFacets()
FingerprintFacets.
This method always return a non-empty collection, which is a synthetic collection.
It contains persisted FingerprintFacets (those that are added explicitly, like
fingerprint.getFacets().add(x)), as well those that are transient.
Mutation to this collection will manipulate persisted set of FingerprintFacets, and therefore regardless
of what you do, this collection will always contain a set of FingerprintFacets that are added
by TransientFingerprintFacetFactorys.
@Nonnull public Collection<FingerprintFacet> getSortedFacets()
FingerprintFacets by their timestamps.FingerprintFacets@CheckForNull public <T extends FingerprintFacet> T getFacet(Class<T> type)
T - Class of the FingerprintFacet@Nonnull public List<Action> getActions()
getFacets()public void save()
throws IOException
save in interface SaveableIOException - Save errorpublic void rename(String oldName, String newName) throws IOException
IOExceptionpublic Api getApi()
Copyright © 2019. All rights reserved.