public abstract class ClientBase extends Object implements ISchedulerClient
Constructor and Description |
---|
ClientBase() |
Modifier and Type | Method and Description |
---|---|
SchedulerState |
addEventListener(SchedulerEventListener arg0,
boolean arg1,
boolean arg2,
SchedulerEvent... arg3)
Add a scheduler event Listener.
|
boolean |
changePolicy(String arg0)
For administrator only, change the policy of the scheduler.
|
SchedulerState |
getState()
Get the list of job states that describe every jobs in the Scheduler.
|
SchedulerState |
getState(boolean arg0)
Get the list of job states that describe every jobs in the Scheduler.
|
List<TaskResult> |
getTaskResultAllIncarnations(JobId arg0,
String arg1)
Get the result for the given task name and all result incarnations in the
given jobId.
|
List<TaskResult> |
getTaskResultAllIncarnations(String arg0,
String arg1)
Get the result for the given task name and all result incarnations in the
given jobId.
|
TaskResult |
getTaskResultFromIncarnation(JobId arg0,
String arg1,
int arg2)
Get the result for the given task name and the given incarnation in the
given jobId.
|
TaskResult |
getTaskResultFromIncarnation(String arg0,
String arg1,
int arg2)
Get the result for the given task name and the given incarnation in the
given jobId.
|
List<TaskDescriptor> |
getTasksToSchedule()
Returns a task descriptor list with eligible tasks (ready for execution)
|
void |
listenJobLogs(JobId arg0,
AppenderProvider arg1)
Listen for the tasks user logs.
|
void |
listenJobLogs(String arg0,
AppenderProvider arg1)
Listen for the tasks user logs.
The jobId is given as a string. |
boolean |
reloadPolicyConfiguration()
For administrator only, order a reload to the policy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteFile, getConnectionInfo, getSession, init, isJobFinished, isJobFinished, isTaskFinished, multipleSubmitFromUrls, pullFile, pushFile, setSession, submit, submit, submit, submit, submit, submit, submit, submit, submitFromCatalog, submitFromCatalog, submitFromCatalog, submitFromCatalog, submitFromCatalog, submitFromCatalog, waitForAllJobs, waitForAllTasks, waitForAnyJob, waitForAnyTask, waitForJob, waitForJob, waitForTask
addEventListener, addExternalEndpointUrl, addJobSignal, changeJobPriority, changeJobPriority, changeStartAt, changeStartAt, checkJobPermissionMethod, checkJobsPermissionMethod, checkJobsPermissionMethods, createLabels, deleteLabel, detachService, disconnect, enableRemoteVisualization, finishInErrorTask, freeze, getCompletedJobs, getCompletedTasks, getCurrentPolicy, getCurrentUser, getCurrentUserData, getFilteredStatistics, getGlobalSpaceURIs, getJobContent, getJobInfo, getJobResult, getJobResult, getJobResultMaps, getJobs, getJobServerLogs, getJobsInfoList, getJobState, getJobState, getJobsToSchedule, getLabels, getPortalConfiguration, getPreciousTaskNames, getPreciousTaskResults, getSchedulerProperties, getStatus, getSubject, getSubmissionModeCount, getSubmissionModeValues, getTaskIds, getTaskPaginated, getTaskPaginated, getTaskResult, getTaskResult, getTaskResultsByTag, getTaskResultsByTag, getTaskServerLogs, getTaskServerLogsByTag, getTaskState, getTaskStates, getTopExecutionTimeWorkflows, getTopPendingTimeWorkflows, getTopWorkflowsCumulatedCoreTime, getTopWorkflowsNumberOfNodes, getTopWorkflowsWithIssues, getUsers, getUserSpaceURIs, getUsersWithJobs, isConnected, kill, killJob, killJob, killJobs, killTask, killTask, linkResourceManager, pause, pauseJob, pauseJob, preemptTask, preemptTask, registerService, removeEventListener, removeExternalEndpointUrl, removeJob, removeJob, removeJobLabels, removeJobs, removeJobs, renewSession, restartAllInErrorTasks, restartInErrorTask, restartTask, restartTask, reSubmit, resume, resumeJob, resumeJob, setLabelOnJobs, setLabels, shutdown, start, stop, submit, submit, updateLabel, validateJobSignal
getAccountUsage, getMyAccountUsage
putThirdPartyCredential, removeThirdPartyCredential, thirdPartyCredentialsKeySet
checkPermission
public SchedulerState addEventListener(SchedulerEventListener arg0, boolean arg1, boolean arg2, SchedulerEvent... arg3) throws NotConnectedException, PermissionException
Scheduler
You may use this method once by remote or active object.
Every call to this method will remove your previous listening settings.
If you want to get 2 type of events, add the 2 events type you want at
the end of this method. If no type is specified, all of them will be
sent.
If you want to received the events concerning your job only, just set the 'myEventsOnly' parameter to true. otherwise, you will received events coming from any user.
addEventListener
in interface Scheduler
arg0
- a SchedulerEventListener on which the scheduler will talk.arg1
- a boolean that indicates if you want to receive every events
or just those concerning your jobs. This won't affect the
scheduler state event that will be sent anyway.arg2
- if false, this method returns null, if true, it returns the
Scheduler current state.arg3
- 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 List<TaskDescriptor> getTasksToSchedule() throws NotConnectedException, PermissionException
Scheduler
getTasksToSchedule
in interface Scheduler
NotConnectedException
PermissionException
public boolean changePolicy(String arg0) throws NotConnectedException, PermissionException
Scheduler
This method will immediately change the policy and so the whole scheduling process.
changePolicy
in interface Scheduler
arg0
- the new policy full class name.NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.public SchedulerState getState() throws NotConnectedException, PermissionException
Scheduler
If a PermissionException is thrown, try using Scheduler.getState(boolean)
method with argument true
.
NOTE: the total list of finished jobs is limited by the Java property 'scheduler.state.max.finished.jobs'
configured on the server. Default is 1000 finished jobs.
getState
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public SchedulerState getState(boolean arg0) throws NotConnectedException, PermissionException
Scheduler
getState
in interface Scheduler
arg0
- true to get only my jobs, false to get any.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public TaskResult getTaskResultFromIncarnation(JobId arg0, String arg1, int arg2) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
A user can only get HIS result back.
The incarnation argument represents the task result to get. If the task has failed 3 times and then has worked, then 0 represents the last result, 1 the previous, ..., and 3 represents the result of the first execution.
If the job does not exist, a schedulerException is sent with the proper message.
So, if you have the right to get the task result that is in the job represented by the given jobId and if the job and task name exist, so you will receive the result. In any other cases a schedulerException will be thrown.
getTaskResultFromIncarnation
in interface Scheduler
arg0
- the job in which the task result is.arg1
- the name of the task in which the result is.arg2
- id of incarnation (0 is the last one, 1 the previous, and so
on...)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> getTaskResultAllIncarnations(JobId arg0, String arg1) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
This method returns a list of task result attempts. If the task has failed 3 times and then has worked, then the list will contain a list of 4 task results. 0 represents the first failed result attempt, 1 the next one, ..., and 3 represents the result of the last execution. In that sense the id order is reversed comparing to individual calls to getTaskResultFromIncarnation
getTaskResultAllIncarnations
in interface Scheduler
arg0
- the job in which the task result is.arg1
- 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> getTaskResultAllIncarnations(String arg0, String arg1) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
This method returns a list of task result attempts. If the task has failed 3 times and then has worked, then the list will contain a list of 4 task results. 0 represents the first failed result attempt, 1 the next one, ..., and 3 represents the result of the last execution. In that sense the id order is reversed comparing to individual calls to
getTaskResultAllIncarnations
in interface Scheduler
arg0
- the job in which the task result is.arg1
- 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 getTaskResultFromIncarnation(String arg0, String arg1, int arg2) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
JobId.value()
method. A user can only get HIS
result back. The incarnation argument represents the task result to get.
If the task has failed 3 times and then has worked, then 0 represents the
last result, 1 the previous, ..., and 3 represents the result of the
first execution.
If the job does not exist, a schedulerException is sent with the proper message. So, if you have the right to get the task result that is in the job represented by the given jobId and if the job and task name exist, so you will receive the result. In any other cases a schedulerException will be thrown.
getTaskResultFromIncarnation
in interface Scheduler
arg0
- the job in which the task result is.arg1
- the name of the task in which the result is.arg2
- id of incarnation (0 is the last one, 1 the previous, and so
on...)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 void listenJobLogs(JobId arg0, AppenderProvider arg1) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
A user can only listen to HIS jobs.
listenJobLogs
in interface Scheduler
arg0
- the id of the job to listen to.arg1
- a provider for an appender that must be connected on a log
server on the caller side (see LogForwardingService
)NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public void listenJobLogs(String arg0, AppenderProvider arg1) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.listenJobLogs
in interface Scheduler
arg0
- the id of the job to listen to.arg1
- a provider for an appender that must be connected on a log
server on the caller side (see LogForwardingService
)NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public boolean reloadPolicyConfiguration() throws NotConnectedException, PermissionException
Scheduler
The default behavior reload the configuration file and update the
properties available in policy.
This will cause the Policy#reloadConfig()
method to be called.
This last method can be overridden in the policy to perform a custom
behavior on reload.
reloadPolicyConfiguration
in interface Scheduler
NotConnectedException
- if you are not authenticated.PermissionException
- if you have not enough permission to access this method.