net.sf.lpr
Class LPRQueueDepthShort

java.lang.Object
  extended by net.sf.lpr.spi.AbstractQueueDepth
      extended by net.sf.lpr.LPRQueueDepthShort
All Implemented Interfaces:
LPR

public class LPRQueueDepthShort
extends AbstractQueueDepth
implements LPR

Concrete implementation that Queries the LPD server for its current depth passing the long code to the server. The response is provided the caller via a Writer. This is done to allow for the user to implement a writer that can be used to parse the response from the LPD server. Due to the lack of standardization for responses the only way that I could think was to provide a writer that the Socket response could be written to.

Author:
x_sid

Constructor Summary
LPRQueueDepthShort(java.lang.String serverName, java.lang.String queue, java.io.Writer response)
          Constructor to create a query for the LPD server to respond with the current depth of the print queue.
 
Method Summary
protected  DaemonCommand getSendQueueState(java.io.PrintStream print, java.io.InputStream serverIn, java.lang.String queue, java.io.Writer response)
           
 
Methods inherited from class net.sf.lpr.spi.AbstractQueueDepth
print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.lpr.LPR
print
 

Constructor Detail

LPRQueueDepthShort

public LPRQueueDepthShort(java.lang.String serverName,
                          java.lang.String queue,
                          java.io.Writer response)
Constructor to create a query for the LPD server to respond with the current depth of the print queue.

Parameters:
serverName - the name of the server. This is passed straight to a Socket in the constructor of new Socket(servername, port) so it will take any thing that this constructor will take
queue - the queue on the LPD server that is to be queried for
response - Writer that the response from the server will be written to.
Method Detail

getSendQueueState

protected DaemonCommand getSendQueueState(java.io.PrintStream print,
                                          java.io.InputStream serverIn,
                                          java.lang.String queue,
                                          java.io.Writer response)
Specified by:
getSendQueueState in class AbstractQueueDepth