Permalink
Browse files

createJob(String jobName, String userName) added

  • Loading branch information...
oboehm
oboehm committed Sep 4, 2018
1 parent a49d492 commit 44c1f2b1321c221919e59501a155d8e841946f07
Showing with 31 additions and 16 deletions.
  1. +31 −16 src/main/java/org/cups4j/CupsPrinter.java
@@ -199,23 +199,38 @@ private static void verifyUser(String userName, PrintJob[] printJobs) {
}
}
/**
* If you want to print serveral print jobs as one job you must first tell
* CUPS that you want to start. This is the method to create a job. The
* returned job-id must be used for the following print calls.
*
* @param jobName the name of a job
* @return the job-id
* @since 0.7.2
* @author oboehm
* @deprecated use {@link #createJob(PrintJob)}
*/
@Deprecated
public int createJob(String jobName) {
return createJob(new PrintJob.Builder(new byte[0]).jobName(jobName).userName(CupsClient.DEFAULT_USER).build());
}
/**
* If you want to print serveral print jobs as one job you must first tell
* CUPS that you want to start. This is the method to create a job. The
* returned job-id must be used for the following print calls.
*
* @param jobName the name of a job
* @return the job-id
* @since 0.7.2
* @author oboehm
* @deprecated use {@link #createJob(PrintJob)} or {@link #createJob(String, String)}
*/
@Deprecated
public int createJob(String jobName) {
return createJob(jobName, CupsClient.DEFAULT_USER);
}
/**
/**
* If you want to print serveral print jobs as one job you must first tell
* CUPS that you want to start. This is the method to create a job. The
* returned job-id must be used for the following print calls.
*
* @param jobName the name of a job
* @param userName the name of a user
* @return the job-id
* @since 0.7.4
* @author oboehm
*/
public int createJob(String jobName, String userName) {
return createJob(new PrintJob.Builder(new byte[0]).jobName(jobName).userName(userName).build());
}
/**
* If you want to print serveral print jobs as one job you must first tell
* CUPS that you want to start. This is the method to create a job. The
* returned job-id must be used for the following print calls.

0 comments on commit 44c1f2b

Please sign in to comment.