package roart.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import roart.action.Action;
import roart.action.ServiceAction;
import roart.common.pipeline.PipelineConstants;

public class ComponentFactory {
    private Logger log = LoggerFactory.getLogger(this.getClass());

    public static Component factory(String component) {
        switch (component) {
        case PipelineConstants.AGGREGATORRECOMMENDERINDICATOR:
            return new ComponentRecommender();
        case PipelineConstants.PREDICTORSLSTM:
            return new ComponentPredictor();
        case PipelineConstants.MLMACD:
            return new ComponentMLMACD();
        case PipelineConstants.MLRSI:
            return new ComponentMLRSI();
        case PipelineConstants.MLMULTI:
            return new ComponentMLMulti();
        case PipelineConstants.MLINDICATOR:
            return new ComponentMLIndicator();
        default:
            return null;
        }
    }

    @Deprecated
    public ServiceAction factory(String market, String component) {
        ServiceAction serviceAction = null;
        switch (component) {
        case PipelineConstants.AGGREGATORRECOMMENDERINDICATOR:
            serviceAction = new ServiceAction(market, ServiceAction.Task.RECOMMENDER);
            break;
        case PipelineConstants.PREDICTORSLSTM:
            serviceAction = new ServiceAction(market, ServiceAction.Task.PREDICTOR);
            break;
        case PipelineConstants.MLMACD:
            serviceAction = new ServiceAction(market, ServiceAction.Task.MLMACD);
            break;
        case PipelineConstants.MLINDICATOR:
            serviceAction = new ServiceAction(market, ServiceAction.Task.MLINDICATOR);
            break;
        default:
            log.error("Non-existing component");
        }
        return serviceAction;
    }

}

@@ -732,24 +732,265 @@
 entMLRSI();%0A
+        case PipelineConstants.MLATR:%0A            return new ComponentMLATR();%0A        case PipelineConstants.MLCCI:%0A            return new ComponentMLCCI();%0A        case PipelineConstants.MLSTOCH:%0A            return new ComponentMLSTOCH();%0A
         case

Add MLATR/CCI/STOCH (I86).