public class SmartProxyImpl extends AbstractSmartProxy<JobTrackerImpl> implements org.objectweb.proactive.InitActive, org.objectweb.proactive.EndActive, Serializable
This implementation assumes that:
In order to use this object, a reference to it should be obtained via the
getActiveInstance()
method. One of the init methods should be called
afterwards.
The client could add a Listener to this object in order to receive
notifications from the Scheduler. The listener is of type
SchedulerEventListenerExtended
which, in addition to the
notifications declared by its super type
SchedulerEventListener
, can be
notified with events related to data transfer.
Remember this is an active object. The listener object needs to be an active or remote object (in order to avoid passing the listener through deep copy). You could use, for instance:
SchedulerEventListenerExtended myListenerRemoteReference = PARemoteObject.turnRemote( new MyEventListener());
schedProxy.addEventListener(myListenerRemoteReference);
When a listener is added by the client, no new connection will be established with the scheduler. This Proxy object broadcasts events received from the Scheduler to its own listeners. In addition, it adds events related to data transfer.
When a new job is submitted, these operations will be performed:
Modifier and Type | Field and Description |
---|---|
protected Scheduler |
schedulerProxy |
configuredEvents, connectionInfo, eventListeners, GENERIC_INFO_INPUT_FOLDER_PROPERTY_NAME, GENERIC_INFO_OUTPUT_FOLDER_PROPERTY_NAME, GENERIC_INFO_PULL_URL_PROPERTY_NAME, GENERIC_INFO_PUSH_URL_PROPERTY_NAME, jobTracker, MAX_NB_OF_DATA_TRANSFER_THREADS, PROXY_SCHED_EVENTS, terminated, terminating, threadPool
Constructor and Description |
---|
SmartProxyImpl()
Deprecated.
Use
getActiveInstance() or getInstance() |
Modifier and Type | Method and Description |
---|---|
protected Scheduler |
_getScheduler()
Returns a proxy instance to the Scheduler.
|
void |
addEventListener(SchedulerEventListenerExtended listener,
boolean myEventsOnly,
SchedulerEvent[] events) |
void |
addExternalEndpointUrl(String jobId,
String endpointName,
String externalEndpointUrl,
String endpointIconUri)
Add an external endpoint url to a job.
|
Set<String> |
addJobSignal(String jobId,
String signal,
Map<String,String> updatedVariables)
Add the given signal to job signals
|
boolean |
changeStartAt(JobId jobId,
String startAt)
Change the START_AT generic information at job level and reset the
scheduledAt at task level
|
boolean |
changeStartAt(List<JobId> jobIdList,
String startAt)
Change the START_AT generic information for multiple jobs at job level and reset the
scheduledAt at task level
|
boolean |
checkJobPermissionMethod(String jobId,
String method)
Check if the connected user has the permission to execute the method passed as argument
|
List<String> |
checkJobsPermissionMethod(List<String> jobIds,
String method)
Check if the connected user has the permission to execute the method passed as argument
|
boolean |
checkPermission(String method)
Checks if the current user is allowed to execute the provided method
|
protected void |
createFolder(String fUri) |
void |
detachService(String jobId,
int serviceInstanceid)
Detach a cloud automation service previously associated with the given job
|
void |
disconnect()
Disconnect from the scheduler
|
protected void |
downloadTaskOutputFiles(AwaitedJob awaitedjob,
String jobId,
String t_name,
String localFolder)
Pull the output files of the given task from the pull_url either to the localFolder defined for the job or to the localFolder specified as argument, if it is not null.
|
void |
enableRemoteVisualization(String jobId,
String taskName,
String connectionString)
Enable Remote visualization for the given job and task
|
void |
endActivity(org.objectweb.proactive.Body body) |
boolean |
finishInErrorTask(String jobId,
String taskName) |
static SmartProxyImpl |
getActiveInstance()
Returns a stub to the only active instance of the proxy (proactive
singleton pattern)
|
String |
getCurrentPolicy()
Return the name of the current Policy
|
String |
getCurrentUser()
Returns the user currently connected
|
UserData |
getCurrentUserData()
Returns the user data object associated with the user currently connected
|
List<String> |
getGlobalSpaceURIs()
Returns the GLOBAL DataSpace URI available to all users
|
static SmartProxyImpl |
getInstance()
Returns the real singleton instance of the proxy
|
String |
getJobContent(JobId jobId) |
JobInfo |
getJobInfo(String jobId)
Retrieve a job info by it id.
|
Map<Long,Map<String,Serializable>> |
getJobResultMaps(List<String> jobsId)
Return result maps associated with multiple jobs
|
JobState |
getJobState(String jobId)
Return the state of the given job.
The state contains informations about the job, every tasks and informations about the tasks. The jobId is given as a string. |
Map |
getJobsToSchedule()
Returns a job Descriptor Map with eligible jobs (running and pending)
|
Map<Object,Object> |
getPortalConfiguration() |
Map<Long,List<String>> |
getPreciousTaskNames(List<String> jobsId)
Return the list of task names declared as precious results
|
List<TaskResult> |
getPreciousTaskResults(String jobId)
Return a list of task results which where declared as "preciousResult" for the given job
|
Map<String,Object> |
getSchedulerProperties()
Returns the scheduler properties associated with the user currently connected
|
Subject |
getSubject()
Returns the current user JaaS subject
|
Page<TaskId> |
getTaskIds(String taskTag,
long from,
long to,
boolean mytasks,
Set<TaskStatus> taskStatuses,
int offset,
int limit)
Retrieve a tasks names list from the scheduler.
|
TaskStatesPage |
getTaskPaginated(String jobId,
int offset,
int limit)
Return the page of tasks of the given job.
|
TaskStatesPage |
getTaskPaginated(String jobId,
String statusFilter,
int offset,
int limit) |
TaskResult |
getTaskResult(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> |
getTaskResultAllIncarnations(JobId jobId,
String taskName)
Get the result for the given task name and all result incarnations in the
given jobId.
|
List<TaskResult> |
getTaskResultAllIncarnations(String jobId,
String taskName)
Get the result for the given task name and all result incarnations in the
given jobId.
|
TaskResult |
getTaskResultFromIncarnation(JobId jobId,
String taskName,
int inc)
Get the result for the given task name and the given incarnation in the
given jobId.
|
TaskResult |
getTaskResultFromIncarnation(String jobId,
String taskName,
int inc)
Get the result for the given task name and the given incarnation in the
given jobId.
|
Page<TaskState> |
getTaskStates(String taskTag,
long from,
long to,
boolean mytasks,
Set<TaskStatus> statusFilter,
int offset,
int limit,
SortSpecifierContainer sortParams)
Retrieve a taskstates list from the scheduler.
|
List<String> |
getUserSpaceURIs()
Returns the USER DataSpace URIs associated with the current user
|
void |
init(ConnectionInfo connectionInfo)
Connects to the scheduler
|
void |
init(String url,
CredData credData) |
void |
init(String url,
Credentials credentials) |
void |
initActivity(org.objectweb.proactive.Body body) |
void |
reconnect()
Reconnects this smart proxy to the scheduler
|
void |
registerAsListener() |
void |
registerService(String jobId,
int serviceInstanceid,
boolean enableActions)
Register a cloud automation service associated with the given job
|
void |
removeExternalEndpointUrl(String jobId,
String endpointName)
Remove an external endpoint url from a job.
|
protected void |
removeJobIO(Job job,
String pushURL,
String pullURL,
String newFolderName) |
boolean |
restartAllInErrorTasks(String jobId)
Restart all in error tasks in the job represented by jobId.
This method will restart every in error tasks of this job. The jobId is given as a string. |
boolean |
restartInErrorTask(String jobId,
String taskName) |
JobId |
reSubmit(JobId currentJobId,
Map<String,String> jobVariables,
Map<String,String> jobGenericInfos,
String sessionId) |
JobId |
submit(Job job)
Submit a new job to the scheduler.
|
List<JobIdDataAndError> |
submit(List<Job> jobs)
Submit multiple jobs
|
void |
terminateFast()
This method forcefully terminates the activity of the proxy This method
should not be called via a proactive stub
|
boolean |
uploadInputfiles(TaskFlowJob job,
String localInputFolderPath)
Push the input files of the given job from the local input folder to the
location specified by PUSH_URL.
|
List<JobVariable> |
validateJobSignal(String jobId,
String signal,
Map<String,String> updatedVariables)
Validate the given signal's updated variables
|
addEventListener, addEventListener, addEventListener, changeJobPriority, changeJobPriority, changePolicy, checkInitialized, checkJobsPermissionMethods, cleanDatabase, configureEvents, createLabels, createNewFolderName, deleteLabel, freeze, getAccountUsage, getCompletedJobs, getCompletedTasks, getFilteredStatistics, getJobResult, getJobResult, getJobs, getJobServerLogs, getJobsInfoList, getJobState, getLabels, getMyAccountUsage, getState, getState, getStatus, getSubmissionModeCount, getSubmissionModeValues, getTaskResultsByTag, getTaskResultsByTag, getTaskServerLogs, getTaskServerLogsByTag, getTaskState, getTasksToSchedule, getTopExecutionTimeWorkflows, getTopPendingTimeWorkflows, getTopWorkflowsCumulatedCoreTime, getTopWorkflowsNumberOfNodes, getTopWorkflowsWithIssues, getUsers, getUsersWithJobs, isConnected, jobStateUpdatedEvent, jobSubmittedEvent, jobUpdatedFullDataEvent, kill, killJob, killJob, killJobs, killTask, killTask, linkResourceManager, listenJobLogs, listenJobLogs, pause, pauseJob, pauseJob, preemptTask, preemptTask, prepareJobInput, prepareJobOutput, pullData, putThirdPartyCredential, reinitializeState, reloadPolicyConfiguration, removeAwaitedTask, removeEventListener, removeEventListener, removeJob, removeJob, removeJobLabels, removeJobs, removeJobs, removeThirdPartyCredential, renewSession, restartTask, restartTask, resume, resumeJob, resumeJob, schedulerStateUpdatedEvent, setInitialized, setLabelOnJobs, setLabels, setSessionName, shutdown, start, stop, submit, submit, syncAwaitedJobs, taskStateUpdatedEvent, terminate, thirdPartyCredentialsKeySet, updateJob, updateLabel, updateTask, usersUpdatedEvent
protected transient Scheduler schedulerProxy
public SmartProxyImpl()
getActiveInstance()
or getInstance()
public static SmartProxyImpl getActiveInstance() throws org.objectweb.proactive.ActiveObjectCreationException, org.objectweb.proactive.core.node.NodeException
org.objectweb.proactive.ActiveObjectCreationException
org.objectweb.proactive.core.node.NodeException
public static SmartProxyImpl getInstance()
public void init(ConnectionInfo connectionInfo) throws SchedulerException, LoginException
AbstractSmartProxy
init
in class AbstractSmartProxy<JobTrackerImpl>
LoginException
SchedulerException
public void init(String url, Credentials credentials) throws SchedulerException, LoginException
SchedulerException
LoginException
public void init(String url, CredData credData) throws SchedulerException, LoginException
SchedulerException
LoginException
public void disconnect() throws NotConnectedException, PermissionException
AbstractSmartProxy
disconnect
in interface Scheduler
disconnect
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.public String getCurrentPolicy() throws NotConnectedException, PermissionException
Scheduler
getCurrentPolicy
in interface Scheduler
getCurrentPolicy
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
PermissionException
public Map getJobsToSchedule() throws NotConnectedException, PermissionException
Scheduler
getJobsToSchedule
in interface Scheduler
getJobsToSchedule
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
PermissionException
protected Scheduler _getScheduler()
AbstractSmartProxy
/!\ This method must not be exposed remotely since remote calls to the proxy that is returned will fail with permission failures.
_getScheduler
in class AbstractSmartProxy<JobTrackerImpl>
public void reconnect() throws SchedulerException, LoginException
AbstractSmartProxy
reconnect
in class AbstractSmartProxy<JobTrackerImpl>
SchedulerException
LoginException
public void registerAsListener() throws NotConnectedException, PermissionException
registerAsListener
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
PermissionException
public boolean uploadInputfiles(TaskFlowJob job, String localInputFolderPath) throws Exception
AbstractSmartProxy
uploadInputfiles
in class AbstractSmartProxy<JobTrackerImpl>
job
- job to push data forlocalInputFolderPath
- utFolderPath local input folderNotConnectedException
PermissionException
Exception
protected void downloadTaskOutputFiles(AwaitedJob awaitedjob, String jobId, String t_name, String localFolder) throws Exception
AbstractSmartProxy
downloadTaskOutputFiles
in class AbstractSmartProxy<JobTrackerImpl>
jobId
- job to pull data fort_name
- name of the tasklocalFolder
- local output folder, if not null, it overrides the folder specified as output folder for the jobException
public JobId submit(Job job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException
Scheduler
It will execute the tasks of the jobs as soon as resources are available. The job will be considered as finished once every tasks have finished (error or success). Thus, user could get the job result according to the precious result.
It is possible to get a listener on the scheduler. (see
Scheduler.addEventListener(SchedulerEventListener, boolean, SchedulerEvent...)
for more details)
submit
in interface Scheduler
submit
in class AbstractSmartProxy<JobTrackerImpl>
job
- the new job to submit.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular method.SubmissionClosedException
- if the submit action could not be performed.JobCreationException
- if Their was a problem while creation the jobpublic List<JobIdDataAndError> submit(List<Job> jobs) throws NotConnectedException
Scheduler
submit
in interface Scheduler
submit
in class AbstractSmartProxy<JobTrackerImpl>
jobs
- a list of jobs to submitNotConnectedException
public JobId reSubmit(JobId currentJobId, Map<String,String> jobVariables, Map<String,String> jobGenericInfos, String sessionId) throws NotConnectedException, UnknownJobException, PermissionException, JobCreationException, SubmissionClosedException
reSubmit
in interface Scheduler
currentJobId
- id of the already submitted jobjobVariables
- new job variables which is merged to existing job variables of the submitted jobjobGenericInfos
- new generic information which is merged to existing generic info of the submitted jobUnknownJobException
- if currentJobId
does not correspond to any submitted jobPermissionException
- if user cannot access job with currentJobId
NotConnectedException
JobCreationException
SubmissionClosedException
public JobState getJobState(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.getJobState
in interface Scheduler
getJobState
in class AbstractSmartProxy<JobTrackerImpl>
jobId
- the job on which to get the state.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public TaskResult getTaskResult(String jobId, String taskName) throws NotConnectedException, UnknownJobException, UnknownTaskException, PermissionException
Scheduler
JobId.value()
method.getTaskResult
in interface Scheduler
getTaskResult
in class AbstractSmartProxy<JobTrackerImpl>
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
getTaskResult
in class AbstractSmartProxy<JobTrackerImpl>
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 getTaskResultFromIncarnation(JobId jobId, String taskName, int inc) 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
getTaskResultFromIncarnation
in class AbstractSmartProxy<JobTrackerImpl>
jobId
- the job in which the task result is.taskName
- the name of the task in which the result is.inc
- 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 jobId, String taskName) 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
getTaskResultAllIncarnations
in class AbstractSmartProxy<JobTrackerImpl>
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> getTaskResultAllIncarnations(String jobId, String taskName) 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
getTaskResultAllIncarnations
in class AbstractSmartProxy<JobTrackerImpl>
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 getTaskResultFromIncarnation(String jobId, String taskName, int inc) 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
getTaskResultFromIncarnation
in class AbstractSmartProxy<JobTrackerImpl>
jobId
- the job in which the task result is.taskName
- the name of the task in which the result is.inc
- 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 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 void enableRemoteVisualization(String jobId, String taskName, String connectionString) throws NotConnectedException, PermissionException, UnknownJobException, UnknownTaskException
Scheduler
enableRemoteVisualization
in interface Scheduler
jobId
- id of the jobtaskName
- name of the task which enables visualizationconnectionString
- visualization connection stringNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job and task.UnknownJobException
- if the job does not exist.UnknownTaskException
- if this task does not exist in the job.public void registerService(String jobId, int serviceInstanceid, boolean enableActions) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
registerService
in interface Scheduler
jobId
- id of the jobserviceInstanceid
- id of the PSA service instance to registerenableActions
- if actions should be enabled on this service from the given jobNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public void detachService(String jobId, int serviceInstanceid) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
detachService
in interface Scheduler
jobId
- id of the jobserviceInstanceid
- id of the PSA service to detachNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public void 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 boolean restartAllInErrorTasks(String jobId) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
JobId.value()
method.restartAllInErrorTasks
in interface Scheduler
jobId
- the job to resume.NotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public List<String> getGlobalSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getGlobalSpaceURIs
in interface Scheduler
getGlobalSpaceURIs
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
- if you are not authenticated.PermissionException
public List<String> getUserSpaceURIs() throws NotConnectedException, PermissionException
Scheduler
getUserSpaceURIs
in interface Scheduler
getUserSpaceURIs
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
- if you are not authenticated.PermissionException
public void addEventListener(SchedulerEventListenerExtended listener, boolean myEventsOnly, SchedulerEvent[] events) throws NotConnectedException, PermissionException
addEventListener
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
PermissionException
protected void removeJobIO(Job job, String pushURL, String pullURL, String newFolderName)
removeJobIO
in class AbstractSmartProxy<JobTrackerImpl>
protected void createFolder(String fUri) throws NotConnectedException, PermissionException
createFolder
in class AbstractSmartProxy<JobTrackerImpl>
NotConnectedException
PermissionException
public void initActivity(org.objectweb.proactive.Body body)
initActivity
in interface org.objectweb.proactive.InitActive
public void endActivity(org.objectweb.proactive.Body body)
endActivity
in interface org.objectweb.proactive.EndActive
public void terminateFast()
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 Map<Object,Object> getPortalConfiguration() throws SchedulerException
getPortalConfiguration
in interface Scheduler
PermissionException
NotConnectedException
SchedulerException
public String getCurrentUser() throws NotConnectedException
Scheduler
getCurrentUser
in interface Scheduler
NotConnectedException
public UserData getCurrentUserData() throws NotConnectedException
Scheduler
getCurrentUserData
in interface Scheduler
NotConnectedException
public Subject getSubject() throws NotConnectedException
Scheduler
getSubject
in interface Scheduler
NotConnectedException
public Map<String,Object> getSchedulerProperties() throws SchedulerException
Scheduler
getSchedulerProperties
in interface Scheduler
SchedulerException
public TaskStatesPage getTaskPaginated(String jobId, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException
Scheduler
getTaskPaginated
in interface Scheduler
jobId
- the job on which to get the state.offset
- the starting index of the sublist of tasks to getlimit
- the last index (non inclusive) of the sublist of tasks to getNotConnectedException
- if you are not authenticated.UnknownJobException
- if the job does not exist.PermissionException
- if you can't access this particular job.public TaskStatesPage getTaskPaginated(String jobId, String statusFilter, int offset, int limit) throws NotConnectedException, UnknownJobException, PermissionException
getTaskPaginated
in interface Scheduler
NotConnectedException
UnknownJobException
PermissionException
public List<TaskResult> getPreciousTaskResults(String jobId) throws NotConnectedException, PermissionException, UnknownJobException
Scheduler
getPreciousTaskResults
in interface Scheduler
jobId
- id of the jobNotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.UnknownJobException
- if the job does not exist.public Map<Long,Map<String,Serializable>> getJobResultMaps(List<String> jobsId) throws UnknownJobException, NotConnectedException, PermissionException
Scheduler
getJobResultMaps
in interface Scheduler
jobsId
- list of jobs idsUnknownJobException
- if one of the jobs in the list does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access one job in the list.public Map<Long,List<String>> getPreciousTaskNames(List<String> jobsId) throws SchedulerException
Scheduler
getPreciousTaskNames
in interface Scheduler
jobsId
- id of the jobSchedulerException
public boolean checkPermission(String method) throws SecurityException
ServiceUsingPermission
checkPermission
in interface ServiceUsingPermission
method
- method nameSecurityException
- if the user is not allowed to execute this methodpublic boolean checkJobPermissionMethod(String jobId, String method) throws SchedulerException
Scheduler
checkJobPermissionMethod
in interface Scheduler
jobId
- id of the jobmethod
- operation to testNotConnectedException
UnknownJobException
SchedulerException
public List<String> checkJobsPermissionMethod(List<String> jobIds, String method) throws SchedulerException
Scheduler
checkJobsPermissionMethod
in interface Scheduler
jobIds
- list of jobs idsmethod
- operation to testSchedulerException
public Set<String> addJobSignal(String jobId, String signal, Map<String,String> updatedVariables) throws UnknownJobException, NotConnectedException, PermissionException, SignalApiException, JobValidationException
Scheduler
addJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalUnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apiJobValidationException
public List<JobVariable> validateJobSignal(String jobId, String signal, Map<String,String> updatedVariables) throws UnknownJobException, NotConnectedException, PermissionException, SignalApiException, JobValidationException
Scheduler
validateJobSignal
in interface Scheduler
jobId
- id of the jobsignal
- signal nameupdatedVariables
- the updated variables of the signalUnknownJobException
- if the job does not exist.NotConnectedException
- if you are not authenticated.PermissionException
- if you can't access this particular job.SignalApiException
- errors related to the signal apiJobValidationException