Skip to content

Commit

Permalink
Clarifies async nature of jobs().create(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
louismrose committed Apr 17, 2024
1 parent 4804be7 commit 2c471c5
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/main/java/com/zamzar/api/JobsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,57 @@ public JobManager cancel(Integer id) throws ApiException {
}

/**
* Starts a job to convert a local file.
* Starts a job to convert a local file, returning once the job has been created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(File source, String targetFormat) throws ApiException {
return create(source, targetFormat, JobBuilder.Modifier.identity());
}

/**
* Starts a job to convert a local file, with a customised job builder.
* Starts a job to convert a local file, with a customised job builder; returning once the job has been created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(File source, String targetFormat, JobBuilder.Modifier modifier) throws ApiException {
return create(modifier.modify(new JobBuilder(source, targetFormat)));
}

/**
* Starts a job to convert a file already resident on the Zamzar API servers.
* Starts a job to convert a file already resident on the Zamzar API servers; returning once the job has been
* created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(Integer sourceId, String targetFormat) throws ApiException {
return create(sourceId, targetFormat, JobBuilder.Modifier.identity());
}

/**
* Starts a job to convert a file already resident on the Zamzar API servers, with a customised job builder.
* Returns once the job has been created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(Integer sourceId, String targetFormat, JobBuilder.Modifier modifier) throws ApiException {
return create(modifier.modify(new JobBuilder(sourceId, targetFormat)));
}

/**
* Starts a job to convert a file from a URL.
* Starts a job to convert a file from a URL, returning once the job has been created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(URI source, String targetFormat) throws ApiException {
return create(source, targetFormat, JobBuilder.Modifier.identity());
}

/**
* Starts a job to convert a file from a URL, with a customised job builder.
* Starts a job to convert a file from a URL, with a customised job builder; returning once the job has been
* created.
* <p>
* Call {@link JobManager#awaitOrThrow()} on the returned object to block until the job has completed.
*/
public JobManager create(URI source, String targetFormat, JobBuilder.Modifier modifier) throws ApiException {
return create(modifier.modify(new JobBuilder(source, targetFormat)));
Expand Down

0 comments on commit 2c471c5

Please sign in to comment.