java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
de.gmxhome.conrad.jpos.jpos_base.pointcardrw.PrintWrite
All Implemented Interfaces:
Runnable

public class PrintWrite extends JposOutputRequest
Output request executor for PointCardRW method PrintWrite.
  • 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

      public String getWriteTrackData(int trackno)
      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.JposException
      Description copied from class: JposOutputRequest
      Invokes the command. Must be implemented in derived class. Calls finished() to wake up potentially waiting threads.
      Overrides:
      invoke in class JposOutputRequest
      Throws:
      jpos.JposException - JposException thrown by the command to be executed.
    • createErrorEvent

      public JposErrorEvent createErrorEvent(jpos.JposException ex)
      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.
      Devices handling asynchronous requests this way, must not buffer more than one request at once. They must end with throwing a StatusUpdateEvent with a specific end-of-request status value instead. This event must be returned by the createIdleEvent method of a device specific class derived from JposOutputRequest.
      Overrides:
      createErrorEvent in class JposOutputRequest
      Parameters:
      ex - JposException which is the originator of an error event.
      Returns:
      The resulting error event.
    • createOutputEvent

      public JposOutputCompleteEvent 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 class JposOutputRequest
      Returns:
      The resulting output complete event or null if no output complete event shall be enqueued.