Class LegacyMonitorData


  • @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public class LegacyMonitorData
    extends Object
    Responsible of the data for the monitor. Holds the jobs to warn about the failure in Production mode, and also holds runtime information like names of source jobs.
    Since:
    1.44
    • Constructor Detail

      • LegacyMonitorData

        public LegacyMonitorData()
        ctor
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Returns:
        true if there're no jobs to warn.
      • hasJobFullName

        public boolean hasJobFullName​(@NonNull
                                      String jobFullName)
        Check a job is listed either as a source job or a destination job.
        Parameters:
        jobFullName - the job name to check
        Returns:
        true if that job is already listed.
      • onJobRename

        public void onJobRename​(@NonNull
                                String previousFullName,
                                @NonNull
                                String newFullName)
        Apply the rename to the job list.
        Parameters:
        previousFullName - the previous name of the job.
        newFullName - the new name of the job.
      • buildDataForCurrentUser

        @NonNull
        public List<LegacyMonitorData.LegacyBuildInfoModel> buildDataForCurrentUser()
        Helper to ease the display of the information in a table
        Returns:
        the list of pairs of source and destination jobs to show warnings for that user.
      • addLegacyJob

        public void addLegacyJob​(@NonNull
                                 Job<?,​?> jobTryingToCopy,
                                 @NonNull
                                 Job<?,​?> jobToBeCopiedFrom,
                                 @NonNull
                                 Date lastBuildDate,
                                 @NonNull
                                 String username)
        Add information that would fail in Production mode.
        Parameters:
        jobTryingToCopy - the name of the destination job.
        jobToBeCopiedFrom - the name of the source job.
        lastBuildDate - the build timestamp.
        username - the user name that the destination job ran as.
      • removeLegacyJob

        public boolean removeLegacyJob​(@NonNull
                                       String jobFullNameFrom,
                                       @NonNull
                                       String jobFullNameTo)
        Remove information that would fail in Production mode.
        Parameters:
        jobFullNameFrom - the name of the source job.
        jobFullNameTo - the name of the destination job.
        Returns:
        true if removed (the pair was registered).