net.sf.lpr.daemon.subcommands
Class ReceiveControlFile

java.lang.Object
  extended by net.sf.lpr.daemon.subcommands.ReceiveControlFile
All Implemented Interfaces:
DaemonCommand

public class ReceiveControlFile
extends java.lang.Object
implements DaemonCommand

Class for formatting the portion of the message that is sent to the server during a single session that describes to the server what the data that will be sent to the server to be printed is. This is for the Control File portion as described in RFC 1179.

Author:
x_sid

Constructor Summary
ReceiveControlFile(java.io.PrintStream print, java.io.InputStream serverIn, int jobID, java.lang.String serverName, PrintType printType, java.lang.String username, java.lang.String filename)
          Constructs the portion of the message that is the control file to be sent to the LPD server.
 
Method Summary
 void print()
          All classes that implement this interface will do their work when the print() is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReceiveControlFile

public ReceiveControlFile(java.io.PrintStream print,
                          java.io.InputStream serverIn,
                          int jobID,
                          java.lang.String serverName,
                          PrintType printType,
                          java.lang.String username,
                          java.lang.String filename)
Constructs the portion of the message that is the control file to be sent to the LPD server.

Parameters:
print - the PrintStream that the control file will be written to.
serverIn - the stream used to read the response from the server.
jobID - the job ID that needs to be used throughout a single session with the LPD server.
serverName - the name of the server that the session is being communicated with.
printType - type of data that the data file contains.
username - user name that will be associated with the data file that is to be printed.
filename - the name of the file that will be associated with the data file.
Method Detail

print

public void print()
           throws IORuntimeException
Description copied from interface: DaemonCommand
All classes that implement this interface will do their work when the print() is called.

Specified by:
print in interface DaemonCommand
Throws:
IORuntimeException - if an IO error occurs while reading or writing to/from the provided streams. Also will be thrown if the response from the server is unexpected.