Package com.sas.lsaf.execution.session
Interface SessionService
public interface SessionService
Methods to query and manage sessions.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteSession(String id) Deletes a session.voiddeleteSessions(Set<String> ids) Deletes the sessions.endSession(String id) Ends a session.Gets a list of all of the sessions for all of the users.Gets a list of all of the sessions for the current user.Gets the log file contents for the session, if the size of the file does not exceed 5 megabytes (5,242,880 bytes).getLogFileContentsForEngine(String id, EngineType engineType) Gets the log file contents for the specifiedenginethat generated the file, if the size of the file does not exceed 5 megabytes (5,242,880 bytes).longgetLogFileSize(String id) Gets the size (in bytes) of the log file for the session.longgetLogFileSizeForEngine(String id, EngineType engineType) Gets the size (in bytes) of the log file for the specifiedenginethat generated the file.Gets the results file for the session, if the size of the file does not exceed 5 megabytes (5,242,880 bytes).getResultsFileContentsForEngine(String id, EngineType engineType) Gets the results file for the specifiedenginethat generated the file, if the size of the file does not exceed 5 megabytes (5,242,880 bytes).longGets the size (in bytes) of the results file for the session.longgetResultsFileSizeForEngine(String id, EngineType engineType) Gets the size (in bytes) of the results file for the specifiedenginethat generated the file.getSession(String id) Gets the session with the identifier.getSessionsByUser(String userId) Gets a list of the sessions for the user with the specified userId.saveLogFileForEngineToCurrentUserWorkspace(String id, EngineType engineType, String logPath) Saves the log file for the specifiedengineto the current user's workspace, in the specified location.saveLogFileToCurrentUserWorkspace(String id, String logPath) Saves the log file for the session to the current user's workspace, in the specified location.saveResultsFileForEngineToCurrentUserWorkspace(String id, EngineType engineType, String resultsPath) Saves the results file for the specifiedengineto the current user's workspace, in the specified location.saveResultsFileToCurrentUserWorkspace(String id, String resultsPath) Saves the results file for the session to the current user's workspace, in the specified location.search(SessionQuery query) Searches sessions based on the specified query.
-
Method Details
-
deleteSession
Deletes a session. If a session has aSessionTypeofPUBLISHED_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
Deletes the sessions. If a session has aSessionTypeofPUBLISHED_JOB, the transient workspace associated with the session is also be deleted.- Parameters:
ids- The sessions.
-
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
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
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
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, usegetLogFileContentsForEngine(String, EngineType).Note: Logs for
INTERACTIVEsessions 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 specifiedenginethat 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
Gets the size (in bytes) of the log file for the session. If the session isCOMPOSITE, usegetLogFileSizeForEngine(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 specifiedenginethat 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
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, usegetResultsFileContentsForEngine(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 specifiedenginethat 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
Gets the size (in bytes) of the results file for the session. If the session isCOMPOSITE, usegetResultsFileSizeForEngine(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 specifiedenginethat 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
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 isCOMPOSITE, usesaveLogFileForEngineToCurrentUserWorkspace(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 specifiedengineto 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 isCOMPOSITE, usesaveResultsFileForEngineToCurrentUserWorkspace(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 specifiedengineto 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.
-