Class OldDataConverter
java.lang.Object
hudson.model.listeners.ItemListener
com.sonyericsson.jenkins.plugins.bfa.utils.OldDataConverter
- All Implemented Interfaces:
ExtensionPoint
Converts old
FoundIndications with line number info to
the new format using line matcher.- Author:
- Robert Sandell <robert.sandell@sonymobile.com>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA work task that does the actual conversion in an executor thread.static classWork to convertFailureCauseMatrixBuildActions to useFailureCauseMatrixBuildAction.runIdsinstead of run instances during serialization.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe size of the thread pool.static final intThe seconds to delay actual processing of the conversion. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconvertFoundIndications(Run build) Adds the provided build to the queue of builds to convertFoundIndications in, unless the conversion for that build is already in progress.voidconvertMatrixBuildAction(String matrixProjectName, FailureCauseMatrixBuildAction action) ConvertFailureCauseMatrixBuildActions to useFailureCauseMatrixBuildAction.runIdsinstead of run instances during serialization.static OldDataConverterRetrieves the singleton instance fromItemListener.all().voidonLoaded()voidWaits 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 anIllegalStateExceptionwill be thrown.- Returns:
- the converter.
-
convertFoundIndications
Adds the provided build to the queue of builds to convertFoundIndications 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) ConvertFailureCauseMatrixBuildActions to useFailureCauseMatrixBuildAction.runIdsinstead 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:
onLoadedin 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
-