public class SchedulerClient extends ClientBase implements ISchedulerClient
Modifier and Type | Field and Description |
---|---|
static String |
ASC_SUFFIX |
static String |
DESC_SUFFIX |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(SchedulerEventListener listener,
boolean myEventsOnly,
SchedulerEvent... events)
Add a scheduler event Listener.
|
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
|
void |
changeJobPriority(JobId jobId,
JobPriority priority)
Change the priority of the job represented by jobId.
Only administrator can change the priority to HIGH, HIGEST, IDLE. |
void |
changeJobPriority(String jobId,
JobPriority priority)
Change the priority of the job represented by jobId.
Only administrator can change the priority to HIGH, HIGEST, IDLE. The jobId is given as a string. |
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
|
Map<String,Map<String,Boolean>> |
checkJobsPermissionMethods(List<String> jobIds,
List<String> methods)
Returns a map containing pairs that represent the job id as key and a map as value containing the method name
and true/false if the user has permission for the jobId and method
|
boolean |
checkPermission(String method)
Checks if the current user is allowed to execute the provided method
|
static ISchedulerClient |
createInstance()
Creates an ISchedulerClient instance.
|
List<JobLabelInfo> |
createLabels(List<String> labels)
Creates new labels
|
boolean |
deleteFile(String space,
String pathname)
Deletes the specified file from the server.
|
void |
deleteLabel(String labelId)
Remove the given label
|
void |
detachService(String jobId,
int serviceInstanceid)
Detach a cloud automation service previously associated with the given job
|
void |
disconnect()
Disconnect properly the user from the scheduler.
|
void |
enableRemoteVisualization(String jobId,
String taskName,
String connectionString)
Enable Remote visualization for the given job and task
|
boolean |
finishInErrorTask(String jobId,
String taskName) |
boolean |
freeze()
For administrator only, Freeze the scheduler by terminating running
tasks.
|
List<JobUsage> |
getAccountUsage(String user,
Date start,
Date end)
Returns details on job and task execution times for a given user's executions.
|
CompletedJobsCount |
getCompletedJobs(Boolean myJobs,
String workflowName,
String bucketName,
long startDate,
long endDate,
int numberOfIntervals)
Retrieves an object containing a map of number of finished jobs with issues by time interval and a map of number of finished jobs without issues by time interval
|
CompletedTasksCount |
getCompletedTasks(Boolean myTasks,
String taskName,
long startDate,
long endDate,
int numberOfIntervals)
Retrieves an object containing a map of number of completed tasks with issues by time interval and a map of number of finished tasks without issues by time interval
|
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
|
FilteredStatistics |
getFilteredStatistics(String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves an object containing jobs count-by-state and statistics based on the given filters
|
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.
|
JobResult |
getJobResult(JobId jobId)
Get the result for the given jobId.
|
JobResult |
getJobResult(String jobId)
Get the result for the given jobId.
The jobId is given as a string. |
Map<Long,Map<String,Serializable>> |
getJobResultMaps(List<String> jobsId)
Return result maps associated with multiple jobs
|
Page<JobInfo> |
getJobs(int index,
int range,
JobFilterCriteria criteria,
List<SortParameter<JobSortParameter>> jobSortParameters)
Retrieves a job list of the scheduler.
|
String |
getJobServerLogs(String jobId)
Retrieves server logs for a job with the given id.
|
List<JobInfo> |
getJobsInfoList(List<String> jobsId)
Returns a list of jobs info corresponding to the given job IDs (in the same order)
|
JobState |
getJobState(JobId jobId)
Return the state of the given job.
The state contains information about the job, every tasks and informations about the tasks. A user can only get the state of HIS job. If the job does not exist, a schedulerException is sent with the proper message. |
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)
|
List<JobLabelInfo> |
getLabels()
Gets all labels.
|
List<JobUsage> |
getMyAccountUsage(Date startDate,
Date endDate)
Returns details on job and task execution times for the caller's executions.
|
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.
|
SchedulerStatus |
getStatus()
Get the current status of the Scheduler
|
Subject |
getSubject()
Returns the current user JaaS subject
|
Map<String,Integer> |
getSubmissionModeCount(String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves a map containing the number of jobs submitted from each portal
|
Set<String> |
getSubmissionModeValues()
Retrieves all the submissionMode values stored in the database
|
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(JobId jobId,
String taskName)
Get the result for the given task name in the given jobId.
|
TaskResult |
getTaskResult(String jobId,
String taskName)
Get the result for the given task name in the given jobId.
|
List<TaskResult> |
getTaskResultsByTag(JobId jobId,
String taskTag)
Get the results for a set of tasks in the given jobId and filtered by a
given tag.
|
List<TaskResult> |
getTaskResultsByTag(String jobId,
String taskTag)
Get the results for a set of tasks in the given jobId and filtered by a
given tag.
|
String |
getTaskServerLogs(String jobId,
String taskName)
Retrieves server logs for a task with the given id.
|
String |
getTaskServerLogsByTag(String jobId,
String tag)
Retrieves server logs for a set of tasks filtered by the given tag.
|
TaskState |
getTaskState(JobId jobId,
String taskName)
Return the state of the given task.
The state contains information about a single task. A standard user can only get the state of HIS jobs. If the job or the task does not exist, a schedulerException is sent with the proper message. |
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<WorkflowDuration> |
getTopExecutionTimeWorkflows(int numberOfWorkflows,
String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves an object containing the top workflows with the longest execution time based on the given filters
|
List<WorkflowDuration> |
getTopPendingTimeWorkflows(int numberOfWorkflows,
String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves an object containing the top workflows with the longest pending time based on the given filters
|
List<FilteredTopWorkflowsCumulatedCoreTime> |
getTopWorkflowsCumulatedCoreTime(int numberOfWorkflows,
String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves an object containing the top workflows that consumes the most CPU
|
List<FilteredTopWorkflowsNumberOfNodes> |
getTopWorkflowsNumberOfNodes(int numberOfWorkflows,
String workflowName,
String bucketName,
boolean myJobs,
long startDate,
long endDate,
boolean inParallel)
Retrieves an object containing the top workflows that use most nodes
|
List<FilteredTopWorkflow> |
getTopWorkflowsWithIssues(int numberOfWorkflows,
String workflowName,
String bucketName,
Boolean myJobs,
long startDate,
long endDate)
Retrieves an object containing the top workflows with issues based on the given filters
|
List<SchedulerUserInfo> |
getUsers()
Returns a list of connected users.
|
List<String> |
getUserSpaceURIs()
Returns the USER DataSpace URIs associated with the current user
|
List<SchedulerUserInfo> |
getUsersWithJobs()
Returns a list of users having jobs.
|
void |
init(ConnectionInfo connectionInfo)
Initialize this instance.
|
boolean |
isConnected()
Test whether or not the user is connected to the ProActive 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.
|
boolean |
kill()
For administrator only, Kill the scheduler.
Will stop the scheduling, and shutdown the scheduler. |
boolean |
killJob(JobId jobId)
Kill the job represented by jobId.
This method will kill every running tasks of this job, and remove it from the scheduler. The job won't be terminated, it won't have result. |
boolean |
killJob(String jobId)
Kill the job represented by jobId.
This method will kill every running tasks of this job, and remove it from the scheduler. The job won't be terminated, it won't have result. The jobId is given as a string. |
boolean |
killJobs(List<String> jobsId) |
boolean |
killTask(JobId jobId,
String taskName)
Try to kill the task with the given task name in the given jobId.
|
boolean |
killTask(String jobId,
String taskName)
Try to kill the task with the given task name in the given jobId.
|
boolean |
linkResourceManager(String rmUrl)
For administrator only, Reconnect a new Resource Manager to the
scheduler.
|
List<JobIdDataAndError> |
multipleSubmitFromUrls(List<WorkflowUrlData> workflowUrlDataList)
Submit a list of jobs to the scheduler from a list of catalogRestURL, variables and generic information.
|
boolean |
pause()
For administrator only, Pause the scheduler by terminating running jobs.
|
boolean |
pauseJob(JobId jobId)
Pause the job represented by jobId.
This method will finish every running tasks of this job, and then pause the job. The job will have to be resumed in order to finish. |
boolean |
pauseJob(String jobId)
Pause the job represented by jobId.
This method will finish every running tasks of this job, and then pause the job. The job will have to be resumed in order to finish. The jobId is given as a string. |
boolean |
preemptTask(JobId jobId,
String taskName,
int restartDelay)
Try to stop the task execution represented by the given task name in the
given jobId.
|
boolean |
preemptTask(String jobId,
String taskName,
int restartDelay)
Try to stop the task execution represented by the given task name in the
given jobId.
If the job does not exist, an UnknownJobException is sent with the proper message. So, if you have the right to stop this task and if the job and task name exist and is running, the task will be stopped and restarted later and this method will return true .The given delay is the delay between the task termination and it's eligibility to be re-scheduled. |
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 |
putThirdPartyCredential(String key,
String value)
Stores a third-party credential key-value pair in the database.
|
void |
registerService(String jobId,
int serviceInstanceid,
boolean enableActions)
Register a cloud automation service associated with the given job
|
void |
removeEventListener()
Remove the current event listener your listening on.
If no listener is defined, this method has no effect. |
void |
removeExternalEndpointUrl(String jobId,
String endpointName)
Remove an external endpoint url from a job.
|
boolean |
removeJob(JobId jobId)
Remove the job from the scheduler.
|
boolean |
removeJob(String jobId)
Remove the job from the scheduler.
|
void |
removeJobLabels(List<String> jobIds)
Removes label from jobs
|
boolean |
removeJobs(List<JobId> jobIds)
Remove jobs with given ids
|
boolean |
removeJobs(long olderThan)
Remove jobs older than the given epoch time (jobs which were finished earlier)
|
void |
removeThirdPartyCredential(String key) |
void |
renewSession()
This method renew the connection lease without other side effect.
|
void |
renewSessionInternal() |
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) |
boolean |
restartTask(JobId jobId,
String taskName,
int restartDelay)
Try to restart the task represented by the given task name in the given
jobId.
|
boolean |
restartTask(String jobId,
String taskName,
int restartDelay)
Try to restart the task represented by the given task name in the given
jobId.
|
JobId |
reSubmit(JobId currentJobId,
Map<String,String> jobVariables,
Map<String,String> jobGenericInfos,
String sessionId) |
boolean |
resume()
For administrator only, Resume the scheduler.
|
boolean |
resumeJob(JobId jobId)
Resume the job represented by jobId.
This method will restart every non-finished tasks of this job. |
boolean |
resumeJob(String jobId)
Resume the job represented by jobId.
This method will restart every non-finished tasks of this job. The jobId is given as a string. |
void |
setLabelOnJobs(String labelId,
List<String> jobIds)
Sets label on jobs
|
List<JobLabelInfo> |
setLabels(List<String> labels)
Sets the list of labels.
|
void |
setSession(String sid)
Sets the session identifier explicitly.
|
static Map<String,String> |
setSubmissionModeToGenericInfo(Map<String,String> genericInformation) |
boolean |
shutdown()
For administrator only, Terminate the scheduler after all currently running tasks are finished.
|
boolean |
start()
For administrator only, Start the scheduler.
|
boolean |
stop()
For administrator only, Stop the scheduler.
Once done, you won't be able to submit job, and the scheduling will be stopped. Every running jobs will be terminated. |
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> requestHeaderParams)
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> requestHeaderParams)
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.
|
Set<String> |
thirdPartyCredentialsKeySet() |
JobLabelInfo |
updateLabel(String labelId,
String newLabel)
Update the given label
|
void |
updateLogo(byte[] image)
Updates the logo on all portals
|
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, changePolicy, getState, getState, getTaskResultAllIncarnations, getTaskResultAllIncarnations, getTaskResultFromIncarnation, getTaskResultFromIncarnation, listenJobLogs, listenJobLogs, reloadPolicyConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, changePolicy, getState, getState, getTaskResultAllIncarnations, getTaskResultAllIncarnations, getTaskResultFromIncarnation, getTaskResultFromIncarnation, listenJobLogs, listenJobLogs, reloadPolicyConfiguration
public static final String ASC_SUFFIX
public static final String DESC_SUFFIX
public static ISchedulerClient createInstance()
public void init(ConnectionInfo connectionInfo) throws Exception
ISchedulerClient
init
in interface ISchedulerClient
connectionInfo
- various info about the connection attemptException
- if an error occurs during the initializationpublic ConnectionInfo getConnectionInfo()
ISchedulerClient
getConnectionInfo
in interface ISchedulerClient
public List<JobUsage> getAccountUsage(String user, Date start, Date end) throws NotConnectedException, PermissionException
SchedulerUsage
Only the jobs finished between the start date and the end date will be returned:
i.e startDate <= job.finishedTime <= endDate
.
If user is the same as the caller, then it will fallback to to SchedulerUsage.getMyAccountUsage(Date, Date)
.
getAccountUsage
in interface SchedulerUsage
user
- must match a username as defined in the Scheduler's usersstart
- must not be null, inclusiveend
- must not be null, inclusiveJobUsage
objects where job finished times are between start date and end dateNotConnectedException
- if the caller is not connectedPermissionException
- if the caller hasn't the permission to call this methodpublic List<JobUsage> getMyAccountUsage(Date startDate, Date endDate) throws NotConnectedException, PermissionException
SchedulerUsage
Only the jobs finished between the start date and the end date will be returned:
i.e startDate <= job.finishedTime <= endDate
.
getMyAccountUsage
in interface SchedulerUsage
startDate
- must not be null, inclusiveendDate
- must not be null, inclusiveJobUsage
objects where job finished times are between start date and end dateNotConnectedException
- if the caller is not connectedPermissionException
- if the caller hasn't the permission to call this methodpublic void changeJobPriority(JobId jobId, JobPriority priority) throws NotConnectedException, UnknownJobException, PermissionException, JobAlreadyFinishedException
Scheduler
changeJobPriority
in interface Scheduler
jobId
- the job on which to change the priority.priority
- The new priority to apply to the job.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.JobAlreadyFinishedException
- if you want to change the priority on a finished job.public void changeJobPriority(String jobId, JobPriority priority) throws NotConnectedException, UnknownJobException, PermissionException, JobAlreadyFinishedException
Scheduler
JobId.value()
method.changeJobPriority
in interface Scheduler
jobId
- the job on which to change the priority.priority
- The new priority to apply to the job.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.JobAlreadyFinishedException
- if you want to change the priority on a finished job.public void disconnect() throws NotConnectedException, PermissionException
Scheduler
disconnect
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public boolean freeze() throws NotConnectedException, PermissionException
Scheduler
freeze
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public JobResult getJobResult(JobId jobId) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
getJobResult
in interface Scheduler
jobId
- the job on which the result will be sendNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public JobResult getJobResult(String jobId) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
JobId.value()
method.getJobResult
in interface Scheduler
jobId
- the job on which the result will be sendNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public JobState getJobState(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.getJobState
in interface Scheduler
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 JobState getJobState(JobId jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
getJobState
in interface Scheduler
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 TaskState getTaskState(JobId jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
getTaskState
in interface Scheduler
jobId
- the job on which to get the state.taskName
- the name of the task.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.UnknownTaskException
public Page<JobInfo> getJobs(int index, int range, JobFilterCriteria criteria, List<SortParameter<JobSortParameter>> jobSortParameters) throws NotConnectedException, PermissionException
Scheduler
getJobs
in interface Scheduler
index
- says to start from this job isrange
- max number of jobs to retrievecriteria
- defines types of job (myonly, pending, running, finished).
Important! If user tries to get all jobs (myonly is false) but
does not have permissions to do it (namely
HandleOnlyMyJobsPermission(true)) user will get his own jobs
instead of a PermissionException. This behavior should
simplify the client design.jobSortParameters
- defines in how jobs must be sortedNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<JobInfo> getJobsInfoList(List<String> jobsId) throws PermissionException, NotConnectedException
Scheduler
getJobsInfoList
in interface Scheduler
jobsId
- the list of id of the jobs to return, in the same orderPermissionException
- if you have not enough permission to access this method.NotConnectedException
- if you are not authenticated.public String getJobServerLogs(String jobId) throws UnknownJobException, NotConnectedException, PermissionException
Scheduler
getJobServerLogs
in interface Scheduler
jobId
- of the job for which logs are requestedUnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public SchedulerStatus getStatus() throws NotConnectedException, PermissionException
Scheduler
getStatus
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public TaskResult getTaskResult(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
JobId.value()
method.getTaskResult
in interface Scheduler
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 TaskResult getTaskResult(JobId jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
getTaskResult
in interface Scheduler
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 List<TaskResult> getTaskResultsByTag(JobId jobId, String taskTag) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
getTaskResultsByTag
in interface Scheduler
jobId
- the job in which the task result is.taskTag
- the tag used to filter the tasks in which the result is.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public List<TaskResult> getTaskResultsByTag(String jobId, String taskTag) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.getTaskResultsByTag
in interface Scheduler
jobId
- the job in which the task result is.taskTag
- the tag used to filter the tasks in which the result is.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public String getTaskServerLogs(String jobId, String taskName) throws UnknownJobException, UnknownTaskException, NotConnectedException, PermissionException
Scheduler
getTaskServerLogs
in interface Scheduler
jobId
- of the job where the task is.taskName
- the name of the task.UnknownJobException
- if the job does not exist.UnknownTaskException
- if this task does not exist in the job.NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public String getTaskServerLogsByTag(String jobId, String tag) throws UnknownJobException, NotConnectedException, PermissionException
Scheduler
getTaskServerLogsByTag
in interface Scheduler
jobId
- of the job where the task is.tag
- the tag used to filter tasks.UnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<SchedulerUserInfo> getUsers() throws NotConnectedException, PermissionException
Scheduler
getUsers
in interface Scheduler
NotConnectedException
PermissionException
public List<SchedulerUserInfo> getUsersWithJobs() throws NotConnectedException, PermissionException
Scheduler
SchedulerUsage
getUsersWithJobs
in interface Scheduler
NotConnectedException
PermissionException
public FilteredStatistics getFilteredStatistics(String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getFilteredStatistics
in interface Scheduler
workflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<FilteredTopWorkflow> getTopWorkflowsWithIssues(int numberOfWorkflows, String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getTopWorkflowsWithIssues
in interface Scheduler
numberOfWorkflows
- number of workflows to showworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<FilteredTopWorkflowsCumulatedCoreTime> getTopWorkflowsCumulatedCoreTime(int numberOfWorkflows, String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getTopWorkflowsCumulatedCoreTime
in interface Scheduler
numberOfWorkflows
- number of workflows to showworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<FilteredTopWorkflowsNumberOfNodes> getTopWorkflowsNumberOfNodes(int numberOfWorkflows, String workflowName, String bucketName, boolean myJobs, long startDate, long endDate, boolean inParallel) throws NotConnectedException, PermissionException
Scheduler
getTopWorkflowsNumberOfNodes
in interface Scheduler
numberOfWorkflows
- number of workflows to showworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsinParallel
- if true, returns the maximum number of nodes used in parallel instead of the total number of nodesNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<WorkflowDuration> getTopExecutionTimeWorkflows(int numberOfWorkflows, String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getTopExecutionTimeWorkflows
in interface Scheduler
numberOfWorkflows
- number of workflows to showworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<WorkflowDuration> getTopPendingTimeWorkflows(int numberOfWorkflows, String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getTopPendingTimeWorkflows
in interface Scheduler
numberOfWorkflows
- number of workflows to showworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the filtered jobsendDate
- end date of the filtered jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public Map<String,Integer> getSubmissionModeCount(String workflowName, String bucketName, Boolean myJobs, long startDate, long endDate) throws NotConnectedException, PermissionException
Scheduler
getSubmissionModeCount
in interface Scheduler
workflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)myJobs
- fetch only the jobs owned by the user making the requeststartDate
- start date of the jobsendDate
- end date of the jobsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public CompletedJobsCount getCompletedJobs(Boolean myJobs, String workflowName, String bucketName, long startDate, long endDate, int numberOfIntervals) throws NotConnectedException, PermissionException
Scheduler
getCompletedJobs
in interface Scheduler
myJobs
- fetch only the jobs owned by the user making the requestworkflowName
- filter job by workflow name (or part of its name)bucketName
- filter job by bucket name (or part of its name)startDate
- start date of the filtered jobsendDate
- end date of the filtered jobs, default value represents the current datenumberOfIntervals
- number of time intervalsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public CompletedTasksCount getCompletedTasks(Boolean myTasks, String taskName, long startDate, long endDate, int numberOfIntervals) throws NotConnectedException, PermissionException
Scheduler
getCompletedTasks
in interface Scheduler
myTasks
- fetch only the tasks owned by the user making the requesttaskName
- the task name of the filtered tasksstartDate
- start date of the filtered tasksendDate
- end date of the filtered tasks, default value represents the current datenumberOfIntervals
- number of time intervalsNotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public Set<String> getSubmissionModeValues() throws NotConnectedException, PermissionException
Scheduler
getSubmissionModeValues
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean isConnected()
Scheduler
isConnected
in interface Scheduler
public String getCurrentPolicy() throws NotConnectedException, PermissionException
Scheduler
getCurrentPolicy
in interface Scheduler
NotConnectedException
PermissionException
public Map getJobsToSchedule() throws NotConnectedException, PermissionException
Scheduler
getJobsToSchedule
in interface Scheduler
NotConnectedException
PermissionException
public List<TaskDescriptor> getTasksToSchedule() throws NotConnectedException, PermissionException
Scheduler
getTasksToSchedule
in interface Scheduler
getTasksToSchedule
in class ClientBase
NotConnectedException
PermissionException
public boolean kill() throws NotConnectedException, PermissionException
Scheduler
kill
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean killJob(JobId jobId) throws NotConnectedException, PermissionException
Scheduler
killJob
in interface Scheduler
jobId
- the job to kill.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.public boolean killJob(String jobId) throws NotConnectedException, PermissionException
Scheduler
JobId.value()
method.killJob
in interface Scheduler
jobId
- the job to kill.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.public boolean killJobs(List<String> jobsId) throws NotConnectedException, PermissionException
killJobs
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access to at least one particular jobpublic boolean killTask(JobId jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
If the job does not exist, an UnknownJobException is sent with the proper message.
So, if you have the right to kill this task and if the job and task name
exist and is running, the task will be killed and this method will return
true
. In any other cases a SchedulerException
will
be thrown.
killTask
in interface Scheduler
jobId
- the job containing the task to be killed.taskName
- the name of the task to kill.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 and task.public boolean killTask(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
true
.SchedulerException
will be thrown.killTask
in interface Scheduler
jobId
- the job containing the task to be killed.taskName
- the name of the task to kill.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 and task.public boolean linkResourceManager(String rmUrl) throws NotConnectedException, PermissionException
Scheduler
Can be used if the resource manager has crashed.
linkResourceManager
in interface Scheduler
rmUrl
- the URL of the new Resource Manager to link to the scheduler.
Example: //host/RM_node_name
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean pause() throws NotConnectedException, PermissionException
Scheduler
pause
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean pauseJob(JobId jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
pauseJob
in interface Scheduler
jobId
- the job to pause.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public boolean pauseJob(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.pauseJob
in interface Scheduler
jobId
- the job to pause.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.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 boolean preemptTask(JobId jobId, String taskName, int restartDelay) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
If the job does not exist, an UnknownJobException is sent with the proper message.
So, if you have the right to stop this task and if the job and task name
exist and is running, the task will be stopped and restarted later and
this method will return true
.
The given delay is the delay between the task termination and it's
eligibility to be re-scheduled. In any other cases a
SchedulerException
will be thrown.
preemptTask
in interface Scheduler
jobId
- the job containing the task to be stopped.taskName
- the name of the task to stop.restartDelay
- the delay between the task termination and it's eligibility to
be re-scheduled (in sec)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 and task.public boolean preemptTask(String jobId, String taskName, int restartDelay) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
true
.SchedulerException
will be thrown.preemptTask
in interface Scheduler
jobId
- the job containing the task to be stopped.taskName
- the name of the task to stop.restartDelay
- the delay between the task termination and it's eligibility to
be re-scheduled (in sec)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 and task.public boolean removeJob(JobId jobId) throws NotConnectedException, PermissionException
Scheduler
removeJob
in interface Scheduler
jobId
- the job to be removed.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.public boolean removeJobs(List<JobId> jobIds) throws NotConnectedException, PermissionException
Scheduler
removeJobs
in interface Scheduler
NotConnectedException
- if you are not authenticatedPermissionException
- if you can't access to at least one of the jobpublic boolean removeJobs(long olderThan) throws NotConnectedException, PermissionException
Scheduler
removeJobs
in interface Scheduler
olderThan
- epoch time to considerNotConnectedException
- if you are not authenticatedPermissionException
- if you can't access to at least one of the jobpublic boolean removeJob(String jobId) throws NotConnectedException, PermissionException
Scheduler
The jobId is given as a string. It's in fact the string returned by the
JobId.value()
method.
A user can only remove HIS job.
If the job does not exist, a schedulerException is sent with the proper
message.
removeJob
in interface Scheduler
jobId
- the job to be removed.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.public boolean restartTask(JobId jobId, String taskName, int restartDelay) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
If the job does not exist, an UnknownJobException is sent with the proper
message. So, if you have the right to restart this task and if the job
and task name exist and is running, the task will be restarted and this
method will return true
.
The given delay is the delay between the task termination and it's
eligibility to be re-scheduled. In any other cases a
SchedulerException
will be thrown.
After this call, the following situations can occur :
restartTask
in interface Scheduler
jobId
- the job containing the task to be restarted.taskName
- the name of the task to restart.restartDelay
- the delay between the task termination and it's eligibility to
be re-scheduled (in sec)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 and task.public boolean restartTask(String jobId, String taskName, int restartDelay) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
true
.SchedulerException
will be thrown.
After this call, the following situations can occur :
restartTask
in interface Scheduler
jobId
- the job containing the task to be restarted.taskName
- the name of the task to restart.restartDelay
- the delay between the task termination and it's eligibility to
be re-scheduled (in sec)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 and task.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 resume() throws NotConnectedException, PermissionException
Scheduler
resume
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean resumeJob(JobId jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
resumeJob
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 boolean resumeJob(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.resumeJob
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 boolean shutdown() throws NotConnectedException, PermissionException
Scheduler
shutdown
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean start() throws NotConnectedException, PermissionException
Scheduler
start
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public boolean stop() throws NotConnectedException, PermissionException
Scheduler
stop
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.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
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
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 reSubmit(JobId currentJobId, Map<String,String> jobVariables, Map<String,String> jobGenericInfos, String sessionId) throws NotConnectedException
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 jobNotConnectedException
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(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 submit(URL job, Map<String,String> variables, Map<String,String> requestHeaderParams) 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 executionrequestHeaderParams
- map with request header parametersNotConnectedException
PermissionException
SubmissionClosedException
JobCreationException
public JobId submit(URL job, Map<String,String> variables, Map<String,String> genericInfos, Map<String,String> requestHeaderParams) 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 informationsrequestHeaderParams
- map with request header parametersNotConnectedException
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 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 List<String> getUserSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getUserSpaceURIs
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
public List<String> getGlobalSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getGlobalSpaceURIs
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
public void renewSessionInternal() throws SchedulerException, LoginException, KeyException
public void renewSession() throws NotConnectedException
Scheduler
renewSession
in interface Scheduler
NotConnectedException
- if you are not authenticated.public void setSession(String sid)
ISchedulerClient
setSession
in interface ISchedulerClient
sid
- session identifierpublic String getSession()
ISchedulerClient
getSession
in interface ISchedulerClient
public void addEventListener(SchedulerEventListener listener, boolean myEventsOnly, SchedulerEvent... events) throws NotConnectedException, PermissionException
Scheduler
This method behaves exactly the same as a call to addEventListener(sel, myEventsOnly, false, events); but return nothing
addEventListener
in interface Scheduler
listener
- a SchedulerEventListener on which the scheduler will talk.myEventsOnly
- a boolean that indicates if you want to receive every event or
just the one concerning your jobs. This won't affect the
scheduler state event that will be sent anyway.events
- An array of events that you want to receive from the
scheduler.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.public void removeEventListener() throws NotConnectedException, PermissionException
Scheduler
removeEventListener
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public void putThirdPartyCredential(String key, String value) throws SchedulerException
ThirdPartyCredentials
putThirdPartyCredential
in interface ThirdPartyCredentials
key
- the third-party credential key to storevalue
- the third-party credential value to store, it will be encryptedNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.SchedulerException
public Set<String> thirdPartyCredentialsKeySet() throws SchedulerException
thirdPartyCredentialsKeySet
in interface ThirdPartyCredentials
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.SchedulerException
public void removeThirdPartyCredential(String key) throws SchedulerException
removeThirdPartyCredential
in interface ThirdPartyCredentials
key
- the third-party credential key to removeNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.SchedulerException
public 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 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 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 NotConnectedException, UnknownJobException, PermissionException
Scheduler
getJobResultMaps
in interface Scheduler
jobsId
- list of jobs idsNotConnectedException
- if you are not authenticated.UnknownJobException
- if one of the jobs in the list does not exist.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 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 NotConnectedException, UnknownJobException, PermissionException, SignalApiException
Scheduler
addJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalNotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apipublic List<JobVariable> validateJobSignal(String jobId, String signal, Map<String,String> updatedVariables) throws NotConnectedException, UnknownJobException, PermissionException, SignalApiException
Scheduler
validateJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalNotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apipublic static Map<String,String> setSubmissionModeToGenericInfo(Map<String,String> genericInformation)
public Map<String,Map<String,Boolean>> checkJobsPermissionMethods(List<String> jobIds, List<String> methods) throws UnknownJobException, NotConnectedException
Scheduler
checkJobsPermissionMethods
in interface Scheduler
jobIds
- a list of job idsmethods
- a list of methodsUnknownJobException
- if the job does not exist.NotConnectedException
- if the user is not authenticated.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 List<JobLabelInfo> getLabels() throws PermissionException, NotConnectedException
Scheduler
getLabels
in interface Scheduler
PermissionException
- if you have not enough permission to access this method.NotConnectedException
- if you are not authenticated.public List<JobLabelInfo> createLabels(List<String> labels) throws NotConnectedException, PermissionException
Scheduler
createLabels
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public List<JobLabelInfo> setLabels(List<String> labels) throws NotConnectedException, PermissionException
Scheduler
setLabels
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public JobLabelInfo updateLabel(String labelId, String newLabel) throws NotConnectedException, PermissionException
Scheduler
updateLabel
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public void deleteLabel(String labelId) throws NotConnectedException, PermissionException
Scheduler
deleteLabel
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public void setLabelOnJobs(String labelId, List<String> jobIds) throws NotConnectedException, PermissionException
Scheduler
setLabelOnJobs
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public void removeJobLabels(List<String> jobIds) throws NotConnectedException, PermissionException
Scheduler
removeJobLabels
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public void updateLogo(byte[] image) throws NotConnectedException, PermissionException
Scheduler
updateLogo
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.