public interface JobRequestBuilder
| Modifier and Type | Method and Description |
|---|---|
JobRequestBuilder |
application(String applicationId)
Sets the application ID.
|
JobRequest |
build()
Returns the configured job request.
|
JobRequestBuilder |
clientEmail(String email)
Sets the client email address.
|
JobRequestBuilder |
clientName(String name)
Sets the client name used to identify the client submitting a job.
|
JobRequestBuilder |
copy(String jobId)
Indicates that the new job should be constructed by copying an existing job.
|
JobRequestBuilder |
copy(String jobId,
boolean shallow)
Indicates that the new job should be constructed by copying an existing job.
|
Future<JobResponse> |
create(JobExecutor executor)
Builds the request and creates the job using a given job executor.
|
JobRequestBuilder |
deleteOnCompletion(boolean delete)
Indicates that the job must be deleted on completion.
|
Future<JobResponse> |
execute(JobExecutor executor)
Builds the request and executes it using a given job executor
|
JobRequestBuilder |
input(File file)
Sets an input source to the given file.
|
JobRequestBuilder |
input(JobInput input)
Adds a custom job input source.
|
JobRequestBuilder |
input(String name,
File file)
Sets an input source to the given file with a specific name.
|
JobRequestBuilder |
input(String name,
InputStream stream)
Sets an input source to the given stream.
|
JobRequestBuilder |
input(String name,
com.fasterxml.jackson.databind.ObjectMapper mapper,
Object input)
Sets the input to the given JSON document.
|
JobRequestBuilder |
input(String name,
URL url)
Sets an input source to the given URL with a specific name.
|
JobRequestBuilder |
livelog(OutputStream stream)
Sets the live log output to a stream.
|
JobRequestBuilder |
livelog(OutputStream stream,
com.ibm.icu.text.DateFormat format)
Sets the live log output to a stream.
|
JobRequestBuilder |
log(File file)
Sets the log output to a file.
|
JobRequestBuilder |
log(OutputStream stream)
Sets the log output to a stream.
|
JobRequestBuilder |
output(File file)
Sets the result output to a file.
|
JobRequestBuilder |
output(JobOutput output)
Adds a custom result output.
|
<T> JobRequestBuilder |
output(com.fasterxml.jackson.databind.ObjectMapper mapper,
Class<T> type)
Sets the result output to a JSON object.
|
<T> JobRequestBuilder |
output(com.fasterxml.jackson.databind.ObjectMapper mapper,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Sets the result output to a JSON object.
|
JobRequestBuilder |
output(OutputStream stream)
Sets the result output to a stream.
|
JobRequestBuilder |
output(String attid,
File file)
Sets the result output to a file for a particular output attachment.
|
<T> JobRequestBuilder |
output(String attid,
com.fasterxml.jackson.databind.ObjectMapper mapper,
Class<T> type)
Sets the result output to a JSON object for a particular output attachment.
|
<T> JobRequestBuilder |
output(String attid,
com.fasterxml.jackson.databind.ObjectMapper mapper,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Sets the result output to a JSON object for a particular output attachment.
|
JobRequestBuilder |
output(String attid,
OutputStream stream)
Sets the result output to a stream for a particular output attachment.
|
JobRequestBuilder |
parameter(String name,
Object value)
Sets the value of a parameter.
|
JobRequestBuilder |
recreate(String jobId)
Indicates that the new job should be constructed by replacing an existing job.
|
JobRequestBuilder |
timeout(long timeout,
TimeUnit unit)
Sets the timeout for the job monitoring.
|
JobRequestBuilder |
useBatchSubmitMode()
Tries to create a job, upload attachments, and submit a job in one call to avoid network round
trips.
|
JobRequestBuilder |
version(String version)
Sets the application version to use during solve.
|
JobRequestBuilder application(String applicationId)
opl or cplex). There are two ways to manage the application ID:
<ul>
<li>
The application ID can be specified explicitly at creation time. In this case, the attachments
can be declared and uploaded incrementally. When the job is submitted, the list of attachments
must be compatible with the application ID, otherwise an exception will be returned.
</li>
<li>
The application ID can be left unspecified at creation time. In this case, the full list of
attachments must be declared, and the application ID will be deduced from the attachment
extensions.
</li>
</ul>applicationId - The application ID.JobRequestBuilder version(String version)
JobFailureType.PROCESSING failure is raised. If nothing is specified latest version is
used. It is possible for a solved job to get version used during solve using
Job.getApplicationVersionUsed()version - The application version.JobRequestBuilder clientName(String name)
name - The client name.JobRequestBuilder clientEmail(String email)
email - The client email address.JobRequestBuilder parameter(String name, Object value)
name - The parameter name.value - The parameter value.JobRequestBuilder input(File file)
file - The file.JobRequestBuilder useBatchSubmitMode()
JobRequestBuilder input(String name, File file)
name - The attachment name.file - The file.JobRequestBuilder input(String name, URL url)
name - The attachment name.url - The URL.JobRequestBuilder input(String name, InputStream stream)
name - The attachment name.stream - The stream.JobRequestBuilder input(String name, com.fasterxml.jackson.databind.ObjectMapper mapper, Object input)
name - The attachment name.mapper - The mapper used to serialize the object.input - The input object.JobRequestBuilder input(JobInput input)
input - The custom job input.JobRequestBuilder output(File file)
output(String, File) or
JobClient.downloadJobAttachment(String, String). Several output commands can be
combined in the same request.file - The file to write to.JobRequestBuilder output(OutputStream stream)
output(String, OutputStream) or
JobClient.downloadJobAttachment(String, String). Several output commands can be
combined in the same request.stream - The stream to write to.JobRequestBuilder output(JobOutput output)
output - The custom output.<T> JobRequestBuilder output(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> type)
output(String, ObjectMapper, TypeReference) or
JobClient.downloadJobAttachment(String, String). Several output
commands can be combined in the same request.T - The object type.mapper - The JSON mapper.type - The class of the object type.<T> JobRequestBuilder output(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> type)
output(String, ObjectMapper, Class)
or JobClient.downloadJobAttachment(String, String). Several output commands
can be combined in the same request.T - The object type.mapper - The JSON mapper.type - The class of the object type.JobRequestBuilder log(File file)
file - The file to write to.JobRequestBuilder log(OutputStream stream)
stream - The stream to write to.JobRequestBuilder livelog(OutputStream stream)
stream - The stream to write to.JobRequestBuilder livelog(OutputStream stream, com.ibm.icu.text.DateFormat format)
stream - The stream to write to.format - Date formatter for the dates in the log.JobRequestBuilder deleteOnCompletion(boolean delete)
PROCESSED, FAILED, or INTERRUPTED.delete - true if it must be deleted, false otherwise.JobRequestBuilder timeout(long timeout, TimeUnit unit)
JobParameters.TIME_LIMIT parameter.timeout - The timeout: -1 for no timeout or 0 for the executor default timeout.unit - The time unit.JobRequest build()
Future<JobResponse> execute(JobExecutor executor) throws OperationException, IOException, InterruptedException, JobException
executor - The job executor.OperationException - if any other remote exception was raised.IOException - if an I-O exception was raised.InterruptedException - if the job was interrupted.JobException - if the job failed.JobExecutor.execute(JobRequest)Future<JobResponse> create(JobExecutor executor) throws OperationException, IOException, InterruptedException, JobException
executor - The job executor.OperationException - if any other remote exception was raised.IOException - if an I-O exception was raised.InterruptedException - if the job was interrupted.JobException - if the job failed.JobExecutor.create(JobRequest, JobCallback)JobRequestBuilder copy(String jobId)
jobId - The ID of the job to copy.JobRequestBuilder copy(String jobId, boolean shallow)
jobId - The ID of the job to copy.shallow - true if a shallow copy is requested.JobRequestBuilder recreate(String jobId)
jobId - The ID of the job to replace.JobRequestBuilder output(String attid, File file)
attid - The output attachment ID.file - The file to write to.<T> JobRequestBuilder output(String attid, com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> type)
T - The output type.attid - The output attachment ID.mapper - The JSON mapper.type - The class of the output type.<T> JobRequestBuilder output(String attid, com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> type)
T - The output type.attid - The output attachment ID.mapper - The JSON mapper.type - The type reference of the output type.JobRequestBuilder output(String attid, OutputStream stream)
attid - The output attachment ID.stream - The stream to write to.Copyright © 2015–2017 IBM Corporation. Licensed under the Apache License, Version 2.0.