salto.batch.lanceur.builder
Class TraitementConfiguration

java.lang.Object
  extended by AbstractConfiguration
      extended by salto.batch.lanceur.builder.TraitementConfiguration
All Implemented Interfaces:
java.io.Serializable

public class TraitementConfiguration
extends AbstractConfiguration
implements java.io.Serializable

Configuration Bean for a Batch. Central class that links together:

Used in Subclasses of TraitementConfiguration#registerAsBatch() methods to build a configuration.
TraitementConfiguration#save() must be called at end of configuration.

Author:
Philippe Mouawad

Nested Class Summary
static class TraitementConfiguration.TraitementConfigurationMemento
           
 
Field Summary
static java.lang.String ATTRIBUTE_IN_CONTEXT
           
 
Constructor Summary
TraitementConfiguration()
           
 
Method Summary
 void addLinker(AbstractLinker linker)
           
 void computeMemento()
           
 void destroy()
          Un destroy n'est possible que si aucun batch de la configuration n'est en train de tourner.
 void destroyLaunchOfFamily(java.lang.String launchFamily)
          This method unregisters a batch launch knowing the family.
 void disable()
           
 void enable()
           
 boolean equals(java.lang.Object obj)
           
 LanceurActionOnErrorEnum getActionOnError()
           
 IBatchAppender getBatchAppender()
           
 IBatchBuilder getBatchBuilder()
           
 IBatchLauncher getBatchLauncher()
           
 BuilderTypeEnum getBuilderTypeEnum()
           
 java.lang.String[] getChildNames()
           
 java.lang.String getDescription()
           
 java.lang.String getFullName()
           
 java.lang.String getGroup()
           
 IdComputer getIdComputer()
           
 java.lang.String getKey()
           
 java.util.List getLaunches(java.lang.String batchName)
           
 AbstractLinker[] getLinkers()
           
 int getMaxJob()
           
 int getMaxThreads()
           
 Memento getMemento()
           
 int getMinJob()
           
 int getMinThreads()
           
 java.lang.String getName()
           
 long getTempo()
           
 java.lang.String getTrtClassName()
           
 int hashCode()
           
 boolean isDisabled()
           
 boolean isMultipleLaunch()
           
 MultipleBatchLauncher newMultipleBatchLauncher(IBatchStart batchStarter)
          Deprecated. Only for compatibility with SI3SI, use TraitementConfigurationnewMultipleBatchLauncher(IBatchStart, DBBatchStartParametersComputer)
 MultipleBatchLauncher newMultipleBatchLauncher(IBatchStart batchStarter, DBBatchStartParametersComputer batchStartParamsComputer)
          Create a Multiple Launcher
 void register()
          Register configuration in scheduler
 void register(java.lang.String launchFamilyName)
          Registers launches of the given family for this configuration
 void reload()
           
 IConfiguration reloadGenericConfiguration()
          Reloads only the configuration from the database
 void reloadLaunchOfFamily(java.lang.String launchFamilyName)
          This method reloads this configurations but only for launches that belongs to the given launch family
 boolean removeLinker(AbstractLinker linker)
           
 void restore()
           
 BatchReloadDisableResult restoreFromDB()
          Reloads the configuration from the database.
 void save()
          Permet de sauvegarder la configuration.
 void setActionOnError(LanceurActionOnErrorEnum actionOnError)
           
 void setActionWhenError(LanceurActionOnErrorEnum actionOnError)
          Deprecated. use setActionOnError
 void setAppender(IBatchAppender batchppender)
          Deprecated. use setBatchAppender()
 void setBasicBatchLauncher(BasicBatchLauncher basicBatchLauncher)
           
 void setBatchAppender(IBatchAppender batchAppender)
           
 void setBatchStart(IBatchStart batchStart)
           
 void setDescription(java.lang.String description)
           
 void setDisabled(boolean disabled)
           
 void setGroup(java.lang.String batchGroup)
           
 void setIdComputer(IdComputer computer)
           
 void setLinkers(AbstractLinker[] linkers)
           
 void setMaxJob(int maxJob)
           
 void setMaxThreads(int maxThreads)
           
 void setMinJob(int minJob)
           
 void setMinThreads(int minThreads)
           
 void setMultipleBatchLauncher(MultipleBatchLauncher multipleBatchLauncher)
           
 void setMultipleBatchStart(MultipleBatchLauncher metaBatchStart)
           
 void setName(java.lang.String batchName)
           
 void setTempo(long tempo)
           
 void setTrtClass(java.lang.String className)
          Deprecated. pour réduire impact migration, utiliser setTrtClassName
 void setTrtClassName(java.lang.String trtClassName)
           
 java.lang.String toString()
           
 java.util.List validateConfiguration()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_IN_CONTEXT

public static final java.lang.String ATTRIBUTE_IN_CONTEXT
Constructor Detail

TraitementConfiguration

public TraitementConfiguration()
Method Detail

getBatchBuilder

public IBatchBuilder getBatchBuilder()
                              throws BatchInitException
Returns:
IBatchBuilder le constructeur correspondant à la configuration.
Throws:
BatchInitException

setMultipleBatchStart

public void setMultipleBatchStart(MultipleBatchLauncher metaBatchStart)
Parameters:
metaBatchStart - The metaBatchStart to set.

setBatchStart

public void setBatchStart(IBatchStart batchStart)
Parameters:
batchStart - The metaBatchStart to set.

save

public void save()
          throws BatchException
Permet de sauvegarder la configuration.

Throws:
BatchException

restore

public void restore()
             throws BatchException
Throws:
BatchException
See Also:
salto.batch.lanceur.builder.IConfiguration#restore()

getActionOnError

public LanceurActionOnErrorEnum getActionOnError()
Returns:
Returns the actionOnError.

setActionOnError

public void setActionOnError(LanceurActionOnErrorEnum actionOnError)
Parameters:
actionOnError - The actionOnError to set.

getBatchAppender

public IBatchAppender getBatchAppender()
Returns:
Returns the batchAppender.

setBatchAppender

public void setBatchAppender(IBatchAppender batchAppender)
Parameters:
batchAppender - The batchAppender to set.

getGroup

public java.lang.String getGroup()
Returns:
Returns the group.

setGroup

public void setGroup(java.lang.String batchGroup)
Parameters:
batchGroup - The group to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String batchName)
Parameters:
batchName - The name to set.

getLinkers

public AbstractLinker[] getLinkers()
Returns:
Returns the linkers.

setLinkers

public void setLinkers(AbstractLinker[] linkers)
Parameters:
linkers - The linkers to set.

getMaxJob

public int getMaxJob()
Returns:
Returns the maxJob.

setMaxJob

public void setMaxJob(int maxJob)
Parameters:
maxJob - The maxJob to set.

getMaxThreads

public int getMaxThreads()
Returns:
Returns the maxThreads.

setMaxThreads

public void setMaxThreads(int maxThreads)
Parameters:
maxThreads - The maxThreads to set.

getBatchLauncher

public IBatchLauncher getBatchLauncher()
Returns:
Returns the metaBatchStart.

getMinJob

public int getMinJob()
Returns:
Returns the minJob.

setMinJob

public void setMinJob(int minJob)
Parameters:
minJob - The minJob to set.

getMinThreads

public int getMinThreads()
Returns:
Returns the minThreads.

setMinThreads

public void setMinThreads(int minThreads)
Parameters:
minThreads - The minThreads to set.

getTrtClassName

public java.lang.String getTrtClassName()
Returns:
Returns the trtClassName.

setTrtClassName

public void setTrtClassName(java.lang.String trtClassName)
Parameters:
trtClassName - The trtClassName to set.

isDisabled

public boolean isDisabled()
Returns:
Returns the disabled.

setDisabled

public void setDisabled(boolean disabled)
Parameters:
disabled - The disabled to set.

isMultipleLaunch

public boolean isMultipleLaunch()
Returns:
Returns the multipleLaunch.

getTempo

public long getTempo()
Returns:
Returns the tempo.

setTempo

public void setTempo(long tempo)
Parameters:
tempo - The tempo to set.

setTrtClass

public void setTrtClass(java.lang.String className)
Deprecated. pour réduire impact migration, utiliser setTrtClassName

Parameters:
className - Classe du traitement

setActionWhenError

public void setActionWhenError(LanceurActionOnErrorEnum actionOnError)
Deprecated. use setActionOnError

Parameters:
actionOnError -

setAppender

public void setAppender(IBatchAppender batchppender)
Deprecated. use setBatchAppender()

Parameters:
batchppender -

register

public final void register()
                    throws BatchException,
                           SchedulerException
Register configuration in scheduler

Throws:
BatchException
SchedulerException

register

public final void register(java.lang.String launchFamilyName)
                    throws BatchException,
                           SchedulerException
Registers launches of the given family for this configuration

Parameters:
launchFamilyName - String launch family name
Throws:
BatchException
SchedulerException
Since:
3.0.0.7

setIdComputer

public void setIdComputer(IdComputer computer)
Parameters:
computer - IdComputer

getIdComputer

public IdComputer getIdComputer()
Returns:
Returns the idComputer.

newMultipleBatchLauncher

public final MultipleBatchLauncher newMultipleBatchLauncher(IBatchStart batchStarter,
                                                            DBBatchStartParametersComputer batchStartParamsComputer)
Create a Multiple Launcher

Parameters:
batchStarter - IBatchStart
batchStartParamsComputer - DBBatchStartParametersComputer used to get Launches from DB
Returns:
MultipleBatchLauncher

newMultipleBatchLauncher

public final MultipleBatchLauncher newMultipleBatchLauncher(IBatchStart batchStarter)
Deprecated. Only for compatibility with SI3SI, use TraitementConfigurationnewMultipleBatchLauncher(IBatchStart, DBBatchStartParametersComputer)

Create a Multiple Launcher

Parameters:
batchStarter - IBatchStart
Returns:
MultipleBatchLauncher

addLinker

public void addLinker(AbstractLinker linker)
Parameters:
linker -

removeLinker

public boolean removeLinker(AbstractLinker linker)
Parameters:
linker - AbstractLinker to remove
Returns:
boolean true if linker was removed

setBasicBatchLauncher

public void setBasicBatchLauncher(BasicBatchLauncher basicBatchLauncher)
Parameters:
basicBatchLauncher -

setMultipleBatchLauncher

public void setMultipleBatchLauncher(MultipleBatchLauncher multipleBatchLauncher)
Parameters:
multipleBatchLauncher -

getBuilderTypeEnum

public final BuilderTypeEnum getBuilderTypeEnum()
Returns:
Returns the builderTypeEnum.

destroy

public void destroy()
             throws BatchException,
                    SchedulerException
Un destroy n'est possible que si aucun batch de la configuration n'est en train de tourner.

Throws:
BatchException
SchedulerException
See Also:
salto.batch.lanceur.builder.IConfiguration#destroy()

destroyLaunchOfFamily

public void destroyLaunchOfFamily(java.lang.String launchFamily)
                           throws BatchException,
                                  SchedulerException
This method unregisters a batch launch knowing the family. We do not need to lock the launch as it has already been locked before.

Parameters:
launchFamily - the launch family name
Throws:
BatchException
SchedulerException
Since:
3.0.0.7

getFullName

public java.lang.String getFullName()
Returns:
Nom complet de la configuration

getMemento

public Memento getMemento()
See Also:
salto.batch.lanceur.builder.IConfiguration#getMemento()

computeMemento

public final void computeMemento()
                          throws BatchInitException
Throws:
BatchInitException
See Also:
salto.batch.lanceur.builder.IConfiguration#computeMemento()

reload

public void reload()
            throws BatchException,
                   SchedulerException
Throws:
BatchException
SchedulerException
See Also:
salto.batch.lanceur.builder.IConfiguration#reload()

reloadLaunchOfFamily

public void reloadLaunchOfFamily(java.lang.String launchFamilyName)
                          throws BatchException,
                                 SchedulerException
This method reloads this configurations but only for launches that belongs to the given launch family

Parameters:
launchFamilyName - the name of the launch family
Throws:
BatchException
SchedulerException
Since:
3.0.0.7

reloadGenericConfiguration

public IConfiguration reloadGenericConfiguration()
                                          throws BatchException
Reloads only the configuration from the database

Throws:
BatchException

disable

public final void disable()
See Also:
setDisabled(boolean)

enable

public void enable()
See Also:
salto.batch.lanceur.builder.IConfiguration#enable()

getChildNames

public java.lang.String[] getChildNames()
                                 throws BatchInitException
Throws:
BatchInitException
See Also:
salto.batch.lanceur.builder.IConfiguration#getChildNames()

validateConfiguration

public java.util.List validateConfiguration()
See Also:
salto.batch.lanceur.builder.AbstractConfiguration#validateConfiguration()

toString

public java.lang.String toString()
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
See Also:
Object.hashCode()

getKey

public java.lang.String getKey()

getDescription

public final java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public final void setDescription(java.lang.String description)
Parameters:
description - The description to set.

restoreFromDB

public BatchReloadDisableResult restoreFromDB()
                                       throws BatchException,
                                              SchedulerException
Reloads the configuration from the database.
If the batch is not running, the reload is done now, otherwise we wait for the end.
If it is a batch with launches, we do the same thing as above for each launch

Returns:
status and message for the action
Throws:
BatchException
SchedulerException

getLaunches

public final java.util.List getLaunches(java.lang.String batchName)
                                 throws BatchInitException
Parameters:
batchName - name of the batch
Returns:
the list of launches for this batch
Throws:
BatchInitException


Copyright © 2005-2008 Ubik-Ingenierie. All Rights Reserved.