Class PrintWrite
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
de.gmxhome.conrad.jpos.jpos_base.pointcardrw.PrintWrite
- All Implemented Interfaces:
Runnable
Output request executor for PointCardRW method PrintWrite.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
JposOutputRequest.JposRequestThread
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
Abort, AdditionalData, Device, EndSync, Exception, Finished, OutputID, Props, Waiting
-
Constructor Summary
ConstructorsConstructorDescriptionPrintWrite(PointCardRWProperties props, int kind, int hposition, int vposition, String data)
Constructor.PrintWrite(PointCardRWProperties props, int kind, int hposition, int vposition, List<PointCardRWService.PrintDataPart> data)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateErrorEvent(jpos.JposException ex)
Factory for error events generated from JposExceptions.Factory for output complete events.getData()
PointCardRW method PrintWrite parameter data, converted to a List<Object> with PointCardRWService method outputDataParts.int
PointCardRW method PrintWrite parameter hposition, see UPOS specification.int
getKind()
PointCardRW method PrintWrite parameter kind, see UPOS specification.int
Get PointCardRW property TracksToWrite contents when method PrintWrite has been invoked.int
PointCardRW method PrintWrite parameter vposition, see UPOS specification.getWriteTrackData(int trackno)
Get PointCardRW property WritetracknoData (1 ≤ trackno ≤ 6) contents when the method PrintWrite has been invoked.void
invoke()
Invokes the command.void
setWriteState(int track, int value)
Sets WriteStates, one value per track, must be set during write track operations.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
abortCommand, abortCommand, catchedInvocation, clearAll, clearInput, clearOutput, countCommands, createIdleEvent, dequeue, enqueue, enqueueSynchronous, finishAsyncProcessing, finished, reactivate, reactivate, reset, run
-
Constructor Details
-
PrintWrite
public PrintWrite(PointCardRWProperties props, int kind, int hposition, int vposition, String data)Constructor. Stores given parameters for later use.- Parameters:
props
- Property set of device service.kind
- Parts of the point card that will be written or printed. See UPOS specification.hposition
- The horizontal start position for printing.vposition
- The vertical start position for printing.data
- Print data.
-
PrintWrite
public PrintWrite(PointCardRWProperties props, int kind, int hposition, int vposition, List<PointCardRWService.PrintDataPart> data)Constructor. Stores given parameters for later use.- Parameters:
props
- Property set of device service.kind
- Parts of the point card that will be written or printed. See UPOS specification.hposition
- The horizontal start position for printing.vposition
- The vertical start position for printing.data
- Print data.
-
-
Method Details
-
getKind
public int getKind()PointCardRW method PrintWrite parameter kind, see UPOS specification.- Returns:
- PrintWrite parameter kind.
-
getHPosition
public int getHPosition()PointCardRW method PrintWrite parameter hposition, see UPOS specification.- Returns:
- PrintWrite parameter hposition.
-
getVPosition
public int getVPosition()PointCardRW method PrintWrite parameter vposition, see UPOS specification.- Returns:
- PrintWrite parameter vposition.
-
getWriteTrackData
Get PointCardRW property WritetracknoData (1 ≤ trackno ≤ 6) contents when the method PrintWrite has been invoked.- Parameters:
trackno
- Track number.- Returns:
- Contents of WritetracknoDate property at the time when WriteData has been called from application.
-
getTracksToWrite
public int getTracksToWrite()Get PointCardRW property TracksToWrite contents when method PrintWrite has been invoked.- Returns:
- Contents of TracksToWrite property at the time when WriteData has been called from application.
-
getData
PointCardRW method PrintWrite parameter data, converted to a List<Object> with PointCardRWService method outputDataParts.- Returns:
- List<Object> containing parsed print data contained in PrintWrite parameter data.
-
setWriteState
public void setWriteState(int track, int value)Sets WriteStates, one value per track, must be set during write track operations. Will be used to set WriteState properties of property set either via OutputCompleteEvent or ErrorEvent.- Parameters:
track
- Track of status, must be between 1 and 6.value
- Status value for the specified track, should be one of the predefined values.
-
invoke
public void invoke() throws jpos.JposExceptionDescription copied from class:JposOutputRequest
Invokes the command. Must be implemented in derived class. Calls finished() to wake up potentially waiting threads.- Overrides:
invoke
in classJposOutputRequest
- Throws:
jpos.JposException
- JposException thrown by the command to be executed.
-
createErrorEvent
Description copied from class:JposOutputRequest
Factory for error events generated from JposExceptions. Must be overwritten whenever a device specific error event shall be created. For example, in case of cash printer methods, this method should return a POSPrinterErrorEvent (which is an object derived from JposErrorEvent) that contains additional values to be stored in printer properties before the event will be fired.
If a device supports result code properties instead of error events, this method must return null. The result codes should be buffered for a later call of the createIdleEvent method which must create a device specific StatusUpdateEvent which contains the buffered values.
If null will be returned instead of a JposErrorEvent, it will enforce special request handling instead:- Instead of suspending the request, it will be finished.
- The idle flag will be set.
- Overrides:
createErrorEvent
in classJposOutputRequest
- Parameters:
ex
- JposException which is the originator of an error event.- Returns:
- The resulting error event.
-
createOutputEvent
Description copied from class:JposOutputRequest
Factory for output complete events. Must be overwritten whenever a device specific output complete event shall be created.- Overrides:
createOutputEvent
in classJposOutputRequest
- Returns:
- The resulting output complete event or null if no output complete event shall be enqueued.
-