Class LegacyMonitorData
- java.lang.Object
-
- hudson.plugins.copyartifact.monitor.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegacyMonitorData.JobInfoModel
For Jelly display only Holds the information of the job to display.static class
LegacyMonitorData.JobKey
The pair of the source job and the destination job.static class
LegacyMonitorData.LegacyBuildInfoModel
For Jelly display only Holds information of a source job and destination jobs for that source job.static class
LegacyMonitorData.LegacyBuildStorage
Data stored in the monitor Information about the build that would fail in Production mode.static class
LegacyMonitorData.LegacyJobInfoItemModel
For Jelly display only Holds information of the job and builds that would fail in Production mode.
-
Constructor Summary
Constructors Constructor Description LegacyMonitorData()
ctor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLegacyJob(Job<?,?> jobTryingToCopy, Job<?,?> jobToBeCopiedFrom, Date lastBuildDate, String username)
Add information that would fail in Production mode.List<LegacyMonitorData.LegacyBuildInfoModel>
buildDataForCurrentUser()
Helper to ease the display of the information in a tableboolean
hasJobFullName(String jobFullName)
Check a job is listed either as a source job or a destination job.boolean
isEmpty()
void
onJobRename(String previousFullName, String newFullName)
Apply the rename to the job list.boolean
removeLegacyJob(String jobFullNameFrom, String jobFullNameTo)
Remove information that would fail in Production mode.
-
-
-
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).
-
-