com.sonyericsson.jenkins.plugins.bfa.utils
Class OldDataConverter

java.lang.Object
  extended by hudson.model.listeners.ItemListener
      extended by com.sonyericsson.jenkins.plugins.bfa.utils.OldDataConverter
All Implemented Interfaces:
hudson.ExtensionPoint

@Extension
public final class OldDataConverter
extends hudson.model.listeners.ItemListener

Converts old FoundIndications with line number info to the new format using line matcher.

Author:
Robert Sandell <robert.sandell@sonymobile.com>

Nested Class Summary
static class OldDataConverter.FoundIndicationWork
          A work task that does the actual conversion in an executor thread.
static class OldDataConverter.MatrixBuildActionWork
          Work to convert FailureCauseMatrixBuildActions to use FailureCauseMatrixBuildAction.runIds instead of run instances during serialization.
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
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
OldDataConverter()
          Default Constructor.
 
Method Summary
 void convertFoundIndications(hudson.model.AbstractBuild build)
          Adds the provided build to the queue of builds to convert FoundIndications in, unless the conversion for that build is already in progress.
 void convertMatrixBuildAction(String matrixProjectName, FailureCauseMatrixBuildAction action)
          Convert FailureCauseMatrixBuildActions to use FailureCauseMatrixBuildAction.runIds instead of run instances during serialization.
static OldDataConverter getInstance()
          Retrieves the singleton instance from ItemListener.all().
 void onLoaded()
           
 
Methods inherited from class hudson.model.listeners.ItemListener
all, fireOnCopied, fireOnCreated, fireOnUpdated, onBeforeShutdown, onCopied, onCreated, onDeleted, onRenamed, onUpdated, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POOL_SIZE

public static final int POOL_SIZE
The size of the thread pool.

See Also:
Executors.newScheduledThreadPool(int), Constant Field Values

SCHEDULE_DELAY

public static final int SCHEDULE_DELAY
The seconds to delay actual processing of the conversion.

See Also:
ScheduledExecutorService.schedule(java.util.concurrent.Callable, long, java.util.concurrent.TimeUnit), Constant Field Values
Constructor Detail

OldDataConverter

public OldDataConverter()
Default Constructor. Should only be instantiated by Jenkins

Method Detail

getInstance

public static OldDataConverter getInstance()
Retrieves the singleton instance from ItemListener.all(). If it is not found there an IllegalStateException will be thrown.

Returns:
the converter.

convertFoundIndications

public void convertFoundIndications(hudson.model.AbstractBuild build)
Adds the provided build to the queue of builds to convert FoundIndications 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)
Convert FailureCauseMatrixBuildActions to use FailureCauseMatrixBuildAction.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 class hudson.model.listeners.ItemListener


Copyright © 2004-2014. All Rights Reserved.