Class AbstractTask

java.lang.Object
com.strategyquant.tradinglib.taskImpl.AbstractTask
All Implemented Interfaces:
com.strategyquant.pluginlib.ISQPlugin, ISQTask, net.xeoh.plugins.base.Plugin

public abstract class AbstractTask extends Object implements ISQTask
The type Abstract task.
  • Field Details

    • Log

      public static final org.slf4j.Logger Log
      The constant Log.
  • Constructor Details

    • AbstractTask

      public AbstractTask(String projectName, ProgressEngine progressEngine) throws Exception
      Instantiates a new Abstract task.
      Parameters:
      projectName - the project name
      progressEngine - the progress engine
      Throws:
      Exception - the exception
  • Method Details

    • getProduct

      public String getProduct()
      Description copied from interface: com.strategyquant.pluginlib.ISQPlugin
      Gets the product.
      Specified by:
      getProduct in interface com.strategyquant.pluginlib.ISQPlugin
      Returns:
      the product
    • getDefaultConfig

      public org.jdom2.Element getDefaultConfig(String configName) throws Exception
      Description copied from interface: ISQTask
      Gets default config.
      Specified by:
      getDefaultConfig in interface ISQTask
      Parameters:
      configName - the default config name
      Returns:
      the default config
      Throws:
      Exception - the exception
    • isActive

      public boolean isActive()
      Description copied from interface: ISQTask
      Is active boolean.
      Specified by:
      isActive in interface ISQTask
      Returns:
      the boolean
    • setActive

      public void setActive(boolean active)
      Description copied from interface: ISQTask
      Sets active.
      Specified by:
      setActive in interface ISQTask
      Parameters:
      active - the active
    • getCustomName

      public String getCustomName()
      Description copied from interface: ISQTask
      Gets custom name.
      Specified by:
      getCustomName in interface ISQTask
      Returns:
      the custom name
    • setCustomName

      public void setCustomName(String name)
      Description copied from interface: ISQTask
      Sets custom name.
      Specified by:
      setCustomName in interface ISQTask
      Parameters:
      name - the task name
    • setTitle

      public void setTitle(String title)
      Description copied from interface: ISQTask
      Sets title.
      Specified by:
      setTitle in interface ISQTask
      Parameters:
      title - the task title
    • getTitle

      public String getTitle()
      Description copied from interface: ISQTask
      Gets title.
      Specified by:
      getTitle in interface ISQTask
      Returns:
      the title
    • setConfigFileName

      public void setConfigFileName(String configFileName)
      Description copied from interface: ISQTask
      Sets config file name.
      Specified by:
      setConfigFileName in interface ISQTask
      Parameters:
      configFileName - the task config file
    • getTaskXMLFileName

      public String getTaskXMLFileName()
      Description copied from interface: ISQTask
      Gets task xml file name.
      Specified by:
      getTaskXMLFileName in interface ISQTask
      Returns:
      the task xml file name
    • getSettingsData

      public TaskSettingsData getSettingsData()
      Description copied from interface: ISQTask
      Gets settings data.
      Specified by:
      getSettingsData in interface ISQTask
      Returns:
      the settings data
    • setConfig

      public void setConfig(org.jdom2.Element elSettings, boolean checkChanges, boolean readSettings)
      Description copied from interface: ISQTask
      Sets config.
      Specified by:
      setConfig in interface ISQTask
      Parameters:
      elSettings - the el settings
      checkChanges - the check changes
      readSettings - the read settings
    • getConfig

      public org.jdom2.Element getConfig()
      Description copied from interface: ISQTask
      Gets config.
      Specified by:
      getConfig in interface ISQTask
      Returns:
      the config
    • initPlugin

      public void initPlugin() throws Exception
      Description copied from interface: com.strategyquant.pluginlib.ISQPlugin
      Inits the plugin
      Specified by:
      initPlugin in interface com.strategyquant.pluginlib.ISQPlugin
      Throws:
      Exception
    • getErrorsDescription

      public String getErrorsDescription()
      Description copied from interface: ISQTask
      Gets errors description.
      Specified by:
      getErrorsDescription in interface ISQTask
      Returns:
      the errors description
    • formatWSError

      public static String formatWSError(String settingName, String fieldName, String errorMsg)
      Format ws error string.
      Parameters:
      settingName - the setting name
      fieldName - the field name
      errorMsg - the error msg
      Returns:
      the string
    • getTaskXML

      public String getTaskXML()
      Gets task xml.
      Returns:
      the task xml
    • getTaskElement

      public org.jdom2.Element getTaskElement()
      Gets task element.
      Returns:
      the task element
    • setTaskLogPrefix

      public void setTaskLogPrefix(String prefix)
      Description copied from interface: ISQTask
      Sets task log prefix.
      Specified by:
      setTaskLogPrefix in interface ISQTask
      Parameters:
      prefix - the prefix
    • afterFinish

      public void afterFinish()
      Description copied from interface: ISQTask
      After finish.
      Specified by:
      afterFinish in interface ISQTask
    • increaseNumberOfRuns

      public void increaseNumberOfRuns()
      Description copied from interface: ISQTask
      Increase number of runs.
      Specified by:
      increaseNumberOfRuns in interface ISQTask
    • getNumberOfRuns

      public int getNumberOfRuns()
      Description copied from interface: ISQTask
      Gets number of runs.
      Specified by:
      getNumberOfRuns in interface ISQTask
      Returns:
      the number of runs
    • start

      public abstract void start() throws Exception
      Description copied from interface: ISQTask
      Start.
      Specified by:
      start in interface ISQTask
      Throws:
      Exception - the exception
    • logTaskStarted

      public void logTaskStarted(ProjectGlobalLog log)
      Description copied from interface: ISQTask
      Log task started.
      Specified by:
      logTaskStarted in interface ISQTask
      Parameters:
      log - the log
    • logTaskFinished

      public void logTaskFinished(ProjectGlobalLog log)
      Description copied from interface: ISQTask
      Log task finished.
      Specified by:
      logTaskFinished in interface ISQTask
      Parameters:
      log - the log
    • getIndex

      public int getIndex()
      Description copied from interface: ISQTask
      Gets index.
      Specified by:
      getIndex in interface ISQTask
      Returns:
      the index
    • setIndex

      public void setIndex(int index)
      Description copied from interface: ISQTask
      Sets index.
      Specified by:
      setIndex in interface ISQTask
      Parameters:
      index - the index
    • getCustomValue

      public double getCustomValue(String key)
      Description copied from interface: ISQTask
      Gets custom value.
      Specified by:
      getCustomValue in interface ISQTask
      Parameters:
      key - the key
      Returns:
      the custom value