com.ibm.dse.services.formsprint
Interface PrintService

All Known Implementing Classes:
FormsPathService, JetFormService

public interface PrintService
extends Notifier

The PrintService interface provides the public methods to be used when working with any quality printing service.


Method Summary
 java.util.Vector getJobListPrintingResults()
          Returns a list with the information that is available for each of the jobs that have been sent to the printer.
 KeyedCollection getJobResult(long jobId)
          Returns a keyed collection with all the available information for a job, given its identifier.
 int getJobsCurrentlyProcessing()
          Returns the number of jobs that have not yet been completed.
 int getStatus()
          Gives the current status of the printer.
 void initialize()
          Initializes the printer device.
 boolean isJobCompleted(long jobId)
          Answers true if the job with a given ID has already been printed.
 long printForm(FormsRecordFormat aFormat, Context aContext)
          Formats a context with a given format of type FormsRecordFormat and then performs the asynchronous print with the resulting String.
 long printForm(java.lang.String data)
          Performs the asynchronous print.
 long printForm(java.lang.String aFormatName, Context aContext)
          Instantiates a FormsRecordFormat, given its name, and uses it to format a context.
 void printFormAndWait(FormsRecordFormat aFormat, Context aContext)
          Formats a context with a format of type FormsRecordFormat and then performs the synchronous print with the resulting String.
 void printFormAndWait(java.lang.String data)
          Performs the synchronous print operation.
 void printFormAndWait(java.lang.String aFormatName, Context aContext)
          Instantiates a FormsRecordFormat, given its name, and uses it to format a context.
 void setFormName(java.lang.String aFormName)
          Sets the form name.
 void setPrinterName(java.lang.String aPrinterName)
          Sets the printer name.
 void setServerName(java.lang.String aServerName)
          Sets the serverName.
 void shutdown()
          Shuts down the print service, which means that no more jobs will be printed.
 
Methods inherited from interface com.ibm.dse.base.Notifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, terminate
 

Method Detail

getJobListPrintingResults

public java.util.Vector getJobListPrintingResults()
Returns a list with the information that is available for each of the jobs that have been sent to the printer.
Returns:
java.util.Vector - the list that is requested

getJobResult

public KeyedCollection getJobResult(long jobId)
                             throws DSEJobNotFoundException
Returns a keyed collection with all the available information for a job, given its identifier. If the job ID does not exist, it must throw a DSEJobNotFoundException.
Parameters:
jobId - long, the long that represents the jod ID
Returns:
com.ibm.dse.base.KeyedCollection - the Keyed collection that is requested
Throws:
DSEJobNotFoundException -  

getJobsCurrentlyProcessing

public int getJobsCurrentlyProcessing()
Returns the number of jobs that have not yet been completed.
Returns:
int - the number of jobs that have not yet been completed

getStatus

public int getStatus()
Gives the current status of the printer.
Returns:
int - the value that represents the current status of the printer Possible values are:

ERROR (-1): Printer has not been correctly initialized.

OK (0): Printer has been initialized.

RESET (1): The printer has been shutdown. This is the initial status of the printer.


initialize

public void initialize()
                throws DSEPrinterException
Initializes the printer device. If there is an error while the printer is being initialized, this method throws a DSEPrinterException.
Throws:
DSEPrinterException -  

isJobCompleted

public boolean isJobCompleted(long jobId)
                       throws DSEJobNotFoundException
Answers true if the job with a given ID has already been printed. If the jobId doesn't exist, this method throws a DSEJobNotFoundException.
Parameters:
jobId - long, the long that represents the job ID about which we want to ask
Returns:
boolean - true or false
Throws:
DSEJobNotFoundException -  

printForm

public long printForm(FormsRecordFormat aFormat,
                      Context aContext)
               throws DSEPrinterException,
                      DSEException
Formats a context with a given format of type FormsRecordFormat and then performs the asynchronous print with the resulting String.
Parameters:
aFormat - com.ibm.dse.services.formsprint.FormsRecordFormat, the provided format
aContext - com.ibm.dse.base.Context, the context to be formated
Returns:
long - the identifier of the job that is being sent to the printer
Throws:
DSEPrinterException, - DSEException

printForm

public long printForm(java.lang.String data)
               throws DSEPrinterException
Performs the asynchronous print. Receives the string already formatted for a specific quality printing server, sends it to the server and returns the identifier of the job. If the printer has not been properly initialized, a DSEPrinterException is thrown.
Parameters:
data - java.lang.String, the data that must be sent to the printer device
Returns:
long - the identifier of the job that is being sent to the printer
Throws:
DSEPrinterException -  

printForm

public long printForm(java.lang.String aFormatName,
                      Context aContext)
               throws DSEPrinterException,
                      DSEException,
                      java.io.IOException
Instantiates a FormsRecordFormat, given its name, and uses it to format a context. It then performs the asynchronous print with the resulting String.
Parameters:
aFormatName - java.lang.String, the name of the FormsRecordFormat format to instantiate
aContext - com.ibm.dse.base.Context, the context to be formated
Returns:
long - the identifier of the job that is being sent to the printer
Throws:
DSEPrinterException, - DSEException, IOException

printFormAndWait

public void printFormAndWait(FormsRecordFormat aFormat,
                             Context aContext)
                      throws DSEPrinterException,
                             DSEException
Formats a context with a format of type FormsRecordFormat and then performs the synchronous print with the resulting String.
Parameters:
aFormat - com.ibm.dse.services.formsprint.FormsRecordFormat, the provided format
aContext - com.ibm.dse.base.Context, the context to be formated
Throws:
DSEPrinterException, - DSEException

printFormAndWait

public void printFormAndWait(java.lang.String data)
                      throws DSEPrinterException
Performs the synchronous print operation. Receives the string already formatted for a specific quality printing server and sends it to the server. If the printer has not been initialized or if there is any problem accessing the server, a DSEPrinterException is thrown.
Parameters:
data - java.lang.String, the data that must be sent to the printer device
Throws:
DSEPrinterException -  

printFormAndWait

public void printFormAndWait(java.lang.String aFormatName,
                             Context aContext)
                      throws DSEPrinterException,
                             DSEException,
                             java.io.IOException
Instantiates a FormsRecordFormat, given its name, and uses it to format a context. It then performs the synchronous print with the resulting String.
Parameters:
aFormatName - java.lang.String, the name of the FormsRecordFormat format to instantiate
aContext - com.ibm.dse.base.Context, the context to be formated
Throws:
DSEPrinterException, - com.ibm.dse.base.DSEException, java.io.IOException

setFormName

public void setFormName(java.lang.String aFormName)
Sets the form name.
Parameters:
aFormName - java.lang.String, the compiled form name

setPrinterName

public void setPrinterName(java.lang.String aPrinterName)
Sets the printer name.
Parameters:
aPrinterName - java.lang.String, the resource name of the printer

setServerName

public void setServerName(java.lang.String aServerName)
Sets the serverName.
Parameters:
aServerName - java.lang.String, the hostname of the quality printing server

shutdown

public void shutdown()
Shuts down the print service, which means that no more jobs will be printed.