|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdirk_krause.jtools.PrintClient
public class PrintClient
Printer client. Objects of this class can send a byte array or a string containing the print job data to an LPD server or directly to a printer using a direct TCP connection.
Field Summary | |
---|---|
protected boolean |
appendCtrlD
Flag: Append CTRL-D to end if not present. |
protected java.lang.String |
destinationHost
Host (name or IP) to submit job to. |
protected int |
destinationPort
Port number on destination host. |
protected int |
destinationProtocol
Protocol for print job submission. |
protected java.lang.String |
destinationQueue
Queue name on destination host. |
protected java.lang.String |
destinationUser
User name for print job. |
static int |
ERROR_BAD_REMOTE_ADDRESS
Error: Problems with remote address. |
static int |
ERROR_FAILED_LOCAL_PORT
Error: Failed to bind local port. |
static int |
ERROR_FAILED_TO_CONNECT
Error: Failed to connect to remote address. |
static int |
ERROR_FAILED_TO_CREATE_SOCKET
Error: Failed to create socket. |
static int |
ERROR_FAILED_TO_FIND_HOSTNAME
Error: Failed to find my own host name. |
static int |
ERROR_INVALID_ARGUMENT
Error: An invalid argument was passed to a method. |
static int |
ERROR_MEMORY
Error: Memory allocation problem. |
static int |
ERROR_NO_DESTINATION
Error: No destination specified yet. |
static int |
ERROR_REJECTED_BY_SERVER
Error: Request rejected by server. |
static int |
ERROR_UNKNOWN_PROTOCOL
Error: Unknown protocol, must be "tcp" or "lpd". |
static int |
ERROR_WHILE_READING
Error: Failed to read response. |
static int |
ERROR_WHILE_WRITING
Error: Failed to write data. |
protected int |
lastError
Error code for last error occured. |
protected int |
localPortMax
Local port (maximum value). |
protected int |
localPortMin
Local port (minimum value). |
static java.lang.String[] |
optionKeys
Option keywords. |
static java.lang.String |
prefKey
Key to retrieve job ID. |
static java.lang.String |
prefRoot
Preferences root key. |
static int |
PROTOCOL_LPR
Protocol: LPR/LPD. |
static int |
PROTOCOL_TCP
Protocol: Raw TCP. |
static int |
PROTOCOL_UNKNOWN
Protocol: Not yet specified. |
static java.lang.String[] |
protocols
Protocol strings. |
protected boolean |
readResponse
Flag: Read response from printer. |
protected java.lang.String |
responseString
Response from printer. |
static byte[] |
zerobyte
Confirmation byte to send after LPR requests. |
Constructor Summary | |
---|---|
PrintClient()
|
Method Summary | |
---|---|
int |
getLastError()
Retrieve last error code, reset error code. |
java.lang.String |
getResponse()
|
boolean |
setDestination(java.lang.String ds)
Set destination for print jobs submitted later. |
boolean |
submit(byte[] printJob)
Submit print job specified as byte array. |
boolean |
submit(byte[] printJob,
boolean ctrlD)
Submit print job. |
boolean |
submit(java.lang.String printJob)
Submit print job. |
boolean |
submit(java.lang.String printJob,
boolean ctrlD)
Submit print job. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ERROR_MEMORY
public static final int ERROR_UNKNOWN_PROTOCOL
public static final int ERROR_NO_DESTINATION
public static final int ERROR_INVALID_ARGUMENT
public static final int ERROR_FAILED_TO_CREATE_SOCKET
public static final int ERROR_FAILED_LOCAL_PORT
public static final int ERROR_BAD_REMOTE_ADDRESS
public static final int ERROR_FAILED_TO_CONNECT
public static final int ERROR_WHILE_WRITING
public static final int ERROR_WHILE_READING
public static final int ERROR_FAILED_TO_FIND_HOSTNAME
public static final int ERROR_REJECTED_BY_SERVER
public static final int PROTOCOL_UNKNOWN
public static final int PROTOCOL_LPR
public static final int PROTOCOL_TCP
public static final java.lang.String[] protocols
public static final java.lang.String[] optionKeys
public static final java.lang.String prefRoot
public static final java.lang.String prefKey
public static final byte[] zerobyte
protected int destinationProtocol
protected java.lang.String destinationHost
protected int destinationPort
protected java.lang.String destinationQueue
protected java.lang.String destinationUser
protected int lastError
protected int localPortMin
protected int localPortMax
protected boolean readResponse
protected boolean appendCtrlD
protected java.lang.String responseString
Constructor Detail |
---|
public PrintClient()
Method Detail |
---|
public int getLastError()
public boolean submit(byte[] printJob, boolean ctrlD)
printJob
- Print job data.ctrlD
- Flag: Must add final CTRL-D if not present.
public boolean submit(byte[] printJob)
printJob
- Print job data.
public boolean submit(java.lang.String printJob, boolean ctrlD)
printJob
- Print job data.ctrlD
- Flag: Must add final CTRL-D if not present.
public boolean submit(java.lang.String printJob)
printJob
- Print job data as string.
public boolean setDestination(java.lang.String ds)
ds
- Destination description.
public java.lang.String getResponse()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |