Class AbstractTask
java.lang.Object
com.strategyquant.tradinglib.taskImpl.AbstractTask
- All Implemented Interfaces:
com.strategyquant.pluginlib.ISQPlugin
,ISQTask
,net.xeoh.plugins.base.Plugin
The type Abstract task.
-
Field Summary
Fields inherited from interface com.strategyquant.pluginlib.ISQPlugin
PositionComparator
-
Constructor Summary
ConstructorDescriptionAbstractTask(String projectName, ProgressEngine progressEngine)
Instantiates a new Abstract task. -
Method Summary
Modifier and TypeMethodDescriptionvoid
After finish.static String
formatWSError(String settingName, String fieldName, String errorMsg)
Format ws error string.org.jdom2.Element
Gets config.Gets custom name.double
getCustomValue(String key)
Gets custom value.org.jdom2.Element
getDefaultConfig(String configName)
Gets default config.Gets errors description.int
getIndex()
Gets index.int
Gets number of runs.Gets the product.Gets settings data.org.jdom2.Element
Gets task element.Gets task xml.Gets task xml file name.getTitle()
Gets title.void
Increase number of runs.void
Inits the pluginboolean
isActive()
Is active boolean.void
Log task finished.void
Log task started.void
setActive(boolean active)
Sets active.void
setConfig(org.jdom2.Element elSettings, boolean checkChanges, boolean readSettings)
Sets config.void
setConfigFileName(String configFileName)
Sets config file name.void
setCustomName(String name)
Sets custom name.void
setIndex(int index)
Sets index.void
setTaskLogPrefix(String prefix)
Sets task log prefix.void
Sets title.abstract void
start()
Start.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.strategyquant.pluginlib.ISQPlugin
getPreferredPosition
Methods inherited from interface com.strategyquant.tradinglib.taskImpl.ISQTask
clone, getName, getPluginFolderName, getSettings, getType
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe constant Log.
-
-
Constructor Details
-
AbstractTask
Instantiates a new Abstract task.- Parameters:
projectName
- the project nameprogressEngine
- the progress engine- Throws:
Exception
- the exception
-
-
Method Details
-
getProduct
Description copied from interface:com.strategyquant.pluginlib.ISQPlugin
Gets the product.- Specified by:
getProduct
in interfacecom.strategyquant.pluginlib.ISQPlugin
- Returns:
- the product
-
getDefaultConfig
Description copied from interface:ISQTask
Gets default config.- Specified by:
getDefaultConfig
in interfaceISQTask
- 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. -
setActive
public void setActive(boolean active)Description copied from interface:ISQTask
Sets active. -
getCustomName
Description copied from interface:ISQTask
Gets custom name.- Specified by:
getCustomName
in interfaceISQTask
- Returns:
- the custom name
-
setCustomName
Description copied from interface:ISQTask
Sets custom name.- Specified by:
setCustomName
in interfaceISQTask
- Parameters:
name
- the task name
-
setTitle
Description copied from interface:ISQTask
Sets title. -
getTitle
Description copied from interface:ISQTask
Gets title. -
setConfigFileName
Description copied from interface:ISQTask
Sets config file name.- Specified by:
setConfigFileName
in interfaceISQTask
- Parameters:
configFileName
- the task config file
-
getTaskXMLFileName
Description copied from interface:ISQTask
Gets task xml file name.- Specified by:
getTaskXMLFileName
in interfaceISQTask
- Returns:
- the task xml file name
-
getSettingsData
Description copied from interface:ISQTask
Gets settings data.- Specified by:
getSettingsData
in interfaceISQTask
- Returns:
- the settings data
-
setConfig
public void setConfig(org.jdom2.Element elSettings, boolean checkChanges, boolean readSettings)Description copied from interface:ISQTask
Sets config. -
getConfig
public org.jdom2.Element getConfig()Description copied from interface:ISQTask
Gets config. -
initPlugin
Description copied from interface:com.strategyquant.pluginlib.ISQPlugin
Inits the plugin- Specified by:
initPlugin
in interfacecom.strategyquant.pluginlib.ISQPlugin
- Throws:
Exception
-
getErrorsDescription
Description copied from interface:ISQTask
Gets errors description.- Specified by:
getErrorsDescription
in interfaceISQTask
- Returns:
- the errors description
-
formatWSError
Format ws error string.- Parameters:
settingName
- the setting namefieldName
- the field nameerrorMsg
- the error msg- Returns:
- the string
-
getTaskXML
Gets task xml.- Returns:
- the task xml
-
getTaskElement
public org.jdom2.Element getTaskElement()Gets task element.- Returns:
- the task element
-
setTaskLogPrefix
Description copied from interface:ISQTask
Sets task log prefix.- Specified by:
setTaskLogPrefix
in interfaceISQTask
- Parameters:
prefix
- the prefix
-
afterFinish
public void afterFinish()Description copied from interface:ISQTask
After finish.- Specified by:
afterFinish
in interfaceISQTask
-
increaseNumberOfRuns
public void increaseNumberOfRuns()Description copied from interface:ISQTask
Increase number of runs.- Specified by:
increaseNumberOfRuns
in interfaceISQTask
-
getNumberOfRuns
public int getNumberOfRuns()Description copied from interface:ISQTask
Gets number of runs.- Specified by:
getNumberOfRuns
in interfaceISQTask
- Returns:
- the number of runs
-
start
Description copied from interface:ISQTask
Start. -
logTaskStarted
Description copied from interface:ISQTask
Log task started.- Specified by:
logTaskStarted
in interfaceISQTask
- Parameters:
log
- the log
-
logTaskFinished
Description copied from interface:ISQTask
Log task finished.- Specified by:
logTaskFinished
in interfaceISQTask
- Parameters:
log
- the log
-
getIndex
public int getIndex()Description copied from interface:ISQTask
Gets index. -
setIndex
public void setIndex(int index)Description copied from interface:ISQTask
Sets index. -
getCustomValue
Description copied from interface:ISQTask
Gets custom value.- Specified by:
getCustomValue
in interfaceISQTask
- Parameters:
key
- the key- Returns:
- the custom value
-