Class OldDataConverter
- java.lang.Object
-
- hudson.model.listeners.ItemListener
-
- com.sonyericsson.jenkins.plugins.bfa.utils.OldDataConverter
-
- All Implemented Interfaces:
ExtensionPoint
@Extension public final class OldDataConverter extends ItemListener
Converts oldFoundIndication
s with line number info to the new format using line matcher.- Author:
- Robert Sandell <robert.sandell@sonymobile.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OldDataConverter.FoundIndicationWork
A work task that does the actual conversion in an executor thread.static class
OldDataConverter.MatrixBuildActionWork
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
Fields Modifier and Type Field Description static int
POOL_SIZE
The size of the thread pool.static int
SCHEDULE_DELAY
The seconds to delay actual processing of the conversion.
-
Constructor Summary
Constructors Constructor Description OldDataConverter()
Default Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
getInstance()
Retrieves the singleton instance fromItemListener.all()
.void
onLoaded()
void
waitForInitialCompletion()
Waits until there are no more running conversion tasks.-
Methods inherited from class hudson.model.listeners.ItemListener
all, checkBeforeCopy, fireLocationChange, fireOnCopied, fireOnCreated, fireOnDeleted, fireOnUpdated, onBeforeShutdown, onCheckCopy, onCopied, onCreated, onDeleted, onLocationChanged, onRenamed, onUpdated, register
-
-
-
-
Method Detail
-
getInstance
public static OldDataConverter getInstance()
Retrieves the singleton instance fromItemListener.all()
. If it is not found there anIllegalStateException
will be thrown.- Returns:
- the converter.
-
convertFoundIndications
public void 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.- 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
public void waitForInitialCompletion() throws InterruptedException
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
-
-