com.ibm.dse.services.jxfs.ptr
Class JXFSPrt

java.lang.Object
  |
  +--com.ibm.dse.base.DSENotifier
        |
        +--com.ibm.dse.base.Service
              |
              +--com.ibm.dse.services.jxfs.JXFSService
                    |
                    +--com.ibm.dse.services.jxfs.ptr.JXFSPrt

public class JXFSPrt
extends JXFSService
implements com.jxfs.events.OCPtrFieldInfoListener, com.jxfs.events.OCPtrFormInfoListener, com.jxfs.events.OCPtrFormListListener, com.jxfs.events.OCPtrMediaInfoListener, com.jxfs.events.OCPtrMediaListListener, com.jxfs.events.OCPtrMediaExtentListener, com.jxfs.events.OCPtrRawDataListener, com.jxfs.events.OCPtrReadDataListener, com.jxfs.general.JxfsConst, com.jxfs.control.ptr.JxfsPrinterConst

This class implements a Service that manages a JXFS Printer Device Control.

See Also:
Serialized Form

Field Summary
static int USEALLFIELDS_ALWAYS
           
static int USEALLFIELDS_NEVER
           
static int USEALLFIELDS_WHENPOSSIBLE
           
 
Fields inherited from class com.ibm.dse.services.jxfs.JXFSService
AUTOOPEN_NO, AUTOOPEN_YES, ids, idSyncs, preOpenTimeout, syncTimeout, trace, waitMsgTime
 
Fields inherited from class com.ibm.dse.base.Service
externalizer
 
Fields inherited from class com.ibm.dse.base.DSENotifier
handlersList, name
 
Fields inherited from interface com.jxfs.events.OCPtrFieldInfoListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrFormInfoListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrFormListListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrMediaInfoListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrMediaListListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrMediaExtentListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrRawDataListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.OCPtrReadDataListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.general.JxfsConst
JXFS_ALL, JXFS_ALM_OFFSET, JXFS_CDR_OFFSET, JXFS_CHK_OFFSET, JXFS_COPYRIGHT, JXFS_DEP_OFFSET, JXFS_E_BUSY, JXFS_E_CANCELLED, JXFS_E_CLAIMED, JXFS_E_CLOSED, JXFS_E_DISABLED, JXFS_E_EXISTS, JXFS_E_FAILURE, JXFS_E_FIRMWARE, JXFS_E_ILLEGAL, JXFS_E_IO, JXFS_E_NOCONTROL, JXFS_E_NOEXIST, JXFS_E_NOHARDWARE, JXFS_E_NOSERVICE, JXFS_E_NOT_SUPPORTED, JXFS_E_NOTCLAIMED, JXFS_E_NOTREMOTE, JXFS_E_OFFLINE, JXFS_E_OPEN, JXFS_E_PARAMETER_INVALID, JXFS_E_REMOTE, JXFS_E_SYSTEM, JXFS_E_TIMEOUT, JXFS_E_UNREGISTERED, JXFS_FOREVER, JXFS_LEVEL_ACTIVE, JXFS_LEVEL_ALL, JXFS_LEVEL_CONFIGURED, JXFS_LEVEL_WORKSTATION, JXFS_MSD_OFFSET, JXFS_O_CLOSE, JXFS_O_OPEN, JXFS_O_UPDATEFIRMWARE, JXFS_PIN_OFFSET, JXFS_PTR_OFFSET, JXFS_RC_SUCCESSFUL, JXFS_RC_UNSUCCESSFUL, JXFS_S_BIN_STATUS, JXFS_S_CLAIMED, JXFS_S_HARDWAREERROR, JXFS_S_MEDIA_STATUS, JXFS_S_POWERSAVEOFF, JXFS_S_POWERSAVEON, JXFS_S_RELEASED, JXFS_S_REMOTEFAILURE, JXFS_S_SERVICE_STARTED, JXFS_S_SERVICE_STOPPED, JXFS_S_SHUTDOWN, JXFS_S_USERACTIONERROR, JXFS_S_WORKING, JXFS_SIU_OFFSET, JXFS_TIO_OFFSET, JXFS_VALID_CONTROLID, JXFS_VERSION_CONTROL, JXFSDEVICE_OFFSET, JXFSDIRECTIO_OFFSET, JXFSERR, JXFSERREXT, NO_MATCH, NO_SOURCE, NO_SUPPORT, OK_NEWER, OK_OLDER, OK_OTHER
 
Fields inherited from interface com.jxfs.control.ptr.JxfsPrinterConst
JXFS_COPYRIGHT, JXFS_E_PTR_EXTEND_NOT_SUPPORTED, JXFS_E_PTR_FIELD_ERROR, JXFS_E_PTR_FIELD_GRAPHIC, JXFS_E_PTR_FIELD_HW_ERROR, JXFS_E_PTR_FIELD_INVALID, JXFS_E_PTR_FIELD_NOT_FOUND, JXFS_E_PTR_FIELD_NOT_READ, JXFS_E_PTR_FIELD_NOT_WRITE, JXFS_E_PTR_FIELD_OVERFLOW, JXFS_E_PTR_FIELD_REQUIRED, JXFS_E_PTR_FIELD_SPEC_FAILURE, JXFS_E_PTR_FIELD_STATIC_OVWR, JXFS_E_PTR_FIELD_TYPE_NOT_SUPPORTED, JXFS_E_PTR_FLUSH_FAIL, JXFS_E_PTR_FORM_INVALID, JXFS_E_PTR_FORM_NOT_FOUND, JXFS_E_PTR_MEDIA_INVALID, JXFS_E_PTR_MEDIA_NOT_FOUND, JXFS_E_PTR_MEDIA_OVERFLOW, JXFS_E_PTR_MEDIA_SKEWED, JXFS_E_PTR_MEDIA_TURN_FAIL, JXFS_E_PTR_NO_MEDIA_PRESENT, JXFS_E_PTR_NOFORMS, JXFS_E_PTR_NOMEDIA, JXFS_E_PTR_RETRACT_BIN_FULL, JXFS_I_PTR_MEDIA_INSERTED, JXFS_I_PTR_MEDIA_TAKEN, JXFS_I_PTR_NO_MEDIA_PRESENT, JXFS_O_PTR_ATP_BACKWARD, JXFS_O_PTR_ATP_FORWARD, JXFS_O_PTR_CTRL_MEDIA, JXFS_O_PTR_EJECT_MEDIA, JXFS_O_PTR_MEDIA_EXTENTS, JXFS_O_PTR_PREPARE_EJECT, JXFS_O_PTR_READ_FORM_DATA, JXFS_O_PTR_READ_IMAGE, JXFS_O_PTR_RESET_PRINTER, JXFS_O_PTR_RETRACT_MEDIA, JXFS_O_PTR_TURN_MEDIA, JXFS_O_PTR_WRITE_FORM_DATA, JXFS_O_PTR_WRITE_RAW_DATA, JXFS_PTR_ALN_BOTTOMLEFT, JXFS_PTR_ALN_BOTTOMRIGHT, JXFS_PTR_ALN_TOPLEFT, JXFS_PTR_ALN_TOPRIGHT, JXFS_PTR_ALN_USEFORMDEFN, JXFS_PTR_CTRL_ALARM, JXFS_PTR_CTRL_ATP_BACKWARD, JXFS_PTR_CTRL_ATP_FORWARD, JXFS_PTR_CTRL_CUT, JXFS_PTR_CTRL_EJECT, JXFS_PTR_CTRL_FLUSH, JXFS_PTR_CTRL_PARTIALCUT, JXFS_PTR_CTRL_PERFORATE, JXFS_PTR_CTRL_RETRACT, JXFS_PTR_CTRL_SKIP, JXFS_PTR_CTRL_STACK, JXFS_PTR_CTRL_STAMP, JXFS_PTR_CTRL_TURNMEDIA, JXFS_PTR_EXT_HORIZONTAL, JXFS_PTR_EXT_VERTICAL, JXFS_PTR_FRM_ACCESS_READ, JXFS_PTR_FRM_ACCESS_WRITE, JXFS_PTR_FRM_CLASS_OPTIONAL, JXFS_PTR_FRM_CLASS_REQUIRED, JXFS_PTR_FRM_CLASS_STATIC, JXFS_PTR_FRM_FIELD_BARCODE, JXFS_PTR_FRM_FIELD_GRAPHIC, JXFS_PTR_FRM_FIELD_MICR, JXFS_PTR_FRM_FIELD_MSF, JXFS_PTR_FRM_FIELD_OCR, JXFS_PTR_FRM_FIELD_PAGEMARK, JXFS_PTR_FRM_FIELD_TEXT, JXFS_PTR_FRM_FOLD_HORIZONTAL, JXFS_PTR_FRM_FOLD_NONE, JXFS_PTR_FRM_FOLD_VERTICAL, JXFS_PTR_FRM_INCH, JXFS_PTR_FRM_LANDSCAPE, JXFS_PTR_FRM_MEDIA_GENERIC, JXFS_PTR_FRM_MEDIA_MULTIPART, JXFS_PTR_FRM_MEDIA_PASSBOOK, JXFS_PTR_FRM_MM, JXFS_PTR_FRM_OVF_BEST_FIT, JXFS_PTR_FRM_OVF_OVERWRITE, JXFS_PTR_FRM_OVF_TERMINATE, JXFS_PTR_FRM_OVF_TRUNCATE, JXFS_PTR_FRM_OVF_WORDWRAP, JXFS_PTR_FRM_PORTRAIT, JXFS_PTR_FRM_ROWCOLUMN, JXFS_PTR_IMAGE_BMP, JXFS_PTR_IMAGE_MTF, JXFS_PTR_IMAGE_TIF, JXFS_PTR_OFFSET_USEFORMDEFN, JXFS_PTR_READ_BARCODE, JXFS_PTR_READ_IMAGE, JXFS_PTR_READ_MICR, JXFS_PTR_READ_MSF, JXFS_PTR_READ_OCR, JXFS_PTR_READ_PAGEMARK, JXFS_PTR_READ_TEXT, JXFS_PTR_WRITE_BARCODE, JXFS_PTR_WRITE_GRAPHICS, JXFS_PTR_WRITE_MICR, JXFS_PTR_WRITE_MSF, JXFS_PTR_WRITE_OCR, JXFS_PTR_WRITE_TEXT, JXFS_S_BIN_EMPTY, JXFS_S_BIN_FULL, JXFS_S_BIN_HIGH, JXFS_S_BIN_LOW, JXFS_S_BIN_NOTSUPPORTED, JXFS_S_BIN_OK, JXFS_S_BIN_UNKNOWN, JXFS_S_MEDIA_EJECTED, JXFS_S_MEDIA_JAMMED, JXFS_S_MEDIA_NOTSUPPORTED, JXFS_S_MEDIA_UNKNOWN, JXFS_S_PTR_INK, JXFS_S_PTR_LAMP, JXFS_S_PTR_LAMP_FADING, JXFS_S_PTR_LAMP_INOP, JXFS_S_PTR_LAMP_NOTSUPP, JXFS_S_PTR_LAMP_OK, JXFS_S_PTR_LAMP_UNKNOWN, JXFS_S_PTR_MEDIA, JXFS_S_PTR_PAPER, JXFS_S_PTR_RETRACT_BIN, JXFS_S_PTR_RETRACTCOUNT, JXFS_S_PTR_TONER, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.general.JxfsConst
JXFS_ALL, JXFS_ALM_OFFSET, JXFS_CDR_OFFSET, JXFS_CHK_OFFSET, JXFS_COPYRIGHT, JXFS_DEP_OFFSET, JXFS_E_BUSY, JXFS_E_CANCELLED, JXFS_E_CLAIMED, JXFS_E_CLOSED, JXFS_E_DISABLED, JXFS_E_EXISTS, JXFS_E_FAILURE, JXFS_E_FIRMWARE, JXFS_E_ILLEGAL, JXFS_E_IO, JXFS_E_NOCONTROL, JXFS_E_NOEXIST, JXFS_E_NOHARDWARE, JXFS_E_NOSERVICE, JXFS_E_NOT_SUPPORTED, JXFS_E_NOTCLAIMED, JXFS_E_NOTREMOTE, JXFS_E_OFFLINE, JXFS_E_OPEN, JXFS_E_PARAMETER_INVALID, JXFS_E_REMOTE, JXFS_E_SYSTEM, JXFS_E_TIMEOUT, JXFS_E_UNREGISTERED, JXFS_FOREVER, JXFS_LEVEL_ACTIVE, JXFS_LEVEL_ALL, JXFS_LEVEL_CONFIGURED, JXFS_LEVEL_WORKSTATION, JXFS_MSD_OFFSET, JXFS_O_CLOSE, JXFS_O_OPEN, JXFS_O_UPDATEFIRMWARE, JXFS_PIN_OFFSET, JXFS_PTR_OFFSET, JXFS_RC_SUCCESSFUL, JXFS_RC_UNSUCCESSFUL, JXFS_S_BIN_STATUS, JXFS_S_CLAIMED, JXFS_S_HARDWAREERROR, JXFS_S_MEDIA_STATUS, JXFS_S_POWERSAVEOFF, JXFS_S_POWERSAVEON, JXFS_S_RELEASED, JXFS_S_REMOTEFAILURE, JXFS_S_SERVICE_STARTED, JXFS_S_SERVICE_STOPPED, JXFS_S_SHUTDOWN, JXFS_S_USERACTIONERROR, JXFS_S_WORKING, JXFS_SIU_OFFSET, JXFS_TIO_OFFSET, JXFS_VALID_CONTROLID, JXFS_VERSION_CONTROL, JXFSDEVICE_OFFSET, JXFSDIRECTIO_OFFSET, JXFSERR, JXFSERREXT, NO_MATCH, NO_SOURCE, NO_SUPPORT, OK_NEWER, OK_OLDER, OK_OTHER
 
Constructor Summary
JXFSPrt()
          This constructor creates a JXFSPrt object.
JXFSPrt(java.lang.String aName)
          This constructor creates a JXFSPrt object.
 
Method Summary
 int ejectSync()
          Makes an eject call to the jxfs device control and waits for the operation complete event
 int getUseAllFields()
          Returns the value of the useAllFileds property.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a JXFSPrt object with the aTag attributes.
 void oCPtrFieldInfoOccurred(com.jxfs.events.OCPtrFieldInfoEvent anEvent)
           
 void oCPtrFormInfoOccurred(com.jxfs.events.OCPtrFormInfoEvent anEvent)
           
 void oCPtrFormListOccurred(com.jxfs.events.OCPtrFormListEvent anEvent)
           
 void oCPtrMediaExtentOccurred(com.jxfs.events.OCPtrMediaExtentEvent anEvent)
           
 void oCPtrMediaInfoOccurred(com.jxfs.events.OCPtrMediaInfoEvent anEvent)
           
 void oCPtrMediaListOccurred(com.jxfs.events.OCPtrMediaListEvent anEvent)
           
 void oCPtrRawDataOccurred(com.jxfs.events.OCPtrRawDataEvent anEvent)
           
 void oCPtrReadDataOccurred(com.jxfs.events.OCPtrReadDataEvent anEvent)
           
 int printForm(java.lang.String formName, java.lang.String mediaName, JxfsFormat aFormat, Context aContext)
          Makes a printForm call to the jxfs device control
 int printFormSync(java.lang.String formName, java.lang.String mediaName, JxfsFormat aFormat, Context aContext)
          Makes a printForm call to the jxfs device control
 int printRawData(byte[] rawData, boolean inputData)
          Makes a printRawData call to the jxfs device control
 int printRawDataSync(byte[] rawData, boolean inputData)
          Makes a printRawData call to the jxfs device control and waits for the operation complete event
 int readFormSync(java.lang.String formName, RecordFormat aFormat, Context aContext)
          Makes a readForm call to the jxfs device control and waits for the OCPtrReadData event
protected  void registerListener()
          Registers the service as listener of the JXFS device control events It will capture the events and transform to WSCB events
 void setUseAllFields(int newValue)
          Sets the value of the useallFileds property.
 boolean waitForPaper(long timeout)
          Waits for the paper to be present in the device, with a timeout miliseconds limit
 
Methods inherited from class com.ibm.dse.services.jxfs.JXFSService
cancel, claim, closeSync, finalize, getDeviceControl, getDeviceName, getIniConfigFile, getStatus, intermediateOccurred, isAutoOpen, isOpened, openSync, operationCompleteOccurred, release, setAutoOpen, setDeviceName, setIniConfigFile, statusOccurred, terminate, toString, waitForID, waitOpen
 
Methods inherited from class com.ibm.dse.base.Service
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.dse.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USEALLFIELDS_NEVER

public static final int USEALLFIELDS_NEVER

USEALLFIELDS_ALWAYS

public static final int USEALLFIELDS_ALWAYS

USEALLFIELDS_WHENPOSSIBLE

public static final int USEALLFIELDS_WHENPOSSIBLE
Constructor Detail

JXFSPrt

public JXFSPrt()
This constructor creates a JXFSPrt object.

JXFSPrt

public JXFSPrt(java.lang.String aName)
        throws java.io.IOException
This constructor creates a JXFSPrt object.
Parameters:
aName - java.lang.String
Throws:
java.io.IOException - The object cannot be created
Method Detail

ejectSync

public int ejectSync()
              throws com.jxfs.events.JxfsException
Makes an eject call to the jxfs device control and waits for the operation complete event
Returns:
int - the jxfs result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

getUseAllFields

public int getUseAllFields()
Returns the value of the useAllFileds property.
Returns:
int - The current value of useAllFields.

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Initializes a JXFSPrt object with the aTag attributes.
Overrides:
initializeFrom in class JXFSService
Parameters:
aTag - com.ibm.dse.base.Tag Contains the name and attributes of the object to be created.
Returns:
Object - An instance of JXFSPrt.
Throws:
java.io.IOException - The object can not be created.

oCPtrFieldInfoOccurred

public void oCPtrFieldInfoOccurred(com.jxfs.events.OCPtrFieldInfoEvent anEvent)
Specified by:
oCPtrFieldInfoOccurred in interface com.jxfs.events.OCPtrFieldInfoListener

oCPtrFormInfoOccurred

public void oCPtrFormInfoOccurred(com.jxfs.events.OCPtrFormInfoEvent anEvent)
Specified by:
oCPtrFormInfoOccurred in interface com.jxfs.events.OCPtrFormInfoListener

oCPtrFormListOccurred

public void oCPtrFormListOccurred(com.jxfs.events.OCPtrFormListEvent anEvent)
Specified by:
oCPtrFormListOccurred in interface com.jxfs.events.OCPtrFormListListener

oCPtrMediaExtentOccurred

public void oCPtrMediaExtentOccurred(com.jxfs.events.OCPtrMediaExtentEvent anEvent)
Specified by:
oCPtrMediaExtentOccurred in interface com.jxfs.events.OCPtrMediaExtentListener

oCPtrMediaInfoOccurred

public void oCPtrMediaInfoOccurred(com.jxfs.events.OCPtrMediaInfoEvent anEvent)
Specified by:
oCPtrMediaInfoOccurred in interface com.jxfs.events.OCPtrMediaInfoListener

oCPtrMediaListOccurred

public void oCPtrMediaListOccurred(com.jxfs.events.OCPtrMediaListEvent anEvent)
Specified by:
oCPtrMediaListOccurred in interface com.jxfs.events.OCPtrMediaListListener

oCPtrRawDataOccurred

public void oCPtrRawDataOccurred(com.jxfs.events.OCPtrRawDataEvent anEvent)
Specified by:
oCPtrRawDataOccurred in interface com.jxfs.events.OCPtrRawDataListener

oCPtrReadDataOccurred

public void oCPtrReadDataOccurred(com.jxfs.events.OCPtrReadDataEvent anEvent)
Specified by:
oCPtrReadDataOccurred in interface com.jxfs.events.OCPtrReadDataListener

printForm

public int printForm(java.lang.String formName,
                     java.lang.String mediaName,
                     JxfsFormat aFormat,
                     Context aContext)
              throws com.jxfs.events.JxfsException,
                     DSEObjectNotFoundException
Makes a printForm call to the jxfs device control
Parameters:
formName - String The name of the form to print
mediaName - String The name of the media where printing
format - JxfsFormat The format to get the fields to print
context - Context The context where the formatting is done
Returns:
int - the jxfs identificationId of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

printFormSync

public int printFormSync(java.lang.String formName,
                         java.lang.String mediaName,
                         JxfsFormat aFormat,
                         Context aContext)
                  throws com.jxfs.events.JxfsException,
                         DSEObjectNotFoundException
Makes a printForm call to the jxfs device control
Parameters:
formName - String The name of the form to print
mediaName - String The name of the media where printing
format - JxfsFormat The format to get the fields to print
context - Context The context where the formatting is done
Returns:
int - the jxfs identificationId of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

printRawData

public int printRawData(byte[] rawData,
                        boolean inputData)
                 throws com.jxfs.events.JxfsException
Makes a printRawData call to the jxfs device control
Parameters:
rawData - byte[] The raw data to send to the printer
inputData - boolean The indicator about input data expected from the printer
Returns:
int - the jxfs identificationId of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

printRawDataSync

public int printRawDataSync(byte[] rawData,
                            boolean inputData)
                     throws com.jxfs.events.JxfsException
Makes a printRawData call to the jxfs device control and waits for the operation complete event
Parameters:
rawData - byte[] The raw data to send to the printer
inputData - boolean The indicator about input data expected from the printer
Returns:
int - the jxfs result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

readFormSync

public int readFormSync(java.lang.String formName,
                        RecordFormat aFormat,
                        Context aContext)
                 throws com.jxfs.events.JxfsException
Makes a readForm call to the jxfs device control and waits for the OCPtrReadData event
Parameters:
formName - java.lang.String The name of the form to read
format - com.ibm.dse.base.RecordFormat The format to unformat the fields in the context
context - com.ibm.dse.base.Context The context where the unformatting is done
Returns:
int - the jxfs result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

registerListener

protected void registerListener()
Registers the service as listener of the JXFS device control events It will capture the events and transform to WSCB events
Overrides:
registerListener in class JXFSService

setUseAllFields

public void setUseAllFields(int newValue)
Sets the value of the useallFileds property.
Parameters:
newValue - int The new value of the useallFileds property.

waitForPaper

public boolean waitForPaper(long timeout)
                     throws com.jxfs.events.JxfsException
Waits for the paper to be present in the device, with a timeout miliseconds limit
Parameters:
timeout - int time to wait for the function to finish
Returns:
boolean - true if the paper is present or false if there is timeout
Throws:
com.jxfs.events.JxfsException - The paper status could not be obtained