Class LegacyJobConfigMigrationMonitor
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- hudson.model.AdministrativeMonitor
-
- hudson.plugins.copyartifact.monitor.LegacyJobConfigMigrationMonitor
-
- All Implemented Interfaces:
ExtensionPoint
,ModelObject
,Saveable
,SearchableModelObject
,SearchItem
,org.kohsuke.stapler.StaplerProxy
@Extension @Symbol("copyArtifactLegacyJobConfigMigration") public class LegacyJobConfigMigrationMonitor extends AdministrativeMonitor implements Saveable
Monitor the list of legacy job configuration that require administrator attention- Since:
- 1.44
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LegacyJobConfigMigrationMonitor.ListenerImpl
To keep track of the job rename that occurs while the application is runningstatic class
LegacyJobConfigMigrationMonitor.MigrateAllSelectedFromAndTo
Used from jelly (stapler) to hold a selected item.static class
LegacyJobConfigMigrationMonitor.MigrateAllSelectedModel
Used from jelly (stapler) to hold selected items.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description LegacyJobConfigMigrationMonitor()
ctor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLegacyJob(Job<?,?> jobTryingToCopy, Job<?,?> jobToBeCopiedFrom, Date lastBuildDate, String username)
Add information of the source job and destination job that would fail in Production mode.void
doHelpDetailedSteps(org.kohsuke.stapler.StaplerResponse rsp)
Called from jelly (stapler).org.kohsuke.stapler.HttpResponse
doIgnoreAllSelected(LegacyJobConfigMigrationMonitor.MigrateAllSelectedModel content)
Called from jelly (stapler).org.kohsuke.stapler.HttpResponse
doMigrateAllSelected(LegacyJobConfigMigrationMonitor.MigrateAllSelectedModel content)
Called from jelly (stapler).static LegacyJobConfigMigrationMonitor
get()
List<LegacyMonitorData.LegacyBuildInfoModel>
getAllJobInformation()
Used by Jellystatic XmlFile
getConfigXml()
String
getDisplayName()
boolean
isActivated()
void
load()
Load recorded warnings from serialized data.void
removeLegacyJob(Job<?,?> jobTryingToCopy, Job<?,?> jobToBeCopiedFrom)
Remove information of the source job and destination job that would fail in Production mode.void
save()
Save recorded warnings to the file.-
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getRequiredPermission, getSearchUrl, getTarget, getUrl, isEnabled, isSecurity
-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classAdministrativeMonitor
-
isActivated
public boolean isActivated()
- Specified by:
isActivated
in classAdministrativeMonitor
-
load
public void load()
Load recorded warnings from serialized data.
-
save
public void save()
Save recorded warnings to the file.- Specified by:
save
in interfaceSaveable
- See Also:
Saveable.save()
-
getConfigXml
@NonNull public static XmlFile getConfigXml()
- Returns:
- the path of the xml file to save warnings.
-
getAllJobInformation
@NonNull @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public List<LegacyMonitorData.LegacyBuildInfoModel> getAllJobInformation()
Used by Jelly- Returns:
- the list of the source and destination jobs to warn.
-
addLegacyJob
public void addLegacyJob(@NonNull Job<?,?> jobTryingToCopy, @NonNull Job<?,?> jobToBeCopiedFrom, @NonNull Date lastBuildDate, @NonNull String username)
Add information of the source job and destination job that would fail in Production mode.- Parameters:
jobTryingToCopy
- the destination job.jobToBeCopiedFrom
- the source job.lastBuildDate
- the build timestamp.username
- the user name the destination job ran as.
-
removeLegacyJob
public void removeLegacyJob(@NonNull Job<?,?> jobTryingToCopy, @NonNull Job<?,?> jobToBeCopiedFrom)
Remove information of the source job and destination job that would fail in Production mode.- Parameters:
jobTryingToCopy
- the destination job.jobToBeCopiedFrom
- the source job.
-
doIgnoreAllSelected
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doIgnoreAllSelected(@JsonBody LegacyJobConfigMigrationMonitor.MigrateAllSelectedModel content)
Called from jelly (stapler). Ignore selected items.- Parameters:
content
- selected items.- Returns:
- the response.
-
doMigrateAllSelected
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doMigrateAllSelected(@JsonBody LegacyJobConfigMigrationMonitor.MigrateAllSelectedModel content)
Called from jelly (stapler). Apply automatic migrations to selected items. AddCopyArtifactPermissionProperty
to the source jobs.- Parameters:
content
- selected items.- Returns:
- the response.
-
get
@NonNull public static LegacyJobConfigMigrationMonitor get()
- Returns:
- the singleton instance.
-
doHelpDetailedSteps
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public void doHelpDetailedSteps(org.kohsuke.stapler.StaplerResponse rsp) throws IOException
Called from jelly (stapler). Returns the contents of help-detailedSteps.html- Parameters:
rsp
- to write contents to.- Throws:
IOException
- servlet communication errors.
-
-