public class RestSmartProxyImpl extends AbstractSmartProxy<RestJobTrackerImpl> implements ISchedulerClient, SchedulerEventListener, DisconnectionAwareSchedulerEventListener
Any instance of this class must be initialized by calling the ISchedulerClient.init(ConnectionInfo)
method before executing any subsequent method. Not
respecting this rule may lead to an NPE or an unexpected behaviour.
configuredEvents, connectionInfo, eventListeners, GENERIC_INFO_INPUT_FOLDER_PROPERTY_NAME, GENERIC_INFO_OUTPUT_FOLDER_PROPERTY_NAME, GENERIC_INFO_PULL_URL_PROPERTY_NAME, GENERIC_INFO_PUSH_URL_PROPERTY_NAME, jobTracker, MAX_NB_OF_DATA_TRANSFER_THREADS, PROXY_SCHED_EVENTS, terminated, terminating, threadPool
Constructor and Description |
---|
RestSmartProxyImpl() |
Modifier and Type | Method and Description |
---|---|
protected ISchedulerClient |
_getScheduler()
Returns a proxy instance to the Scheduler.
|
void |
addEventListener(SchedulerEventListenerExtended listener,
boolean myEventsOnly,
SchedulerEvent... events) |
void |
addExternalEndpointUrl(String jobId,
String endpointName,
String externalEndpointUrl,
String endpointIconUri)
Add an external endpoint url to a job.
|
Set<String> |
addJobSignal(String jobId,
String signal,
Map<String,String> updatedVariables)
Add the given signal to job signals
|
boolean |
changeStartAt(JobId jobId,
String startAt)
Change the START_AT generic information at job level and reset the
scheduledAt at task level
|
boolean |
changeStartAt(List<JobId> jobIdList,
String startAt)
Change the START_AT generic information for multiple jobs at job level and reset the
scheduledAt at task level
|
boolean |
checkJobPermissionMethod(String jobId,
String method)
Check if the connected user has the permission to execute the method passed as argument
|
List<String> |
checkJobsPermissionMethod(List<String> jobIds,
String method)
Check if the connected user has the permission to execute the method passed as argument
|
boolean |
checkPermission(String method)
Checks if the current user is allowed to execute the provided method
|
protected void |
createFolder(String fUri) |
boolean |
deleteFile(String space,
String pathname)
Deletes the specified file from the server.
|
void |
detachService(String jobId,
int serviceInstanceid)
Detach a cloud automation service previously associated with the given job
|
void |
disconnect()
Disconnect from the scheduler
|
protected void |
downloadTaskOutputFiles(AwaitedJob awaitedjob,
String jobId,
String taskName,
String localFolder)
Pull the output files of the given task from the pull_url either to the localFolder defined for the job or to the localFolder specified as argument, if it is not null.
|
void |
enableRemoteVisualization(String jobId,
String taskName,
String connectionString)
Enable Remote visualization for the given job and task
|
boolean |
finishInErrorTask(String jobId,
String taskName) |
ConnectionInfo |
getConnectionInfo()
Returns the connection info, if initialized previously
|
String |
getCurrentPolicy()
Return the name of the current Policy
|
String |
getCurrentUser()
Returns the user currently connected
|
UserData |
getCurrentUserData()
Returns the user data object associated with the user currently connected
|
List<String> |
getGlobalSpaceURIs()
Returns the GLOBAL DataSpace URI available to all users
|
String |
getJobContent(JobId jobId) |
JobInfo |
getJobInfo(String jobId)
Retrieve a job info by it id.
|
Map<Long,Map<String,Serializable>> |
getJobResultMaps(List<String> jobsId)
Return result maps associated with multiple jobs
|
JobState |
getJobState(String jobId)
Return the state of the given job.
The state contains informations about the job, every tasks and informations about the tasks. The jobId is given as a string. |
Map |
getJobsToSchedule()
Returns a job Descriptor Map with eligible jobs (running and pending)
|
Map<Object,Object> |
getPortalConfiguration() |
Map<Long,List<String>> |
getPreciousTaskNames(List<String> jobsId)
Return the list of task names declared as precious results
|
List<TaskResult> |
getPreciousTaskResults(String jobId)
Return a list of task results which where declared as "preciousResult" for the given job
|
Map<String,Object> |
getSchedulerProperties()
Returns the scheduler properties associated with the user currently connected
|
String |
getSession()
Retrieves the current session identifier, or null if the session was not initialized yet.
|
Subject |
getSubject()
Returns the current user JaaS subject
|
Page<TaskId> |
getTaskIds(String taskTag,
long from,
long to,
boolean mytasks,
Set<TaskStatus> taskStatuses,
int offset,
int limit)
Retrieve a tasks names list from the scheduler.
|
TaskStatesPage |
getTaskPaginated(String jobId,
int offset,
int limit)
Return the page of tasks of the given job.
|
TaskStatesPage |
getTaskPaginated(String jobId,
String statusFilter,
int offset,
int limit) |
TaskResult |
getTaskResult(String jobId,
String taskName)
Get the result for the given task name in the given jobId.
|
Page<TaskState> |
getTaskStates(String taskTag,
long from,
long to,
boolean mytasks,
Set<TaskStatus> statusFilter,
int offset,
int limit,
SortSpecifierContainer sortParams)
Retrieve a taskstates list from the scheduler.
|
List<TaskDescriptor> |
getTasksToSchedule()
Returns a task descriptor list with eligible tasks (ready for execution)
|
List<String> |
getUserSpaceURIs()
Returns the USER DataSpace URIs associated with the current user
|
void |
init(ConnectionInfo connectionInfo)
Connects to the scheduler
|
boolean |
isJobFinished(JobId jobId)
Returns true, if the scheduler has finished the execution of the
specified job.
|
boolean |
isJobFinished(String jobId)
Returns true, if the scheduler has terminated the execution of
the specified job.
|
boolean |
isTaskFinished(String jobId,
String taskName)
Returns true, if the scheduler has finished the execution of the
task.
|
List<JobIdDataAndError> |
multipleSubmitFromUrls(List<WorkflowUrlData> workflowUrlDataList)
Submit a list of jobs to the scheduler from a list of catalogRestURL, variables and generic information.
|
void |
notifyDisconnection()
notify the socket disconnection
|
void |
pullFile(String space,
String pathname,
String outputFile)
Retrieves the specified file from the server.
|
boolean |
pushFile(String spacename,
String pathname,
String filename,
String file)
Transfers the specified file from the local file system to the specified
dataspace at the server
|
void |
registerAsListener() |
void |
registerService(String jobId,
int serviceInstanceid,
boolean enableActions)
Register a cloud automation service associated with the given job
|
void |
removeExternalEndpointUrl(String jobId,
String endpointName)
Remove an external endpoint url from a job.
|
protected void |
removeJobIO(Job job,
String pushURL,
String pullURL,
String newFolderName) |
boolean |
restartAllInErrorTasks(String jobId)
Restart all in error tasks in the job represented by jobId.
This method will restart every in error tasks of this job. The jobId is given as a string. |
boolean |
restartInErrorTask(String jobId,
String taskName) |
JobId |
reSubmit(JobId currentJobId,
Map<String,String> jobVariables,
Map<String,String> jobGenericInfos,
String sessionId) |
void |
setSession(String sid)
Sets the session identifier explicitly.
|
JobId |
submit(File job)
Submit a new job to the scheduler.
|
JobId |
submit(File job,
Map<String,String> variables)
Submit a new job to the scheduler with provided variables.
|
JobId |
submit(File job,
Map<String,String> variables,
Map<String,String> genericInfos)
Submit a new job to the scheduler with provided variables.
|
JobId |
submit(Job job)
Submit a new job to the scheduler.
|
List<JobIdDataAndError> |
submit(List<Job> jobs)
Submit multiple jobs
|
JobId |
submit(Map<String,String> genericInfos,
URL job,
Map<String,String> variables)
Submit a new job to the scheduler with provided variables.
|
JobId |
submit(URL job)
Submit a new job to the scheduler.
|
JobId |
submit(URL job,
Map<String,String> variables)
Submit a new job to the scheduler with provided variables.
|
JobId |
submit(URL job,
Map<String,String> variables,
Map<String,String> headerParams)
Submit a new job to the scheduler with provided variables.
|
JobId |
submit(URL job,
Map<String,String> variables,
Map<String,String> genericInfos,
Map<String,String> headerParams)
Submit a new job to the scheduler with provided variables.
|
JobId |
submitFromCatalog(String catalogRestURL,
String calledWorkflow)
Submit a new job to the scheduler from the catalogRestURL without provided variables.
|
JobId |
submitFromCatalog(String catalogRestURL,
String calledWorkflow,
Map<String,String> variables)
Submit a new job to the scheduler from the catalogRestURL with provided variables.
|
JobId |
submitFromCatalog(String catalogRestURL,
String calledWorkflow,
Map<String,String> variables,
Map<String,String> genericInfo)
Submit a new job to the scheduler from the catalogRestURL with provided variables ang generic information.
|
JobId |
submitFromCatalog(String catalogRestURL,
String bucketName,
String workflowName)
Submit a new job to the scheduler from the catalogRestURL without variables.
|
JobId |
submitFromCatalog(String catalogRestURL,
String bucketName,
String workflowName,
Map<String,String> variables)
Submit a new job to the scheduler from the catalogRestURL with provided variables.
|
JobId |
submitFromCatalog(String catalogRestURL,
String bucketName,
String workflowName,
Map<String,String> variables,
Map<String,String> genericInfo)
Submit a new job to the scheduler from the catalogRestURL with provided variables.
|
void |
updateLogo(byte[] image)
Updates the logo on all portals
|
boolean |
uploadInputfiles(TaskFlowJob job,
String localInputFolderPath)
Push the input files of the given job from the local input folder to the
location specified by PUSH_URL.
|
List<JobVariable> |
validateJobSignal(String jobId,
String signal,
Map<String,String> updatedVariables)
Validate the given signal's updated variables
|
List<JobResult> |
waitForAllJobs(List<String> jobIds,
long timeout)
Causes the current thread to wait until the execution of all specified
jobs has finished or the elapse of specified wait time.
|
List<Map.Entry<String,TaskResult>> |
waitForAllTasks(String jobId,
List<String> taskNames,
long timeout)
Causes the current thread to wait until all the executions of specified
tasks finish or the elapse of specified amount of time.
|
Map.Entry<String,JobResult> |
waitForAnyJob(List<String> jobIds,
long timeout)
Causes the current thread to wait until the execution of any job finishes
or the elapse of the specified wait time.
|
Map.Entry<String,TaskResult> |
waitForAnyTask(String jobId,
List<String> taskNames,
long timeout)
Causes the current thread to wait until any of the specified tasks
finishes or the elapse of specified amount of time.
|
JobResult |
waitForJob(JobId jobId,
long timeout)
Causes the current thread to wait until the scheduler has finished the
execution of the specified job or the specified amount of time has
elapsed.
|
JobResult |
waitForJob(String jobId,
long timeout)
Causes the current thread to wait until the scheduler has finished the
execution of the specified job or the specified amount of time has
elapsed.
|
TaskResult |
waitForTask(String jobId,
String taskName,
long timeout)
Causes the current thread to wait until the scheduler has finished
executing the specified task or the elapse of specified elapse time.
|
addEventListener, addEventListener, addEventListener, changeJobPriority, changeJobPriority, changePolicy, checkInitialized, checkJobsPermissionMethods, cleanDatabase, configureEvents, createLabels, createNewFolderName, deleteLabel, freeze, getAccountUsage, getCompletedJobs, getCompletedTasks, getFilteredStatistics, getJobResult, getJobResult, getJobs, getJobServerLogs, getJobsInfoList, getJobState, getLabels, getMyAccountUsage, getState, getState, getStatus, getSubmissionModeCount, getSubmissionModeValues, getTaskResult, getTaskResultAllIncarnations, getTaskResultAllIncarnations, getTaskResultFromIncarnation, getTaskResultFromIncarnation, getTaskResultsByTag, getTaskResultsByTag, getTaskServerLogs, getTaskServerLogsByTag, getTaskState, getTopExecutionTimeWorkflows, getTopPendingTimeWorkflows, getTopWorkflowsCumulatedCoreTime, getTopWorkflowsNumberOfNodes, getTopWorkflowsWithIssues, getUsers, getUsersWithJobs, isConnected, jobStateUpdatedEvent, jobSubmittedEvent, jobUpdatedFullDataEvent, kill, killJob, killJob, killJobs, killTask, killTask, linkResourceManager, listenJobLogs, listenJobLogs, pause, pauseJob, pauseJob, preemptTask, preemptTask, prepareJobInput, prepareJobOutput, pullData, putThirdPartyCredential, reconnect, reinitializeState, reloadPolicyConfiguration, removeAwaitedTask, removeEventListener, removeEventListener, removeJob, removeJob, removeJobLabels, removeJobs, removeJobs, removeThirdPartyCredential, renewSession, restartTask, restartTask, resume, resumeJob, resumeJob, schedulerStateUpdatedEvent, setInitialized, setLabelOnJobs, setLabels, setSessionName, shutdown, start, stop, submit, submit, syncAwaitedJobs, taskStateUpdatedEvent, terminate, thirdPartyCredentialsKeySet, updateJob, updateLabel, updateTask, usersUpdatedEvent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, addEventListener, changeJobPriority, changeJobPriority, changePolicy, checkJobsPermissionMethods, createLabels, deleteLabel, freeze, getCompletedJobs, getCompletedTasks, getFilteredStatistics, getJobResult, getJobResult, getJobs, getJobServerLogs, getJobsInfoList, getJobState, getLabels, getState, getState, getStatus, getSubmissionModeCount, getSubmissionModeValues, getTaskResult, getTaskResultAllIncarnations, getTaskResultAllIncarnations, getTaskResultFromIncarnation, getTaskResultFromIncarnation, getTaskResultsByTag, getTaskResultsByTag, getTaskServerLogs, getTaskServerLogsByTag, getTaskState, getTopExecutionTimeWorkflows, getTopPendingTimeWorkflows, getTopWorkflowsCumulatedCoreTime, getTopWorkflowsNumberOfNodes, getTopWorkflowsWithIssues, getUsers, getUsersWithJobs, isConnected, kill, killJob, killJob, killJobs, killTask, killTask, linkResourceManager, listenJobLogs, listenJobLogs, pause, pauseJob, pauseJob, preemptTask, preemptTask, reloadPolicyConfiguration, removeEventListener, removeJob, removeJob, removeJobLabels, removeJobs, removeJobs, renewSession, restartTask, restartTask, resume, resumeJob, resumeJob, setLabelOnJobs, setLabels, shutdown, start, stop, updateLabel
getAccountUsage, getMyAccountUsage
putThirdPartyCredential, removeThirdPartyCredential, thirdPartyCredentialsKeySet
jobStateUpdatedEvent, jobSubmittedEvent, jobUpdatedFullDataEvent, schedulerStateUpdatedEvent, taskStateUpdatedEvent, usersUpdatedEvent
public void init(ConnectionInfo connectionInfo)
AbstractSmartProxy
init
in interface ISchedulerClient
init
in class AbstractSmartProxy<RestJobTrackerImpl>
connectionInfo
- various info about the connection attemptpublic ConnectionInfo getConnectionInfo()
ISchedulerClient
getConnectionInfo
in interface ISchedulerClient
public void disconnect() throws PermissionException
AbstractSmartProxy
disconnect
in interface Scheduler
disconnect
in class AbstractSmartProxy<RestJobTrackerImpl>
PermissionException
- if you can't access this particular method.public String getCurrentPolicy() throws NotConnectedException, PermissionException
Scheduler
getCurrentPolicy
in interface Scheduler
getCurrentPolicy
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
public Map getJobsToSchedule() throws NotConnectedException, PermissionException
Scheduler
getJobsToSchedule
in interface Scheduler
getJobsToSchedule
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
public List<TaskDescriptor> getTasksToSchedule() throws NotConnectedException, PermissionException
Scheduler
getTasksToSchedule
in interface Scheduler
getTasksToSchedule
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
protected ISchedulerClient _getScheduler()
AbstractSmartProxy
/!\ This method must not be exposed remotely since remote calls to the proxy that is returned will fail with permission failures.
_getScheduler
in class AbstractSmartProxy<RestJobTrackerImpl>
protected void createFolder(String fUri) throws NotConnectedException, PermissionException
createFolder
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
protected void removeJobIO(Job job, String pushURL, String pullURL, String newFolderName)
removeJobIO
in class AbstractSmartProxy<RestJobTrackerImpl>
public JobId reSubmit(JobId currentJobId, Map<String,String> jobVariables, Map<String,String> jobGenericInfos, String sessionId) throws NotConnectedException, UnknownJobException, PermissionException, JobCreationException, SubmissionClosedException
reSubmit
in interface Scheduler
currentJobId
- id of the already submitted jobjobVariables
- new job variables which is merged to existing job variables of the submitted jobjobGenericInfos
- new generic information which is merged to existing generic info of the submitted jobUnknownJobException
- if currentJobId
does not correspond to any submitted jobPermissionException
- if user cannot access job with currentJobId
NotConnectedException
JobCreationException
SubmissionClosedException
public JobId submit(Job job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
Scheduler
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
It is possible to get a listener on the scheduler. (see
Scheduler.addEventListener(SchedulerEventListener, boolean, SchedulerEvent...)
for more details)
submit
in interface Scheduler
submit
in class AbstractSmartProxy<RestJobTrackerImpl>
job
- the new job to submit.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.SubmissionClosedException
- if the submit action could not be performed.JobCreationException
- if Their was a problem while creation the jobpublic List<JobIdDataAndError> submit(List<Job> jobs) throws NotConnectedException
Scheduler
submit
in interface Scheduler
submit
in class AbstractSmartProxy<RestJobTrackerImpl>
jobs
- a list of jobs to submitNotConnectedException
public JobId submit(File job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a local FileNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(File job, Map<String,String> variables) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a local Filevariables
- job variables to use during the job executionNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(File job, Map<String,String> variables, Map<String,String> genericInfos) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a local Filevariables
- job variables to use during the job executiongenericInfos
- map with generic informationsNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(URL job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a urlNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(URL job, Map<String,String> variables) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a urlvariables
- job variables to use during the job executionNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(URL job, Map<String,String> variables, Map<String,String> headerParams) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a urlvariables
- job variables to use during the job executionheaderParams
- map with request header parametersNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(URL job, Map<String,String> variables, Map<String,String> genericInfos, Map<String,String> headerParams) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
job
- a job provided as a urlvariables
- job variables to use during the job executiongenericInfos
- map with generic informationsheaderParams
- map with request header parametersNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(Map<String,String> genericInfos, URL job, Map<String,String> variables) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submit
in interface ISchedulerClient
genericInfos
- map with generic informationsjob
- a job provided as a urlvariables
- job variables to use during the job executionNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String bucketName, String workflowName) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
NotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String bucketName, String workflowName, Map<String,String> variables) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
NotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String bucketName, String workflowName, Map<String,String> variables, Map<String,String> genericInfo) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
genericInfo
- map with generic informationNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String calledWorkflow) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
NotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String calledWorkflow, Map<String,String> variables) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
NotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submitFromCatalog(String catalogRestURL, String calledWorkflow, Map<String,String> variables, Map<String,String> genericInfo) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
ISchedulerClient
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
submitFromCatalog
in interface ISchedulerClient
genericInfo
- map with generic informationNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public List<JobIdDataAndError> multipleSubmitFromUrls(List<WorkflowUrlData> workflowUrlDataList) throws NotConnectedException, PermissionException
ISchedulerClient
multipleSubmitFromUrls
in interface ISchedulerClient
workflowUrlDataList
- list of objects containing workflow submission dataNotConnectedException
PermissionException
public JobState getJobState(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.getJobState
in interface Scheduler
getJobState
in class AbstractSmartProxy<RestJobTrackerImpl>
jobId
- the job on which to get the state.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public TaskResult getTaskResult(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
JobId.value()
method.getTaskResult
in interface Scheduler
getTaskResult
in class AbstractSmartProxy<RestJobTrackerImpl>
jobId
- the job in which the task result is.taskName
- the name of the task in which the result is.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.UnknownTaskException
- if this task does not exist in the job.PermissionException
- if you can't access this particular job.public boolean finishInErrorTask(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
finishInErrorTask
in interface Scheduler
NotConnectedException
UnknownJobException
UnknownTaskException
PermissionException
public boolean restartInErrorTask(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
restartInErrorTask
in interface Scheduler
NotConnectedException
UnknownJobException
UnknownTaskException
PermissionException
public boolean restartAllInErrorTasks(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.restartAllInErrorTasks
in interface Scheduler
jobId
- the job to resume.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public List<String> getGlobalSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getGlobalSpaceURIs
in interface Scheduler
getGlobalSpaceURIs
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
- if you are not authenticated.PermissionException
public List<String> getUserSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getUserSpaceURIs
in interface Scheduler
getUserSpaceURIs
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
- if you are not authenticated.PermissionException
public void addEventListener(SchedulerEventListenerExtended listener, boolean myEventsOnly, SchedulerEvent... events) throws NotConnectedException, PermissionException
addEventListener
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
public boolean uploadInputfiles(TaskFlowJob job, String localInputFolderPath) throws NotConnectedException, PermissionException
AbstractSmartProxy
uploadInputfiles
in class AbstractSmartProxy<RestJobTrackerImpl>
job
- job to push data forlocalInputFolderPath
- utFolderPath local input folderNotConnectedException
PermissionException
AbstractSmartProxy.uploadInputfiles(TaskFlowJob, String)
protected void downloadTaskOutputFiles(AwaitedJob awaitedjob, String jobId, String taskName, String localFolder) throws NotConnectedException, PermissionException
AbstractSmartProxy
downloadTaskOutputFiles
in class AbstractSmartProxy<RestJobTrackerImpl>
jobId
- job to pull data fortaskName
- name of the tasklocalFolder
- local output folder, if not null, it overrides the folder specified as output folder for the jobNotConnectedException
PermissionException
public void registerAsListener() throws NotConnectedException, PermissionException
registerAsListener
in class AbstractSmartProxy<RestJobTrackerImpl>
NotConnectedException
PermissionException
public void setSession(String sid)
ISchedulerClient
setSession
in interface ISchedulerClient
sid
- session identifierpublic String getSession()
ISchedulerClient
getSession
in interface ISchedulerClient
public boolean isJobFinished(JobId jobId) throws NotConnectedException, UnknownJobException, PermissionException
ISchedulerClient
isJobFinished
in interface ISchedulerClient
jobId
- the job identifier objectNotConnectedException
- if the client is not logged in or the session has expiredUnknownJobException
- if the job identifier is invalidPermissionException
- if the user does not have permission to view the state of the
specified jobpublic boolean isJobFinished(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
ISchedulerClient
isJobFinished
in interface ISchedulerClient
jobId
- the job identifier stringNotConnectedException
UnknownJobException
PermissionException
ISchedulerClient.isJobFinished(JobId)
public JobResult waitForJob(JobId jobId, long timeout) throws NotConnectedException, UnknownJobException, PermissionException, TimeoutException
ISchedulerClient
If the job execution finishes before the elapse of wait time, the result of the job is returned. Otherwise a timeout exception is thrown.
waitForJob
in interface ISchedulerClient
jobId
- the job identifier objecttimeout
- the maximum amount of time to waitNotConnectedException
- if the client is not logged in or the session has expiredUnknownJobException
- if the job identifier is invalidPermissionException
- if the user does not have permission to view the state of the
specified jobTimeoutException
- if the job execution does not finish before the elapse of
wait timepublic JobResult waitForJob(String jobId, long timeout) throws NotConnectedException, UnknownJobException, PermissionException, TimeoutException
ISchedulerClient
If the job execution finishes before the elapse of wait time, the result of the job is returned. Otherwise a timeout exception is thrown.
waitForJob
in interface ISchedulerClient
jobId
- the job identifier stringNotConnectedException
UnknownJobException
PermissionException
TimeoutException
ISchedulerClient.waitForJob(JobId, long)
public boolean isTaskFinished(String jobId, String taskName) throws UnknownJobException, NotConnectedException, PermissionException, UnknownTaskException
ISchedulerClient
isTaskFinished
in interface ISchedulerClient
jobId
- the string identifier of the job to which the task is belongtaskName
- the task nameUnknownJobException
- if the job identifier is invalidNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to view the state of the
taskUnknownTaskException
- if the task name is invalidpublic TaskResult waitForTask(String jobId, String taskName, long timeout) throws UnknownJobException, NotConnectedException, PermissionException, UnknownTaskException, TimeoutException
ISchedulerClient
If the task execution finishes before the elapse of wait time, the result of the task is returned. Otherwise a timeout exception is thrown.
waitForTask
in interface ISchedulerClient
jobId
- the string identifier of the job to which the task is belongtaskName
- the task nameUnknownJobException
- if the job identifier is invalidNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to view the state of
taskUnknownTaskException
- if the task name is invalidTimeoutException
- if the task execution does not finish before the elapse of
wait timepublic List<JobResult> waitForAllJobs(List<String> jobIds, long timeout) throws NotConnectedException, UnknownJobException, PermissionException, TimeoutException
ISchedulerClient
Returns a list of job results, if the execution of all jobs specified finishes before the elapse of the wait time. Otherwise a timeout exception is thrown.
waitForAllJobs
in interface ISchedulerClient
jobIds
- the list of job identifier stingstimeout
- the maximum amount of wait timeNotConnectedException
- if the client is not logged in or the session has expiredUnknownJobException
- if one of jobs specified is invalidPermissionException
- if the user does not have permission to view the state of one
of the specified jobsTimeoutException
- if the execution of all jobs specified does not finish before
the elapse of specified wait timepublic Map.Entry<String,JobResult> waitForAnyJob(List<String> jobIds, long timeout) throws NotConnectedException, UnknownJobException, PermissionException, TimeoutException
ISchedulerClient
Returns the string identifier and result of the finished job, if any of the execution of the jobs finishes before the elapse of wait time. Otherwise a timeout exception is thrown.
waitForAnyJob
in interface ISchedulerClient
jobIds
- the list of job identifier stringstimeout
- the maximum amount of wait timeNotConnectedException
- if the client is not logged in or the session has expiredUnknownJobException
- if only of the job identifiers is invalidPermissionException
- if the user does not have permission to view the job stateTimeoutException
- if none of the executions of jobs finishes before the elapse
of wait timepublic Map.Entry<String,TaskResult> waitForAnyTask(String jobId, List<String> taskNames, long timeout) throws UnknownJobException, NotConnectedException, PermissionException, UnknownTaskException, TimeoutException
ISchedulerClient
Returns name and the result of a finished task. Otherwise a timeout exception is thrown.
waitForAnyTask
in interface ISchedulerClient
jobId
- the job identifier of the job to which the specified tasks
belongtaskNames
- the names of the taskstimeout
- the maximum amount of wait timeUnknownJobException
- if the job identifier is invalidNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to view the state of the
tasksUnknownTaskException
- if the name of a task is invalidTimeoutException
- if none of the executions of tasks finish before the elapse
of wait timepublic List<Map.Entry<String,TaskResult>> waitForAllTasks(String jobId, List<String> taskNames, long timeout) throws UnknownJobException, NotConnectedException, PermissionException, UnknownTaskException, TimeoutException
ISchedulerClient
Returns a list of task name and task result pairs, if all the executions of specified tasks finishes before the elapse of wait time. Otherwise a timeout exception is thrown.
waitForAllTasks
in interface ISchedulerClient
jobId
- the identifier of the job to which all the specified tasks
belongtaskNames
- the task namestimeout
- the maximum amount of wait timeUnknownJobException
- if the job identifier is invalidNotConnectedException
- if the client is not logged in or the session has expired.PermissionException
- if the user does not have permission to view the state of the
tasksUnknownTaskException
- if a task name is invalidTimeoutException
- if all the executions of the tasks do not finish before the
elapse of maximum wait timepublic boolean pushFile(String spacename, String pathname, String filename, String file) throws NotConnectedException, PermissionException
ISchedulerClient
pushFile
in interface ISchedulerClient
spacename
- the dataspace namepathname
- the path of the stored file with respect to the dataspacefilename
- the name of the stored file with respect to the dataspacefile
- the local fileNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to upload the file to
the specified dataspacepublic void pullFile(String space, String pathname, String outputFile) throws NotConnectedException, PermissionException
ISchedulerClient
pullFile
in interface ISchedulerClient
space
- the dataspace namepathname
- the pathname of the file with respect the dataspaceoutputFile
- the name of the output fileNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to retrieve the
specified file from the serverpublic boolean deleteFile(String space, String pathname) throws NotConnectedException, PermissionException
ISchedulerClient
deleteFile
in interface ISchedulerClient
space
- the dataspace namepathname
- the pathname of the file with respect to the dataspaceNotConnectedException
- if the client is not logged in or the session has expiredPermissionException
- if the user does not have permission to delete the file from
the serverpublic Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, Set<TaskStatus> taskStatuses, int offset, int limit) throws SchedulerException
Scheduler
getTaskIds
in interface Scheduler
taskTag
- a complete tag to use to filter tasksfrom
- the starting date to fetch tasks from. The format is in Epoch
time.to
- the end date to stop fetching tasks. The format is in Epoch
time.mytasks
- True
will only fetch the user tasks,
False
will fetch everyones.taskStatuses
- Set of task statuses which is used as filteroffset
- the starting task to include in the paginated list.limit
- the last task (not included) before stopping fetching tasks in
the paginated list.SchedulerException
public Page<TaskState> getTaskStates(String taskTag, long from, long to, boolean mytasks, Set<TaskStatus> statusFilter, int offset, int limit, SortSpecifierContainer sortParams) throws SchedulerException
Scheduler
getTaskStates
in interface Scheduler
taskTag
- a complete tag to use to filter tasksfrom
- the starting date to fetch tasks from. The format is in Epoch
time.to
- the end date to stop fetching tasks. The format is in Epoch
time.mytasks
- True
will only fetch the user tasks,
False
will fetch everyones.offset
- the starting task to include in the paginated list.limit
- the last task (not included) before stopping fetching tasks in
the paginated list.SchedulerException
public JobInfo getJobInfo(String jobId) throws SchedulerException
Scheduler
getJobInfo
in interface Scheduler
jobId
- the id of the job we want to fetch info.JobInfo
associated to the given idSchedulerException
public boolean changeStartAt(JobId jobId, String startAt) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
changeStartAt
in interface Scheduler
jobId
- id of the job that needs to be updatedstartAt
- its value should be ISO 8601 compliantNotConnectedException
UnknownJobException
PermissionException
public boolean changeStartAt(List<JobId> jobIdList, String startAt) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
changeStartAt
in interface Scheduler
jobIdList
- id of the jobs that needs to be updatedstartAt
- its value should be ISO 8601 compliantNotConnectedException
UnknownJobException
PermissionException
public String getJobContent(JobId jobId) throws SchedulerException
getJobContent
in interface Scheduler
jobId
- job id of existing jobSchedulerException
public Map<Object,Object> getPortalConfiguration() throws SchedulerException
getPortalConfiguration
in interface Scheduler
PermissionException
NotConnectedException
SchedulerException
public String getCurrentUser() throws NotConnectedException
Scheduler
getCurrentUser
in interface Scheduler
NotConnectedException
public UserData getCurrentUserData() throws NotConnectedException
Scheduler
getCurrentUserData
in interface Scheduler
NotConnectedException
public Subject getSubject() throws NotConnectedException
Scheduler
getSubject
in interface Scheduler
NotConnectedException
public Map<String,Object> getSchedulerProperties() throws SchedulerException
Scheduler
getSchedulerProperties
in interface Scheduler
SchedulerException
public TaskStatesPage getTaskPaginated(String jobId, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
getTaskPaginated
in interface Scheduler
jobId
- the job on which to get the state.offset
- the starting index of the sublist of tasks to getlimit
- the last index (non inclusive) of the sublist of tasks to getNotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public TaskStatesPage getTaskPaginated(String jobId, String statusFilter, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException
getTaskPaginated
in interface Scheduler
NotConnectedException
UnknownJobException
PermissionException
public List<TaskResult> getPreciousTaskResults(String jobId) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
getPreciousTaskResults
in interface Scheduler
jobId
- id of the jobNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public Map<Long,Map<String,Serializable>> getJobResultMaps(List<String> jobsId) throws UnknownJobException, NotConnectedException, PermissionException
Scheduler
getJobResultMaps
in interface Scheduler
jobsId
- list of jobs idsUnknownJobException
- if one of the jobs in the list does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access one job in the list.public Map<Long,List<String>> getPreciousTaskNames(List<String> jobsId) throws SchedulerException
Scheduler
getPreciousTaskNames
in interface Scheduler
jobsId
- id of the jobSchedulerException
public void enableRemoteVisualization(String jobId, String taskName, String connectionString) throws NotConnectedException, PermissionException, UnknownJobException, UnknownTaskException
Scheduler
enableRemoteVisualization
in interface Scheduler
jobId
- id of the jobtaskName
- name of the task which enables visualizationconnectionString
- visualization connection stringNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job and task.UnknownJobException
- if the job does not exist.UnknownTaskException
- if this task does not exist in the job.public void registerService(String jobId, int serviceInstanceid, boolean enableActions) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
registerService
in interface Scheduler
jobId
- id of the jobserviceInstanceid
- id of the PSA service instance to registerenableActions
- if actions should be enabled on this service from the given jobNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public void detachService(String jobId, int serviceInstanceid) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
detachService
in interface Scheduler
jobId
- id of the jobserviceInstanceid
- id of the PSA service to detachNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public void notifyDisconnection()
notifyDisconnection
in interface DisconnectionAwareSchedulerEventListener
public boolean checkPermission(String method) throws SecurityException
ServiceUsingPermission
checkPermission
in interface ServiceUsingPermission
method
- method nameSecurityException
- if the user is not allowed to execute this methodpublic boolean checkJobPermissionMethod(String jobId, String method) throws SchedulerException
Scheduler
checkJobPermissionMethod
in interface Scheduler
jobId
- id of the jobmethod
- operation to testNotConnectedException
UnknownJobException
SchedulerException
public List<String> checkJobsPermissionMethod(List<String> jobIds, String method) throws SchedulerException
Scheduler
checkJobsPermissionMethod
in interface Scheduler
jobIds
- list of jobs idsmethod
- operation to testSchedulerException
public Set<String> addJobSignal(String jobId, String signal, Map<String,String> updatedVariables) throws UnknownJobException, NotConnectedException, PermissionException, SignalApiException, JobValidationException
Scheduler
addJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalUnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apiJobValidationException
public List<JobVariable> validateJobSignal(String jobId, String signal, Map<String,String> updatedVariables) throws UnknownJobException, NotConnectedException, PermissionException, SignalApiException, JobValidationException
Scheduler
validateJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalUnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apiJobValidationException
public void addExternalEndpointUrl(String jobId, String endpointName, String externalEndpointUrl, String endpointIconUri) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
addExternalEndpointUrl
in interface Scheduler
jobId
- id of the jobendpointName
- the name of the endpointexternalEndpointUrl
- the external endpoint url to add to the job endpoint listendpointIconUri
- uri of the icon associated with the endpoint. If this parameter is null, the workflow icon will be used.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist or is terminated.public void removeExternalEndpointUrl(String jobId, String endpointName) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
removeExternalEndpointUrl
in interface Scheduler
jobId
- id of the jobendpointName
- name of the external endpoint url to removeNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist or is terminated.public void updateLogo(byte[] image) throws NotConnectedException, PermissionException, ImageValidationException
Scheduler
updateLogo
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.ImageValidationException