org.simoes.lpd.command
Class CommandReceiveJob

java.lang.Object
  extended byorg.simoes.lpd.command.CommandHandler
      extended byorg.simoes.lpd.command.CommandReceiveJob

public class CommandReceiveJob
extends CommandHandler

This class handles the Receive a printer job Command in RFC1179. The RFC description is below:
5.2 02 - Receive a printer job
+----+-------+----+
| 02 | Queue | LF |
+----+-------+----+
Command code - 2
Operand - Printer queue name

Receiving a job is controlled by a second level of commands. The daemon is given commands by sending them over the same connection. The commands are described in the next section (6).
After this command is sent, the client must read an acknowledgement octet from the daemon. A positive acknowledgement is an octet of zero bits. A negative acknowledgement is an octet of any other pattern.

Author:
Chris Simoes

Field Summary
 
Fields inherited from class org.simoes.lpd.command.CommandHandler
command, is, os
 
Constructor Summary
CommandReceiveJob(byte[] command, java.io.InputStream is, java.io.OutputStream os)
          Constructor for CommandReceiveJob.
 
Method Summary
 void execute()
          Receives the print job and adds it to the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandReceiveJob

public CommandReceiveJob(byte[] command,
                         java.io.InputStream is,
                         java.io.OutputStream os)
Constructor for CommandReceiveJob.

Parameters:
command - the lpr client command, it should start with a 0x2 if this command was called
is - the InputStream from the lpr client
os - the OutputStream to the lpr client
Method Detail

execute

public void execute()
             throws LPDException
Receives the print job and adds it to the queue.

Specified by:
execute in class CommandHandler
Throws:
LPDException - thrown when an error occurs