@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.Range s. |
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) |
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
FingerprintFacet s. |
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() |
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(Run build, String fileName, byte[] md5sum) throws IOException
IOException
@Exported 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.
public String getDisplayName()
getDisplayName
in interface ModelObject
@Exported public String getFileName()
@Exported(name="hash") public String getHashString()
@Exported public Date getTimestamp()
public String getTimestampString()
public Fingerprint.RangeSet getRangeSet(String jobFullName)
These builds of this job has used this file.
public Fingerprint.RangeSet getRangeSet(Job job)
public Hashtable<String,Fingerprint.RangeSet> getUsages()
@Exported(name="usage") public List<Fingerprint.RangeItem> _getUsages()
@Deprecated public void add(AbstractBuild b) throws IOException
IOException
public void addFor(Run b) throws IOException
IOException
public void add(String jobFullName, int n) throws IOException
IOException
public 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
public Collection<FingerprintFacet> getFacets()
FingerprintFacet
s.
This method always return a non-empty collection, which is a synthetic collection.
It contains persisted FingerprintFacet
s (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 FingerprintFacet
s, and therefore regardless
of what you do, this collection will always contain a set of FingerprintFacet
s that are added
by TransientFingerprintFacetFactory
s.
public Collection<FingerprintFacet> getSortedFacets()
public <T extends FingerprintFacet> T getFacet(Class<T> type)
public List<Action> getActions()
getFacets()
public void save() throws IOException
save
in interface Saveable
IOException
- if the persistence failed.public void rename(String oldName, String newName) throws IOException
IOException
public Api getApi()
Copyright © 2015. All rights reserved.