classdef CallbackServiceFactory < handle
    % CALLBACKSERVICEFACTORY is a factory to obtain action specific
    % fxptui.Web.CallbackService handler
    
    % Copyright 2019-2020 The MathWorks, Inc.
    
    methods (Static)
        function handler = getHandler(action)
            % TODO g2072146: standardize the action keys
            switch action
                case 'register'
                    handler = fxptui.Web.CallbackService.RegisterWorkflowHandler();
                case 'prepare'
                    handler = fxptui.Web.CallbackService.PrepareHandler();
                case 'optimize'
                    handler = fxptui.Web.CallbackService.OptimizeHandler();
                case 'explore'
                    handler = fxptui.Web.CallbackService.ExploreHandler();
                case 'collect'
                    handler = fxptui.Web.CallbackService.BaselineCollectHandler();
                case 'verify'
                    handler = fxptui.Web.CallbackService.VerifyCollectHandler();
                case 'propose'
                    handler = fxptui.Web.CallbackService.IterativeProposeHandler();
                case 'apply'
                    handler = fxptui.Web.CallbackService.IterativeApplyHandler();
                case 'compare'
                    handler = fxptui.Web.CallbackService.CompareVerificationHandler();
                case 'restore'
                    handler = fxptui.Web.CallbackService.RestoreHandler();
                case 'collectSettings'
                    handler = fxptui.Web.CallbackService.CollectSettingsHandler();
                case 'compareOptimize'
                    handler = fxptui.Web.CallbackService.CompareOptimizationHandler();
                case 'getRuns'
                    handler = fxptui.Web.CallbackService.RunsHandler();
                case 'export'
                    handler = fxptui.Web.CallbackService.ExportOptimizationHandler();
                otherwise
                    handler = fxptui.Web.CallbackService.CallbackHandler.empty();
            end
        end
    end
end