org.simoes.lpd.command
Class CommandRemovePrintJob

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

public class CommandRemovePrintJob
extends CommandHandler

This class handles the Remove jobs Command in RFC1179. The RFC description is below:
5.5 05 - Remove jobs

+----+-------+----+-------+----+------+----+
| 05 | Queue | SP | Agent | SP | List | LF |
+----+-------+----+-------+----+------+----+
Command code - 5
Operand 1 - Printer queue name
Operand 2 - User name making request (the agent)
Other operands - User names or job numbers

This command deletes the print jobs from the specified queue which are listed as the other operands. If only the agent is given, the command is to delete the currently active job. Unless the agent is "root", it is not possible to delete a job which is not owned by the user. This is also the case for specifying user names instead of numbers. That is, agent "root" can delete jobs by user name but no other agents can.
Operand 1 = Queue name
Operand 2 = User name
Operand 3 = Print Job Number
NOTE: If user is Administrator or root they can delete any job.

Author:
Chris Simoes

Field Summary
 
Fields inherited from class org.simoes.lpd.command.CommandHandler
command, is, os
 
Constructor Summary
CommandRemovePrintJob(byte[] command, java.io.InputStream is, java.io.OutputStream os)
           
 
Method Summary
 void execute()
          Removes the print jobs specified by the parameters passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandRemovePrintJob

public CommandRemovePrintJob(byte[] command,
                             java.io.InputStream is,
                             java.io.OutputStream os)
Method Detail

execute

public void execute()
             throws LPDException
Removes the print jobs specified by the parameters passed in. The queue and user need to be set. The final parameter needs to be a print job number.

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