IBM Branch Transformation Toolkit Javadoc

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

java.lang.Object
  extended bycom.ibm.dse.base.DSENotifier
      extended bycom.ibm.dse.base.Service
          extended bycom.ibm.dse.services.jxfs.JXFSService
              extended bycom.ibm.dse.services.jxfs.ptr.JXFSPrt
All Implemented Interfaces:
java.util.EventListener, Externalizable, java.io.Externalizable, com.jxfs.general.IJxfsConst, com.jxfs.events.IJxfsIntermediateListener, com.jxfs.events.IJxfsOperationCompleteListener, com.jxfs.control.ptr.IJxfsPrinterConst, com.jxfs.events.IJxfsStatusListener, Notifier, com.jxfs.events.OCPtrReadDataListener, java.io.Serializable

public class JXFSPrt
extends JXFSService
implements com.jxfs.events.OCPtrReadDataListener, com.jxfs.general.IJxfsConst, com.jxfs.control.ptr.IJxfsPrinterConst

This class implements a Service that manages a J/XFS 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, configKey, ids, idSyncs, preOpenTimeout, sdmAddparm, sdmName, syncTimeout, trace, waitMsgTime, workstationName
 
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.OCPtrReadDataListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.general.IJxfsConst
JXFS_ALL, JXFS_ALM_OFFSET, JXFS_CAM_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_HARDWAREERROR, 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_ISO_OFFSET, JXFS_LEVEL_ACTIVE, JXFS_LEVEL_ALL, JXFS_LEVEL_CONFIGURED, JXFS_LEVEL_WORKSTATION, JXFS_LOG_USEROFFSET, 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_EQUAL, OK_NEWER, OK_OLDER, OK_OTHER
 
Fields inherited from interface com.jxfs.control.ptr.IJxfsPrinterConst
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_PAPEROUT, 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_FIELD_INFO, JXFS_O_PTR_FORM_INFO, JXFS_O_PTR_FORM_LIST, JXFS_O_PTR_MEDIA_EXTENTS, JXFS_O_PTR_MEDIA_INFO, JXFS_O_PTR_MEDIA_LIST, 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_DEVICE, 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.events.IJxfsOperationCompleteListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.IJxfsStatusListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
Fields inherited from interface com.jxfs.events.IJxfsIntermediateListener
JXFS_COPYRIGHT, JXFS_VERSION_CONTROL
 
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 J/XFS 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 oCPtrReadDataOccurred(com.jxfs.events.OCPtrReadDataEvent anEvent)
          Receives the read form calls events.
 void operationCompleteOccurred(com.jxfs.events.JxfsOperationCompleteEvent anEvent)
          Receives the operation complete event.
 int printForm(java.lang.String formName, java.lang.String mediaName, JxfsFormat aFormat, Context aContext)
          Makes a printForm call to the J/XFS Device Control.
 int printFormSync(java.lang.String formName, java.lang.String mediaName, JxfsFormat aFormat, Context aContext)
          Makes a printForm call to the J/XFS Device Control.
 int printRawData(byte[] rawData, boolean inputData)
          Makes a printRawData call to the J/XFS Device Control.
 int printRawDataSync(byte[] rawData, boolean inputData)
          Makes a printRawData call to the J/XFS 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 J/XFS Device Control and waits for the OCPtrReadData event.
 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 until the timeout limit in milliseconds is exceeded.
 
Methods inherited from class com.ibm.dse.services.jxfs.JXFSService
cancel, claim, closeSync, finalize, getConfigKey, getDeviceControl, getDeviceManager, getDeviceName, getIniConfigFile, getSdmAddparm, getSdmName, getStatus, getWorkstationName, intermediateOccurred, isAutoOpen, isOpened, isValidURL, openSync, registerListener, release, setAutoOpen, setConfigKey, setDeviceName, setIniConfigFile, setPreOpenTimeout, setSdmAddparm, setSdmName, setSyncTimeout, setWorkstationName, 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
 
Methods inherited from interface com.ibm.dse.base.Externalizable
getName, setName
 

Field Detail

USEALLFIELDS_NEVER

public static final int USEALLFIELDS_NEVER
See Also:
Constant Field Values

USEALLFIELDS_ALWAYS

public static final int USEALLFIELDS_ALWAYS
See Also:
Constant Field Values

USEALLFIELDS_WHENPOSSIBLE

public static final int USEALLFIELDS_WHENPOSSIBLE
See Also:
Constant Field Values
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 J/XFS Device Control and waits for the operation complete event.

Returns:
int - the result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not open

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.

Specified by:
initializeFrom in interface Externalizable
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
DSEException

oCPtrReadDataOccurred

public void oCPtrReadDataOccurred(com.jxfs.events.OCPtrReadDataEvent anEvent)
Receives the read form calls events.

Specified by:
oCPtrReadDataOccurred in interface com.jxfs.events.OCPtrReadDataListener
Parameters:
anEvent - com.jxfs.events.OCPtrReadDataEvent - The OCPtrReadDataEvent event

operationCompleteOccurred

public void operationCompleteOccurred(com.jxfs.events.JxfsOperationCompleteEvent anEvent)
Receives the operation complete event.

Specified by:
operationCompleteOccurred in interface com.jxfs.events.IJxfsOperationCompleteListener
Overrides:
operationCompleteOccurred in class JXFSService
Parameters:
anEvent - com.jxfs.events.OperationCompleteEvent - The OperationCompleteEvent event

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 J/XFS Device Control.

Parameters:
formName - String - The name of the form to print
mediaName - String - The name of the media where printing
Returns:
int - the J/XFS ID of the operation
Throws:
com.jxfs.events.JxfsException - The device is not open
DSEObjectNotFoundException

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 J/XFS Device Control.

Parameters:
formName - String - The name of the form to print
mediaName - String - The name of the media where printing
Returns:
int - the J/XFS ID of the operation
Throws:
com.jxfs.events.JxfsException - The device is not open
DSEObjectNotFoundException

printRawData

public int printRawData(byte[] rawData,
                        boolean inputData)
                 throws com.jxfs.events.JxfsException
Makes a printRawData call to the J/XFS 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 J/XFS ID of the operation
Throws:
com.jxfs.events.JxfsException - The device is not open

printRawDataSync

public int printRawDataSync(byte[] rawData,
                            boolean inputData)
                     throws com.jxfs.events.JxfsException
Makes a printRawData call to the J/XFS 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 result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not open

readFormSync

public int readFormSync(java.lang.String formName,
                        RecordFormat aFormat,
                        Context aContext)
                 throws com.jxfs.events.JxfsException
Makes a readForm call to the J/XFS Device Control and waits for the OCPtrReadData event.

Parameters:
formName - java.lang.String The name of the form to read
Returns:
int - the result of the operation
Throws:
com.jxfs.events.JxfsException - The device is not opened

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 until the timeout limit in milliseconds is exceeded.

Parameters:
timeout - int - Wait time for the function to finish
Returns:
boolean - Returns true if the paper is present or false if there is a timeout
Throws:
com.jxfs.events.JxfsException - The paper status could not be obtained

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005