Interface SessionService


  • public interface SessionService
    Methods to query and manage sessions.
    • Method Detail

      • deleteSessions

        void deleteSessions​(java.util.Set<java.lang.String> ids)
        Deletes the sessions. If a session has a SessionType of PUBLISHED_JOB, the transient workspace associated with the session is also be deleted.
        Parameters:
        ids - The sessions.
      • getAllSessions

        java.util.Set<Session> getAllSessions()
        Gets a list of all of the sessions for all of the users. This method requires the Manage All Sessions privilege.
        Returns:
        A list of all of the sessions for all of the users.
      • getCurrentUserSessions

        java.util.Set<Session> getCurrentUserSessions()
        Gets a list of all of the sessions for the current user.
        Returns:
        a list of all of the sessions for the current user.
      • getSession

        Session getSession​(java.lang.String id)
                    throws SessionNotFoundException
        Gets the session with the identifier.
        Parameters:
        id - The identifier that represents the session.
        Returns:
        The session.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
      • getLogFileContents

        java.lang.String getLogFileContents​(java.lang.String id)
                                     throws SessionNotFoundException,
                                            SessionException
        Gets the log file contents for the session, if the size of the file does not exceed 5 megabytes (5,242,880 bytes). If the file size exceeds the maximum , an IllegalArgumentException is thrown.

        If the session is COMPOSITE, use getLogFileContentsForEngine(String, EngineType).

        Note: Logs for INTERACTIVE sessions return cumulative logs for all submissions completed within the session.

        Parameters:
        id - The identifier of the session.
        Returns:
        The contents of the log file for the session.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when getting the contents of the log file.
      • getLogFileContentsForEngine

        java.lang.String getLogFileContentsForEngine​(java.lang.String id,
                                                     EngineType engineType)
                                              throws SessionNotFoundException,
                                                     SessionException
        Gets the log file contents for the specified engine that generated the file, if the size of the file does not exceed 5 megabytes (5,242,880 bytes). If the file size exceeds the maximum , an IllegalArgumentException is thrown.
        Parameters:
        id - The identifier of the session.
        engineType - The type of session engine that generated the file.
        Returns:
        The contents of the log file for the session.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when getting the contents of the log file.
      • getLogFileSizeForEngine

        long getLogFileSizeForEngine​(java.lang.String id,
                                     EngineType engineType)
                              throws SessionNotFoundException,
                                     SessionException
        Gets the size (in bytes) of the log file for the specified engine that generated the file.
        Parameters:
        id - The identifier of the session.
        engineType - The type of session engine that generated the file.
        Returns:
        The log file size (in bytes).
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when getting the size of the log file.
      • getResultsFileContentsForEngine

        java.lang.String getResultsFileContentsForEngine​(java.lang.String id,
                                                         EngineType engineType)
                                                  throws SessionNotFoundException,
                                                         SessionException
        Gets the results file for the specified engine that generated the file, if the size of the file does not exceed 5 megabytes (5,242,880 bytes). If the file size exceeds the maximum, an IllegalArgumentException is thrown.
        Parameters:
        id - The identifier of the session.
        engineType - The type of session engine that generated the file.
        Returns:
        The contents of the results file.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when getting the contents of the results file.
      • getResultsFileSizeForEngine

        long getResultsFileSizeForEngine​(java.lang.String id,
                                         EngineType engineType)
                                  throws SessionNotFoundException,
                                         SessionException
        Gets the size (in bytes) of the results file for the specified engine that generated the file.
        Parameters:
        id - The identifier of the session.
        engineType - The type of session engine that generated the file.
        Returns:
        The results file size (in bytes).
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when saving the contents of the results file.
      • getSessionsByUser

        java.util.Set<Session> getSessionsByUser​(java.lang.String userId)
        Gets a list of the sessions for the user with the specified userId.
        Parameters:
        userId - The userId of the user who started the session.
        Returns:
        A list of sessions for the user.
      • saveLogFileForEngineToCurrentUserWorkspace

        java.lang.String saveLogFileForEngineToCurrentUserWorkspace​(java.lang.String id,
                                                                    EngineType engineType,
                                                                    java.lang.String logPath)
                                                             throws SessionNotFoundException,
                                                                    SessionException
        Saves the log file for the specified engine to the current user's workspace, in the specified location.
        Parameters:
        id - The identifier of the session.
        engineType - The type of session engine that generated the file.
        logPath - The full path of destination log file.
        Returns:
        The path of the log file to save in the current user's workspace.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when saving the contents of the log file.
      • saveResultsFileForEngineToCurrentUserWorkspace

        java.lang.String saveResultsFileForEngineToCurrentUserWorkspace​(java.lang.String id,
                                                                        EngineType engineType,
                                                                        java.lang.String resultsPath)
                                                                 throws SessionNotFoundException,
                                                                        SessionException
        Saves the results file for the specified engine to the current user's workspace, in the specified location.
        Parameters:
        id - The identifier of the session.
        engineType - The type of system that generated the file.
        resultsPath - The full path of results file.
        Returns:
        The path of the results file to save in the current user's workspace.
        Throws:
        SessionNotFoundException - Thrown when the session does not exist.
        SessionException - Thrown when there is an issue when saving the contents of the results file.