public class RequestListener extends java.lang.Object implements RequestListenerInterface
RequestListenerInterface
,
RequestHandlerInterface
,
RequestHandler
,
InfoKey
,
GetStatusRet
,
GetLanguagesRet
,
GetDetalsRet
,
ConnectRet
,
SendRequestRet
Constructor and Description |
---|
RequestListener(java.lang.String dockerImg,
double dockerExecTime,
java.lang.String dockerMemLimit,
int sessionCleanerTimeInMinutes,
int sessionMaxInactivityInMinutes,
int taskMaxInactivityInMinutes)
Constructs a RequestListener
|
Modifier and Type | Method and Description |
---|---|
ConnectRet |
connect()
connects a client on the server in order to compile, interpret or compile + execute
source code
|
InfoKey |
disconnect(java.lang.String sessionKey)
disconnects a client from the server , all client specific data are removed after
|
GetDetailsRet |
getDetails(java.lang.String sessionKey,
int taskReference)
retrieves details about a submitted task
|
GetLanguagesRet |
getLanguages()
retrieves languages supported by the platform , does not require a
connection |
GetStatusRet |
getStatus(java.lang.String sessionKey,
int taskReference)
retrieves status about a submitted task
|
InfoKey |
run(java.lang.String sessionKey,
int taskReference,
java.lang.String cmdArgs,
java.lang.String stdIn)
runs previously submitted task
|
SendRequestRet |
sendRequest(java.lang.String sessionKey,
int codeLang,
java.lang.String srcCode,
java.lang.String compilOpt,
java.lang.String cmdArgs,
java.lang.String stdIn,
boolean toRun)
submits a compilation, interpretation or compilation + execution to the server
|
public RequestListener(java.lang.String dockerImg, double dockerExecTime, java.lang.String dockerMemLimit, int sessionCleanerTimeInMinutes, int sessionMaxInactivityInMinutes, int taskMaxInactivityInMinutes)
dockerImg
- docker image to usedockerExecTime
- docker container execution durationdockerMemLimit
- docker container memory limitsessionCleanerTimeInMinutes
- time interval to clean sessionssessionMaxInactivityInMinutes
- maximum time of session inactivitytaskCleanerTimeInMinutes
- time interval to clean taskstaskMaxInactivityInMinutes
- maximum time of task inactivitypublic ConnectRet connect()
connect
in interface RequestListenerInterface
public InfoKey disconnect(java.lang.String sessionKey)
disconnect
in interface RequestListenerInterface
sessionKey
- the session key as returned by precedent call to
connect
public GetLanguagesRet getLanguages()
connection
getLanguages
in interface RequestListenerInterface
public SendRequestRet sendRequest(java.lang.String sessionKey, int codeLang, java.lang.String srcCode, java.lang.String compilOpt, java.lang.String cmdArgs, java.lang.String stdIn, boolean toRun)
sendRequest
in interface RequestListenerInterface
sessionKey
- the key session for the client as returned by connect
codeLang
- the id of the language to use as returned by getLanguages
srcCode
- the source code to compile or interpret or compile and executecompilOpt
- compilation or interpretation optioncmdArgs
- command line arguments to feed the programstdIn
- standard input to give to the programtoRun
- indicate whether the program should be executed, meaningless for interpreted languagespublic InfoKey run(java.lang.String sessionKey, int taskReference, java.lang.String cmdArgs, java.lang.String stdIn)
run
in interface RequestListenerInterface
sessionKey
- the key session for the client as returned by connect
taskReference
- the task id as returned by
sendRequest
cmdArgs
- command line argument to feed the programstdIn
- standard input to give to the programpublic GetDetailsRet getDetails(java.lang.String sessionKey, int taskReference)
getDetails
in interface RequestListenerInterface
sessionKey
- the key session for the client as returned by connect
taskReference
- taskReference the task id as returned by
sendRequest
public GetStatusRet getStatus(java.lang.String sessionKey, int taskReference)
getStatus
in interface RequestListenerInterface
sessionKey
- the key session for the client as returned by connect
taskReference
- taskReference taskReference the task id as returned by
sendRequest