Interface SessionService


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

    • deleteSession

      void deleteSession(String id) throws SessionNotFoundException, SessionException
      Deletes a session. If a session has a SessionType of PUBLISHED_JOB, the transient workspace associated with the session is also be deleted.
      Parameters:
      id - The identifier of the session.
      Throws:
      SessionNotFoundException - Thrown when the session with the identifier does not exist.
      SessionException - Thrown when there is an issue when deleting the session.
    • endSession

      Ends a session.
      Parameters:
      id - The identifier of the session.
      Returns:
      The session that ended.
      Throws:
      SessionNotFoundException - Thrown when the session with the identifier does not exist.
      SessionException - Thrown if there is an issue when ending the session.
    • deleteSessions

      void deleteSessions(Set<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

      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

      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(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

      String getLogFileContents(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

      String getLogFileContentsForEngine(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.
    • getLogFileSize

      long getLogFileSize(String id) throws SessionNotFoundException, SessionException
      Gets the size (in bytes) of the log file for the session. If the session is COMPOSITE, use getLogFileSizeForEngine(String, EngineType).
      Parameters:
      id - The identifier of the session.
      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.
    • getLogFileSizeForEngine

      long getLogFileSizeForEngine(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.
    • getResultsFileContents

      String getResultsFileContents(String id) throws SessionNotFoundException, SessionException
      Gets the results file 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 getResultsFileContentsForEngine(String, EngineType).

      Parameters:
      id - The identifier of The session.
      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.
    • getResultsFileContentsForEngine

      String getResultsFileContentsForEngine(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.
    • getResultsFileSize

      long getResultsFileSize(String id) throws SessionNotFoundException, SessionException
      Gets the size (in bytes) of the results file for the session. If the session is COMPOSITE, use getResultsFileSizeForEngine(String, EngineType).
      Parameters:
      id - The identifier of the session.
      Returns:
      The results 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 results file.
    • getResultsFileSizeForEngine

      long getResultsFileSizeForEngine(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

      Set<Session> getSessionsByUser(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.
    • saveLogFileToCurrentUserWorkspace

      String saveLogFileToCurrentUserWorkspace(String id, String logPath) throws SessionNotFoundException, SessionException
      Saves the log file for the session to the current user's workspace, in the specified location. If the session is COMPOSITE, use saveLogFileForEngineToCurrentUserWorkspace(String, EngineType, String).
      Parameters:
      id - The identifier of the session.
      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.
    • saveLogFileForEngineToCurrentUserWorkspace

      String saveLogFileForEngineToCurrentUserWorkspace(String id, EngineType engineType, 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.
    • saveResultsFileToCurrentUserWorkspace

      String saveResultsFileToCurrentUserWorkspace(String id, String resultsPath) throws SessionNotFoundException, SessionException
      Saves the results file for the session to the current user's workspace, in the specified location. If the session is COMPOSITE, use saveResultsFileForEngineToCurrentUserWorkspace(String, EngineType, String).
      Parameters:
      id - The identifier of the session.
      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.
    • saveResultsFileForEngineToCurrentUserWorkspace

      String saveResultsFileForEngineToCurrentUserWorkspace(String id, EngineType engineType, 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.
    • search

      Searches sessions based on the specified query.
      Parameters:
      query - The criteria to query sessions.
      Returns:
      The results of a sessions search executed on the server.
      Throws:
      SessionSearchException - Thrown when there is an issue when searching sessions.