Class OldDataConverter
java.lang.Object
hudson.model.listeners.ItemListener
com.sonyericsson.jenkins.plugins.bfa.utils.OldDataConverter
- All Implemented Interfaces:
ExtensionPoint
Converts old
FoundIndication
s with line number info to
the new format using line matcher.- Author:
- Robert Sandell <robert.sandell@sonymobile.com>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A work task that does the actual conversion in an executor thread.static class
Work to convertFailureCauseMatrixBuildAction
s to useFailureCauseMatrixBuildAction.runIds
instead of run instances during serialization.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The size of the thread pool.static final int
The seconds to delay actual processing of the conversion. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
convertFoundIndications
(Run build) Adds the provided build to the queue of builds to convertFoundIndication
s in, unless the conversion for that build is already in progress.void
convertMatrixBuildAction
(String matrixProjectName, FailureCauseMatrixBuildAction action) ConvertFailureCauseMatrixBuildAction
s to useFailureCauseMatrixBuildAction.runIds
instead of run instances during serialization.static OldDataConverter
Retrieves the singleton instance fromItemListener.all()
.void
onLoaded()
void
Waits until there are no more running conversion tasks.Methods inherited from class hudson.model.listeners.ItemListener
all, checkBeforeCopy, checkBeforeDelete, fireLocationChange, fireOnCopied, fireOnCreated, fireOnDeleted, fireOnUpdated, onBeforeShutdown, onCheckCopy, onCheckDelete, onCopied, onCreated, onDeleted, onLocationChanged, onRenamed, onUpdated, register
-
Field Details
-
POOL_SIZE
public static final int POOL_SIZEThe size of the thread pool. -
SCHEDULE_DELAY
public static final int SCHEDULE_DELAYThe seconds to delay actual processing of the conversion.
-
-
Constructor Details
-
OldDataConverter
public OldDataConverter()Default Constructor. Should only be instantiated by Jenkins
-
-
Method Details
-
getInstance
Retrieves the singleton instance fromItemListener.all()
. If it is not found there anIllegalStateException
will be thrown.- Returns:
- the converter.
-
convertFoundIndications
Adds the provided build to the queue of builds to convertFoundIndication
s in, unless the conversion for that build is already in progress.- Parameters:
build
- the build to convert.
-
convertMatrixBuildAction
public void convertMatrixBuildAction(String matrixProjectName, FailureCauseMatrixBuildAction action) ConvertFailureCauseMatrixBuildAction
s to useFailureCauseMatrixBuildAction.runIds
instead of run instances during serialization. Will schedule the conversion until all items in Jenkins has been loaded.- Parameters:
action
- the action to fix.matrixProjectName
- the name of the matrix project.
-
onLoaded
public void onLoaded()- Overrides:
onLoaded
in classItemListener
-
waitForInitialCompletion
Waits until there are no more running conversion tasks. Since builds are lazy loaded the returning of this method does not mean that all needed builds are converted, only those loaded before or during this method was invoked.- Throws:
InterruptedException
- if so while sleeping
-