org.cups4j
Class CupsPrinter

java.lang.Object
  extended by org.cups4j.CupsPrinter

public class CupsPrinter
extends java.lang.Object

Represents a printer on your IPP server


Constructor Summary
CupsPrinter(java.net.URL printerURL, java.lang.String printerName, boolean isDefault)
          Constructor
 
Method Summary
 java.lang.String getDescription()
          Get description attribute for this printer
 java.util.List<PrintJobAttributes> getJobs(WhichJobsEnum whichJobs, java.lang.String user, boolean myJobs)
          Get a list of jobs
 JobStateEnum getJobStatus(int jobID)
          Get current status for the print job with the given ID.
 JobStateEnum getJobStatus(java.lang.String userName, int jobID)
          Get current status for the print job with the given ID
 java.lang.String getLocation()
          Get location attribute for this printer
 java.lang.String getName()
          Get name of this printer.
 java.net.URL getPrinterURL()
          Get the URL for this printer
 boolean isDefault()
          Is this the default printer
 PrintRequestResult print(PrintJob printJob)
          Print method
protected  void setDefault(boolean isDefault)
           
 void setDescription(java.lang.String description)
           
 void setLocation(java.lang.String location)
           
 java.lang.String toString()
          Get a String representation of this printer consisting of the printer URL and the name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CupsPrinter

public CupsPrinter(java.net.URL printerURL,
                   java.lang.String printerName,
                   boolean isDefault)
Constructor

Parameters:
printerURL -
printerName -
isDefault - true if this is the default printer on this IPP server
Method Detail

print

public PrintRequestResult print(PrintJob printJob)
                         throws java.lang.Exception
Print method

Parameters:
printJob -
Returns:
PrintRequestResult
Throws:
java.lang.Exception

getJobs

public java.util.List<PrintJobAttributes> getJobs(WhichJobsEnum whichJobs,
                                                  java.lang.String user,
                                                  boolean myJobs)
                                           throws java.lang.Exception
Get a list of jobs

Parameters:
whichJobs - completed, not completed or all
user - requesting user (null will be translated to anonymous)
myJobs - boolean only jobs for requesting user or all jobs for this printer?
Returns:
job list
Throws:
java.lang.Exception

getJobStatus

public JobStateEnum getJobStatus(int jobID)
                          throws java.lang.Exception
Get current status for the print job with the given ID.

Parameters:
jobID -
Returns:
job status
Throws:
java.lang.Exception

getJobStatus

public JobStateEnum getJobStatus(java.lang.String userName,
                                 int jobID)
                          throws java.lang.Exception
Get current status for the print job with the given ID

Parameters:
userName -
jobID -
Returns:
job status
Throws:
java.lang.Exception

getPrinterURL

public java.net.URL getPrinterURL()
Get the URL for this printer

Returns:
printer URL

isDefault

public boolean isDefault()
Is this the default printer

Returns:
true if this is the default printer false otherwise

setDefault

protected void setDefault(boolean isDefault)

toString

public java.lang.String toString()
Get a String representation of this printer consisting of the printer URL and the name

Overrides:
toString in class java.lang.Object
Returns:
String

getName

public java.lang.String getName()
Get name of this printer.

For a printer http://localhost:631/printers/printername 'printername' will be returned.

Returns:
printer name

getLocation

public java.lang.String getLocation()
Get location attribute for this printer

Returns:
location

setLocation

public void setLocation(java.lang.String location)

getDescription

public java.lang.String getDescription()
Get description attribute for this printer

Returns:
description

setDescription

public void setDescription(java.lang.String description)


Copyright © 2009 Harald Weyhing. All Rights Reserved.