Class PointCardRWDevice

All Implemented Interfaces:
Runnable

public class PointCardRWDevice extends JposDevice implements Runnable
JposDevice based dummy implementation for JavaPOS PointCardRW device service implementation. No real hardware. All read data with dummy values, operator interaction via OptionDialog boxes.
Supported configuration values for PointCardRW in jpos.xml can be used to set the corresponding property values:
  • CapCardEntranceSensor: Valid values are TRUE and FALSE default is FALSE.
  • CapCleanCard: Valid values are TRUE and FALSE, default is TRUE.
  • CapClearPrint: Valid values are TRUE and FALSE, default is TRUE.
  • CapPrint: Valid values are TRUE and FALSE, default is TRUE.
In addition, the following device specific properties can be set. If different values are specified for multiple instances of PointCardRWDevice, the settings of the instance that had been opened first will be valid for all instances. The other settings will be ignored. The following device specific settings can be configured via jpos.xml:
  • LineCount: Height of printable area of the card, valid only if CapPrint is TRUE. Default is 4.
  • LineLength: Width of printable area of the card, valid only if CapPrint is TRUE. Default is 16.
  • RemovalTimeout: Maximum time for card removal in milliseconds or FOREVER, default 5000.
  • StatusToReadReady: Maximum time in milliseconds to become ready after card entrance sensor detected the card. Only used if CapCardEntranceSensor is TRUE. Default: 500 milliseconds.
  • WriteDuration: Time in milliseconds the simulator needs for printWrite method. Default: 500 milliseconds.
SPECIAL REMARKS: This sample does not implement any really existing PointCardRW system and shall not be used in any really existing cash register application.
  • Constructor Details

    • PointCardRWDevice

      protected PointCardRWDevice(String id)
      The device implementation. See parent for further details.
      Parameters:
      id - Device ID, not used by implementation.
  • Method Details

    • checkProperties

      public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposException
      Description copied from class: JposBaseDevice
      Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value
      Overrides:
      checkProperties in class JposBaseDevice
      Parameters:
      entry - Entry to be checked, contains value to be set
      Throws:
      jpos.JposException - if a property value is invalid
    • changeDefaults

      public void changeDefaults(PointCardRWProperties p)
      Description copied from class: JposDevice
      Change defaults of properties. Must be implemented within derived classed that support point card reader / writer services.
      Overrides:
      changeDefaults in class JposDevice
      Parameters:
      p - Property set for setting the property defaults
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getPointCardRWProperties

      public PointCardRWProperties getPointCardRWProperties(int id)
      Description copied from class: JposDevice
      Returns device implementation of PointCardRWProperties.
      Overrides:
      getPointCardRWProperties in class JposDevice
      Parameters:
      id - Device index, see constructor of JposCommonProperties.
      Returns:
      Instance of PointCardRWProperties that matches the requirements of the corresponding device service.