% GenericR2016b - Scheduler Component for Generic Schedulers for
% versions 16b and earlier
% For this version of the Generic scheduler component the integration
% scripts to be used by the cluster are specified individually.
 
%   Copyright 2016 The MathWorks, Inc.

% TODO:doc properties
% NB This class is hidden for now as the Profiles API is not yet documented
classdef (Hidden, Sealed) GenericR2016b < parallel.settings.schedulerComponent.ThirdPartyCJS
    properties (PCTGetSet, Transient, PCTConstraint = 'enum:parallel.internal.types.OperatingSystem')
        OperatingSystem
    end
    properties (PCTGetSet, Transient, PCTConstraint = 'logicalscalar')
        HasSharedFilesystem
    end
    properties (PCTGetSet, Transient, PCTConstraint = 'callback')
        IndependentSubmitFcn
        CommunicatingSubmitFcn
        GetJobStateFcn

        CancelJobFcn
        DeleteJobFcn

        CancelTaskFcn
        DeleteTaskFcn
    end
    properties (Hidden, Constant)
        Version = parallel.cluster.generic.GenericVersion.R2016b.Name;
    end
    
    methods (Hidden, Static) % Implementation of NamedNode Hidden, Static methods
        function obj = hBuildFromSettings(name, settingsNode, parentSettingsNode, varargin) 
            obj = parallel.settings.schedulerComponent.GenericR2016b(name, settingsNode, parentSettingsNode, varargin{:});
        end
    end

    methods (Access = private) % Constructor
        function obj = GenericR2016b(name, node, parentNode, varargin)
            import parallel.internal.types.SchedulerType
            obj@parallel.settings.schedulerComponent.ThirdPartyCJS(name, ...
                SchedulerType.GenericR2016b, node, parentNode, varargin{:});
        end
    end

    methods (Hidden) % overrides of CustomPropDisp
       function [n, f] = hCustomizeDisplay(obj, level)
            n = {'IndependentSubmitFcn', 'CommunicatingSubmitFcn', ...
                'OperatingSystem', 'HasSharedFilesystem', ...
                'GetJobStateFcn', 'DeleteJobFcn', 'DeleteTaskFcn', ...
                'CancelJobFcn', 'CancelTaskFcn'};
            if nargin < 2
                f = obj.get(n);
            else
                f = cellfun(@(x) obj.get(x, level), n, 'UniformOutput', false);
            end
        end
    end
    
    methods (Hidden) % overrides of SchedulerComponent methods
        function [p, v] = hGetClusterPVPairs(obj)
            % Default is that all gettable Settings props are cluster props
            gettableProps = obj.hGetPublicSettingsProperties();
            % Remove the Alias key from the list
            gettableProps = setdiff(gettableProps, {parallel.internal.settings.NamedNode.AliasKeyName});
            [p, v] = obj.getCollapsedPropertiesNoDefaultValues(gettableProps);
            % Append Version
            p = [p {'Version'}];
            v = [v {obj.Version}];
        end
    end
end
%#ok<*ATUNK> custom attributes