Class CashDrawerProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.cashdrawer.CashDrawerProperties
All Implemented Interfaces:
CashDrawerInterface, JposBaseInterface
Direct Known Subclasses:
CashDrawer

public class CashDrawerProperties extends JposCommonProperties implements CashDrawerInterface
Class containing the drawer specific properties, their default values and default implementations of CashDrawerInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Cash Drawer.
  • Field Details

    • CapStatus

      public boolean CapStatus
      UPOS property CapStatus. Default: true. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapStatusMultiDrawerDetect

      public boolean CapStatusMultiDrawerDetect
      UPOS property CapStatusMultiDrawerDetect. Default: true. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • DrawerOpened

      public boolean DrawerOpened
      UPOS property DrawerOpened.
    • DrawerBeepVolume

      public int DrawerBeepVolume
      Volume for drawer beep. Valid values are from 0 to 127. Will be initialized with an Integer object only for CashDrawer devices within jpos.xml. The default is 127 (the maximum volume).
  • Constructor Details

    • CashDrawerProperties

      public CashDrawerProperties(int dev)
      Constructor. Sets ExclusiveUse to ExclusiveAllowed to match the CashDrawer device model.
      Parameters:
      dev - Device index
  • Method Details

    • checkProperties

      public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposException
      Description copied from class: JposCommonProperties
      Checks jpos entries for service specific jpos property values and set corresponding service values.
      Overrides:
      checkProperties in class JposCommonProperties
      Parameters:
      entry - JposEntry instance that contains all jpos properties for the device. Only service specific entries are of interest here, device specific entries should be processed by the corresponding checkProperties method of the device implementation derived from JposDevice.
      Throws:
      jpos.JposException - a service related property is invalid or a mandatory service related property is missing.
    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • openDrawer

      public void openDrawer() throws jpos.JposException
      Description copied from interface: CashDrawerInterface
      Final part of OpenDrawer method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • Device has not been claimed by other instance.
      Specified by:
      openDrawer in interface CashDrawerInterface
      Throws:
      jpos.JposException - If an error occurs.
    • waitForDrawerClose

      public void waitForDrawerClose() throws jpos.JposException
      Description copied from interface: CashDrawerInterface
      Final part of WaitForDrawerClose method. Can be overwritten in derived class, if necessary. Since the CashDrawerService class performs beeping directly via the underlaying standardized sound system via javax.sound, the parameters beepTimeout, beepDuration, beepFrequency and beepDelay will not be forwarded to the final part.
      This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • CapStatus is true,
      • The parameters beepTimeout, beepDuration and beepDelay of the calling method are positive or FOREVER,
      • The parameter beepFrequency is between 10 and 24000.
      since the parameters beepTimeout, beepFrequency, beepDuration and beepDelay will not be passed to this method because sound generation will be performed via the sound system, it must simply wait the drawer state changes to closed and return immediately after that change.
      Keep also in mind that the beep duration should be at least 1/8 seconds (125 milliseconds) to ensure that it can be heard, values above 1/4 second (250 milliseconds) are recommended.
      Specified by:
      waitForDrawerClose in interface CashDrawerInterface
      Throws:
      jpos.JposException - If an error occurs.