/** * Initializes the task description. * @param jobId The <code>UUID</code> of the job that the task is for. * @param taskId The ID of the task to be performed. * @param task An <code>Object</code> describing the task to be performed. * This should be passed to <code>TaskWorker.performTask</code>. * @see TaskWorker#performTask(Object, ca.eandb.util.progress.ProgressMonitor) */ public TaskDescription(UUID jobId, int taskId, Object task) { this.jobId = jobId; this.taskId = taskId; this.task = new Serialized<Object>(task); }
/** * Submits a job to a server for processing. * @param job The <code>ParallelizableJob</code> to be processed. * @param description A description of the job. * @param host The host name of the server to send the job to. * @param username The user name to use to authenticate with the server. * @param password The password to use to authenticate with the server. * @return The <code>UUID</code> assigned to the job. * @throws SecurityException If the user does not have access to perform * the requested action on the server. * @throws RemoteException If a failure occurs in attempting to communicate * with the server. * @throws ClassNotFoundException If deserialization of the job at the * server requires a class that could not be found on the server. * @throws JobExecutionException If the submitted job threw an exception at * the server during initialization. * @throws LoginException If the login attempt fails. * @throws NotBoundException If the <code>AuthenticationService</code> * could not be found at the server. * @throws ProtocolVersionException If this client is incompatible with the * server. */ public static UUID submitJob(ParallelizableJob job, String description, String host, String username, String password) throws SecurityException, RemoteException, ClassNotFoundException, JobExecutionException, LoginException, NotBoundException, ProtocolVersionException { Serialized<ParallelizableJob> payload = new Serialized<ParallelizableJob>(job); JobService service = connect(host, username, password); return service.submitJob(payload, description); }