org.ogf.saga.job
Interface JobService

All Superinterfaces:
Async, Cloneable, SagaObject

public interface JobService
extends SagaObject, Async

A JobService represents a resource management back-end. It allows for job creation, submission, and discovery. Deviation from the SAGA specification: the convenience method runJob is specified differently here, because as described in the SAGA specifications it cannot easily be specified in Java, since Java has no OUT parameters.


Field Summary
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Method Summary
 Job createJob(JobDescription jd)
          Creates a job instance as specified by the job description provided.
 Task<JobService,Job> createJob(TaskMode mode, JobDescription jd)
          Creates a task that creates a job instance as specified by the job description provided.
 Job getJob(String jobId)
          Returns the job instance associated with the specified job identification.
 Task<JobService,Job> getJob(TaskMode mode, String jobId)
          Creates a task that obtains the job instance associated with the specified job identification.
 JobSelf getSelf()
          Returns a job instance representing the calling application.
 Task<JobService,JobSelf> getSelf(TaskMode mode)
          Creates a task that obtains a job instance representing the calling application.
 List<String> list()
          Obtains the list of jobs that are currently known to the resource manager.
 Task<JobService,List<String>> list(TaskMode mode)
          Creates a task that obtains the list of jobs that are currently known to the resource manager.
 Job runJob(String commandLine)
          Runs the specified command, non-interactively, on a host chosen by the implementation.
 Job runJob(String commandLine, boolean interactive)
          Runs the specified command on a host chosen by the implementation.
 Job runJob(String commandLine, String host)
          Runs the specified command, non-interactively, on the specified host.
 Job runJob(String commandLine, String host, boolean interactive)
          Runs the specified command on the specified host.
 Task<JobService,Job> runJob(TaskMode mode, String commandLine)
          Creates a task that runs the specified command, non-interactively, on a host chosen by the implementation.
 Task<JobService,Job> runJob(TaskMode mode, String commandLine, boolean interactive)
          Creates a task that runs the specified command on a host chosen by the implementation.
 Task<JobService,Job> runJob(TaskMode mode, String commandLine, String host)
          Creates a task that runs the specified command, non-interactively, on the specified host.
 Task<JobService,Job> runJob(TaskMode mode, String commandLine, String host, boolean interactive)
          Creates a task that runs the specified command on the specified host.
 
Methods inherited from interface org.ogf.saga.SagaObject
clone, getId, getSession
 

Method Detail

createJob

Job createJob(JobDescription jd)
              throws NotImplementedException,
                     AuthenticationFailedException,
                     AuthorizationFailedException,
                     PermissionDeniedException,
                     BadParameterException,
                     TimeoutException,
                     NoSuccessException
Creates a job instance as specified by the job description provided. The job is delivered in 'New' state. The provided job description is copied, so can be modified after this call.

Parameters:
jd - the job description.
Returns:
the job.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the job description does not contain a valid EXECUTABLE, or contains invalid values.

runJob

Job runJob(String commandLine,
           String host,
           boolean interactive)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  TimeoutException,
                  NoSuccessException
Runs the specified command on the specified host. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters. Unfortunately, their absence, according to the SAGA specifications, implies a non-interactive job. Since interactive jobs should still be supported, a parameter is added here to specify whether the job is interactive. If interactive, the streams can be obtained from the Job using the Job.getStdin(), Job.getStdout(), and Job.getStderr() methods.

Parameters:
commandLine - the command to run.
host - hostname of the host on which the command must be run. If this is an empty string, the implementation is free to choose a host.
interactive - specifies whether the job is interactive.
Returns:
the job.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the command line cannot be parsed.

runJob

Job runJob(String commandLine,
           String host)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  TimeoutException,
                  NoSuccessException
Runs the specified command, non-interactively, on the specified host. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters.

Parameters:
commandLine - the command to run.
host - hostname of the host on which the command must be run. If this is an empty string, the implementation is free to choose a host.
Returns:
the job.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the command line cannot be parsed.

runJob

Job runJob(String commandLine,
           boolean interactive)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  TimeoutException,
                  NoSuccessException
Runs the specified command on a host chosen by the implementation. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters. Unfortunately, their absence, according to the SAGA specifications, implies a non-interactive job. Since interactive jobs should still be supported, a parameter is added here to specify whether the job is interactive. If interactive, the streams can be obtained from the Job using the Job.getStdin(), Job.getStdout(), and Job.getStderr() methods.

Parameters:
commandLine - the command to run.
interactive - specifies whether the job is interactive.
Returns:
the job.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the command line cannot be parsed.

runJob

Job runJob(String commandLine)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  TimeoutException,
                  NoSuccessException
Runs the specified command, non-interactively, on a host chosen by the implementation. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters.

Parameters:
commandLine - the command to run.
Returns:
the job.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the command line cannot be parsed.

list

List<String> list()
                  throws NotImplementedException,
                         AuthenticationFailedException,
                         AuthorizationFailedException,
                         PermissionDeniedException,
                         TimeoutException,
                         NoSuccessException
Obtains the list of jobs that are currently known to the resource manager.

Returns:
a list of job identifications.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

getJob

Job getJob(String jobId)
           throws NotImplementedException,
                  AuthenticationFailedException,
                  AuthorizationFailedException,
                  PermissionDeniedException,
                  BadParameterException,
                  DoesNotExistException,
                  TimeoutException,
                  NoSuccessException
Returns the job instance associated with the specified job identification.

Parameters:
jobId - the job identification.
Returns:
the job instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.
BadParameterException - is thrown when the JobService cannot parse the job id.
DoesNotExistException - is thrown when the JobService can handle the job id, but the referenced job is not alive.

getSelf

JobSelf getSelf()
                throws NotImplementedException,
                       AuthenticationFailedException,
                       AuthorizationFailedException,
                       PermissionDeniedException,
                       TimeoutException,
                       NoSuccessException
Returns a job instance representing the calling application.

Returns:
the job instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

createJob

Task<JobService,Job> createJob(TaskMode mode,
                               JobDescription jd)
                               throws NotImplementedException
Creates a task that creates a job instance as specified by the job description provided. The job is delivered in 'New' state.

Parameters:
mode - the task mode.
jd - the job description.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

list

Task<JobService,List<String>> list(TaskMode mode)
                                   throws NotImplementedException
Creates a task that obtains the list of jobs that are currently known to the resource manager.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getJob

Task<JobService,Job> getJob(TaskMode mode,
                            String jobId)
                            throws NotImplementedException
Creates a task that obtains the job instance associated with the specified job identification.

Parameters:
mode - the task mode.
jobId - the job identification.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

getSelf

Task<JobService,JobSelf> getSelf(TaskMode mode)
                                 throws NotImplementedException
Creates a task that obtains a job instance representing the calling application.

Parameters:
mode - the task mode.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

runJob

Task<JobService,Job> runJob(TaskMode mode,
                            String commandLine,
                            String host,
                            boolean interactive)
                            throws NotImplementedException
Creates a task that runs the specified command on the specified host. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters. Unfortunately, their absence, according to the SAGA specifications, implies a non-interactive job. Since interactive jobs should still be supported, a parameter is added here to specify whether the job is interactive. If interactive, the streams can be obtained from the Job using the Job.getStdin(), Job.getStdout(), and Job.getStderr() methods

Parameters:
mode - the task mode.
commandLine - the command to run.
host - hostname of the host on which the command must be run. If this is an empty string, the implementation is free to choose a host.
interactive - specifies whether the job is interactive.
Returns:
the task.
Throws:
NotImplementedException

runJob

Task<JobService,Job> runJob(TaskMode mode,
                            String commandLine,
                            String host)
                            throws NotImplementedException
Creates a task that runs the specified command, non-interactively, on the specified host. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters.

Parameters:
mode - the task mode.
commandLine - the command to run.
host - hostname of the host on which the command must be run. If this is an empty string, the implementation is free to choose a host.
Returns:
the task.
Throws:
NotImplementedException

runJob

Task<JobService,Job> runJob(TaskMode mode,
                            String commandLine,
                            boolean interactive)
                            throws NotImplementedException
Creates a task that runs the specified command on a host chosen by the implementation. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters. Unfortunately, their absence, according to the SAGA specifications, implies a non-interactive job. Since interactive jobs should still be supported, a parameter is added here to specify whether the job is interactive. If interactive, the streams can be obtained from the Job using the Job.getStdin(), Job.getStdout(), and Job.getStderr() methods.

Parameters:
mode - the task mode.
commandLine - the command to run.
interactive - specifies whether the job is interactive.
Returns:
the task.
Throws:
NotImplementedException

runJob

Task<JobService,Job> runJob(TaskMode mode,
                            String commandLine)
                            throws NotImplementedException
Creates a task that runs the specified command, non-interactively, on a host chosen by the implementation. Deviation from the SAGA specification: the input, output and error stream OUT parameters are not specified here, since Java has no OUT parameters.

Parameters:
mode - the task mode.
commandLine - the command to run.
Returns:
the task.
Throws:
NotImplementedException


Copyright © 2014 Open Grid Forum. All rights reserved.