com.ibm.eNetwork.ECL.event Class ECLPrintJobEvent

  PREV CLASS     NEXT CLASS FRAMES     NO FRAMES
SUMMARY:  INNER |  FIELD |  CONSTR |  METHOD DETAIL:   FIELD |  CONSTR |  METHOD


java.lang.Object
  |
  +--
com.ibm.eNetwork.ECL.event.ECLEvent
        |
        +--
com.ibm.eNetwork.ECL.event.ECLPrintJobEvent

      
public class ECLPrintJobEvent
extends ECLEvent

ECLHostPrintSession fires ECLPrintJobEvents to notify interested listeners about a current print job.

There are several event types that correlate to the nature of a print job state change or an error condition occurrence. Some event types contain additional information.

1. Startup

When a ECLHostPrintSession establishes a printer session, it fires an ECLPrintJobEvent of type

EHPE_PRINT_JOB_PRINTER_READY

.

2. Printing a Job

A print job has three stages: Start, Data, End.

  • 2-1. Job Start

    READY : If a printer was opened successfully, ECLHostPrintSession fires a ECLPrintJobEvent of type EHPE_PRINT_JOB_STARTED.

    BUSY : If a busy condition is detected while opening the printer, ECLHostPrintSession will fire an ECLPrintJobEvent. The type is two values ORed together:

    ( EHPE_PRINT_JOB_PRINTER_BUSY | EHPE_PRINT_JOB_PRINTER_INUSE )

    There is no need for a response. When the busy condition is cleared, the print job will be started.

    ERROR : If an error occurred when opening the printer, ECLHostPrintSession will fire an ECLPrintJobEvent of type EHPE_PRINT_JOB_ERROR. The event code can be obtained ( getEventCode() ). This may contain additional information:

    • EHPE_PRINT_JOB_NO_CODE
    • EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUND - the specified Windows printer was not found **
    • EHPE_PRINT_JOB_ERROR_PRINTER_NONE_INSTALLED - no Windows printer is installed on the system ** [ ** This event type will only be fired for a ECLHostPrintSession having the property-value pair: SESSION_USE_WINDOWS_PRINTER, SESSION_ON]

    See Section 3, Processing an error, for more programming information.

  • 2-2. Job Data

    While print job data is being process by the ECLHostPrintSession, one or more ECLPrintJobEvent will be fired. The type is two values ORed together:

    ( EHPE_PRINT_JOB_PRINTER_BUSY | EHPE_PRINT_JOB_STATUS_UPDATE )

    3270 Printer Session: the event code ( getEventCode() ) represents page number. 5250 Printer Session: the event code has no meaning.

    This event type contains additional information( getEventExtraInformation() ). It is a String that represents the print destination.

    If an error occurs while ECLHostPrintSession is processing print job data, it will fire an ECLHostPrintEvent of type EHPE_PRINT_JOB_ERROR. See Section 3, Processing an error, for more programming information.

  • 2-3. Job End

    When ECLHostPrintSession closes the print job, it fires an ECLHostPrintEvent. The type is two values ORed together:

    ( EHPE_PRINT_JOB_COMPLETED | EHPE_PRINT_JOB_READY )

3. Processing an error

When an error occurs, the ECLHostPrintSession fires an ECLHostPrintEvent of type

EHPE_PRINT_JOB_ERROR

. It then waits for a response that should be sent to it via

ECLPS.SendKey(...)

. There is no timeout while ECLHostPrintSession is waiting for a response.

The following is the list of possible SendKeys(String) responses:

  • Cancel Print Job:

    <ECLHostPrintSession>.GetPS().SendKeys(ECLSession.CANCELPJOB_STR)

    When ECLHostPrintSession receives this keystroke, it cancels the outstanding print job and fires an ECLPrintJobEvent. The type is two values ORed together:

    ( EHPE_PRINT_JOB_READY | EHPE_PRINT_JOB_CANCELING )

  • Retry Print Job:

    <ECLHostPrintSession>.GetPS().SendKeys(ECLSession.RETRYPRT_STR)

    When ECLHostPrintSession receives this keystroke, it fires an ECLPrintJobEvent of type EHPE_PRINT_JOB_READY in response. The host program should be designed to interpret the sequence EHPE_PRINT_JOB_ERROR--"[retryprint]"--- EHPE_PRINT_JOB_READY to mean "send the last print datum again". The host program should then send the record again.

    The timing of the firing of the EHPE_PRINT_JOB_READY event differs slightly according to host type:

    • 3270 :

      If the error condition occurred at the end of a record, i.e. an EOR was already received for that record, ECLHostPrintSession fires the event immediately.

      If the error condition occurred in the middle of a record, the ECLHostPrintSession will wait until receipt of the next EOR before firing the EHPE_PRINT_JOB_READY event..

    • 5250 :

      ECLHostPrintSession fires the event immediately always.

  • Continue Print Job:

    <ECLHostPrintSession>.GetPS().SendKeys(ECLSession.CONTINUEPJOB_STR)

    When ECLHostPrintSession receives this keystroke, it ignores the print job error condition and continues to process the print job. No ECLPrintJobEvent is fired in acknowledgement of this keystroke.

4. Termination

When an ECLHostPrintSessio is terminated, no ECLPrintJobEvent is fired.

See Also:
ECLHostPrintSession.addPrintJobListener(com.ibm.eNetwork.ECL.event.ECLPrintJobListener) , ECLPrintJobListener

Field Summary
static int EHPE_PRINT_JOB_COMPLETED            
static int EHPE_PRINT_JOB_ERROR            
static int EHPE_PRINT_JOB_ERROR_INTERV_FILE            
static int EHPE_PRINT_JOB_ERROR_INTERV_LPT            
static int EHPE_PRINT_JOB_ERROR_INTERV_PRINTER            
static int EHPE_PRINT_JOB_ERROR_INTERV_REQUIRED            
static int EHPE_PRINT_JOB_ERROR_PDT_NOTFOUND            
static int EHPE_PRINT_JOB_ERROR_PRINTER_CHANGETODEFAULT            
static int EHPE_PRINT_JOB_ERROR_PRINTER_NONE_INSTALLED            
static int EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUND            
static int EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUNDANDLOCKED            
static int EHPE_PRINT_JOB_ERROR_PRINTER_PAPEROUT            
static int EHPE_PRINT_JOB_ERROR_PRINTER_TIMEDOUT            
static int EHPE_PRINT_JOB_NO_CODE            
static int EHPE_PRINT_JOB_PRINTER_BUSY            
static int EHPE_PRINT_JOB_PRINTER_CANCELING            
static int EHPE_PRINT_JOB_PRINTER_INUSE            
static int EHPE_PRINT_JOB_PRINTER_READY            
static int EHPE_PRINT_JOB_STARTED            
static int EHPE_PRINT_JOB_STATUS_UPDATE            
static int EHPE_PRINT_JOB_TEST_PAGE_ERROR            

 

Constructor Summary
ECLPrintJobEvent (java.lang.Object source, int type)           This is an alternate constructor used to create an ECLPrintJobEvent object.
ECLPrintJobEvent (java.lang.Object source, int type, int code, java.lang.String extraInformation)           This is the main constructor used to create an ECLPrintJobEvent object.

 

Method Summary
 int getEvent ()           This method returns the type of the event object.
 int getEventCode ()           This method returns detailed information for the event object.
 java.lang.String getEventExtraInformation ()           This method returns additional details about the event.

 

Methods inherited from class com.ibm.eNetwork.ECL.event. ECLEvent
GetSource, toString

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

EHPE_PRINT_JOB_STARTED



public static final int 
EHPE_PRINT_JOB_STARTED

         

EHPE_PRINT_JOB_COMPLETED



public static final int 
EHPE_PRINT_JOB_COMPLETED

         

EHPE_PRINT_JOB_ERROR



public static final int 
EHPE_PRINT_JOB_ERROR

         

EHPE_PRINT_JOB_PRINTER_READY



public static final int 
EHPE_PRINT_JOB_PRINTER_READY

         

EHPE_PRINT_JOB_PRINTER_BUSY



public static final int 
EHPE_PRINT_JOB_PRINTER_BUSY

         

EHPE_PRINT_JOB_PRINTER_INUSE



public static final int 
EHPE_PRINT_JOB_PRINTER_INUSE

         

EHPE_PRINT_JOB_PRINTER_CANCELING



public static final int 
EHPE_PRINT_JOB_PRINTER_CANCELING

         

EHPE_PRINT_JOB_STATUS_UPDATE



public static final int 
EHPE_PRINT_JOB_STATUS_UPDATE

         

EHPE_PRINT_JOB_NO_CODE



public static final int 
EHPE_PRINT_JOB_NO_CODE

         

EHPE_PRINT_JOB_ERROR_INTERV_REQUIRED



public static final int 
EHPE_PRINT_JOB_ERROR_INTERV_REQUIRED

         

EHPE_PRINT_JOB_ERROR_INTERV_PRINTER



public static final int 
EHPE_PRINT_JOB_ERROR_INTERV_PRINTER

         

EHPE_PRINT_JOB_ERROR_INTERV_FILE



public static final int 
EHPE_PRINT_JOB_ERROR_INTERV_FILE

         

EHPE_PRINT_JOB_ERROR_INTERV_LPT



public static final int 
EHPE_PRINT_JOB_ERROR_INTERV_LPT

         

EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUND



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUND

         

EHPE_PRINT_JOB_ERROR_PRINTER_NONE_INSTALLED



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_NONE_INSTALLED

         

EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUNDANDLOCKED



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_NOTFOUNDANDLOCKED

         

EHPE_PRINT_JOB_ERROR_PRINTER_CHANGETODEFAULT



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_CHANGETODEFAULT

         

EHPE_PRINT_JOB_ERROR_PRINTER_PAPEROUT



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_PAPEROUT

         

EHPE_PRINT_JOB_ERROR_PRINTER_TIMEDOUT



public static final int 
EHPE_PRINT_JOB_ERROR_PRINTER_TIMEDOUT

         

EHPE_PRINT_JOB_ERROR_PDT_NOTFOUND



public static final int 
EHPE_PRINT_JOB_ERROR_PDT_NOTFOUND

         

EHPE_PRINT_JOB_TEST_PAGE_ERROR



public static final int 
EHPE_PRINT_JOB_TEST_PAGE_ERROR

         

Constructor Detail

ECLPrintJobEvent



public 
ECLPrintJobEvent(java.lang.Object source,
                        int type,
                        int code,
                        java.lang.String extraInformation)

ECLPrintJobEvent



public 
ECLPrintJobEvent(java.lang.Object source,
                        int type)

Method Detail

getEvent



public int 
getEvent()

getEventCode



public int 
getEventCode()

getEventExtraInformation



public java.lang.String 
getEventExtraInformation()

  PREV CLASS     NEXT CLASS FRAMES     NO FRAMES
SUMMARY:  INNER |  FIELD |  CONSTR |  METHOD DETAIL:   FIELD |  CONSTR |  METHOD