% IMJSAccess - Interface for MJSAccess. Defines public methods to
% MJSSupportv2 which must be implemented by MJSAccess, or any decorated
% implementation thereof.

% Copyright 2020-2021 The MathWorks, Inc.

classdef (Abstract) IMJSAccess < handle
    
    methods (Abstract)
        updated = refreshClient(obj);
            
        ping(obj);
        
        serialisedToken = serialiseHashedCredential(~, digestAlgorithmChain, username, hashedBytes);
        
        addNewUser(obj, username, hashedCredential, encryptedPassword, sessionID, salt);
            
        changeCredentialsOfExistingUser(obj, username, hashedOldCredentials, hashedCredential, encryptedPassword, sessionID, salt);
        
        checkCredentialsOfExistingUser(obj, username, hashedCredentials);
            
        userExists = userExists(obj, username);
        
        values = getClusterProperties(obj, propertyNames, hashedCredentials);
        
        values = getTaskProperties(obj, taskIDs, propertyNames, hashedCredentials);
        
        values = getJobProperties(obj, jobIDs, propertyNames, hashedCredentials);
        
        setClusterProperties(obj, propertyNames, propertyValues, hashedCredentials);
        
        setTaskProperties(obj, taskIDs, propertyNames, propertyValues, hashedCredentials);
        
        setJobProperties(obj, jobIDs, propertyNames, propertyValues, hashedCredentials);
        
        listener = createMJSEventListener(obj, callback);

        sessionID = createClientSession(obj);

        closeClientSession(obj, clientSessionID);

        session = createSession(obj, supportedEncryptionAlgorithms, supportedDigestAlgorithms);
        
        closeSession(obj, sessionID);
        
        jobIDNumAndType = createJob(obj, user, entitlement, hashedCredentials, encryptor);
        
        jobIDNumAndType = createCommunicatingSPMDJob(obj, user, entitlement, hashedCredentials, encryptor);
        
        jobIDNumAndType = createCommunicatingPoolJob(obj, user, entitlement, hashedCredentials, encryptor);
        
        jobIDNumAndType = createConcurrentJob(obj, user, entitlement, hashedCredentials, encryptor);
        
        taskIDAndNums = createTask(obj, jobIDs, taskFcns, numArgsOut, argsIn, ...
            taskNames, timeouts, captureDiary, maxNumRetries, funcNames, containsCallbacks, ...
            hashedCredentials, clientSessionID);
        
        getClusterLogs(obj, saveLocation, hashedCredentials);
        
        pauseQueue(obj);
        
        resumeQueue(obj);
        
        promoteJob(obj, jobID);
        
        demoteJob(obj, jobID);
        
        jobIDNumAndTypesByState = getJobsByState(obj, states);
        
        addEventListener(obj, workUnitIDs, sessionID);

        removeEventListener(obj, workUnitIDs, sessionID);

        cancelJobs(obj, jobIDs, cancelMessages, hashedCredentials);
        
        cancelTasks(obj, taskIDs, cancelMessages, hashedCredentials);
        
        destroyJobs(obj, jobIDs, hashedCredentials);
        
        destroyTasks(obj, taskIDs, hashedCredentials);
        
        submitJobs(obj, jobIDs, hashedCredentials);
        
        submitTaskResult(obj, taskID, attempt, result, error, ...
            errorMessage, errorIdentifier, warnings, diary, hashedCredentials);
        
        setEnvironmentVariableValues(obj, jobIDs, environmentVariableMaps, hashedCredentials, encryptor);
                
        future = getJobStatusDataAsync(obj, jobIDs);
        
        hAddRemoteInvocationListener(obj, listener);
    end
end

