Package hudson.model

Class Fingerprint

    • Constructor Detail

    • Method Detail

      • getOriginal

        @Exported
        @CheckForNull
        public Fingerprint.BuildPtr getOriginal()
        The first build in which this file showed up, if the file looked like it's created there.

        This is considered as the "source" of this file, or the owner, in the sense that this project "owns" this file.

        Returns:
        null if the file is apparently created outside Hudson or if the current user has no permission to discover the job.
      • getFileName

        @Exported
        @NonNull
        public String getFileName()
        The file name (like "foo.jar" without path).
      • getHashString

        @Exported(name="hash")
        @NonNull
        public String getHashString()
        Gets the MD5 hash string.
      • getTimestamp

        @Exported
        @NonNull
        public Date getTimestamp()
        Gets the timestamp when this record is created.
      • getTimestampString

        @NonNull
        public String getTimestampString()
        Gets the string that says how long since this build has scheduled.
        Returns:
        string like "3 minutes" "1 day" etc.
      • getRangeSet

        @NonNull
        public Fingerprint.RangeSet getRangeSet​(String jobFullName)
        Gets the build range set for the given job name.

        These builds of this job has used this file.

        Returns:
        may be empty but not null.
      • getJobs

        @NonNull
        public List<String> getJobs()
        Gets the sorted list of job names where this jar is used.
      • addFor

        public void addFor​(@NonNull
                           Run b)
                    throws IOException
        Adds a usage reference to the build.
        Parameters:
        b - Run to be referenced in usages
        Throws:
        IOException
        Since:
        1.577
      • add

        public void add​(@NonNull
                        String jobFullName,
                        int n)
                 throws IOException
        Records that a build of a job has used this file.
        Throws:
        IOException
      • readResolve

        protected Object readResolve()
      • isAlive

        public boolean isAlive()
        Returns true if any of the builds recorded in this fingerprint is still retained.

        This is used to find out old fingerprint records that can be removed without losing too much information.

      • trim

        public boolean trim()
                     throws IOException
        Trim off references to non-existent builds and jobs, thereby making the fingerprint smaller.
        Returns:
        true if this record was modified.
        Throws:
        IOException - Save failure
      • getFacet

        @CheckForNull
        public <T extends FingerprintFacet> T getFacet​(Class<T> type)
        Finds a facet of the specific type (including subtypes.)
        Type Parameters:
        T - Class of the FingerprintFacet
        Returns:
        First matching facet of the specified class
        Since:
        1.556
      • getActions

        @NonNull
        public List<Action> getActions()
        Returns the actions contributed from getFacets()
      • save

        public void save()
                  throws IOException
        Save the Fingerprint in the Fingerprint Storage
        Specified by:
        save in interface Saveable
        Throws:
        IOException - Save error
      • getFacetBlockingDeletion

        @CheckForNull
        public FingerprintFacet getFacetBlockingDeletion()
        Returns a facet that blocks the deletion of the fingerprint. Returns null if no such facet.
        Since:
        2.223
      • getApi

        public Api getApi()
      • load

        @CheckForNull
        public static Fingerprint load​(@NonNull
                                       String id)
                                throws IOException
        Loads a Fingerprint from the Storage with the given unique id.
        Returns:
        Loaded Fingerprint. null if the config file does not exist or malformed. In case an external storage is configured on top of a file system based storage: 1. External storage is polled to retrieve the fingerprint 2. If not found, then the local storage is polled to retrieve the fingerprint
        Throws:
        IOException
      • getXStream

        @NonNull
        public static XStream2 getXStream()
        Provides the XStream instance this class is using for serialization.
        Returns:
        the XStream instance
        Since:
        1.655