Class MSR

All Implemented Interfaces:
JposBaseInterface, MSRInterface

public class MSR extends MSRProperties
Class implementing the MSRInterface for the sample combi device. External and interactive Checkhealth might be implemented in a later version.
  • Constructor Details

    • MSR

      public MSR(Device dev)
      Constructor. Gets instance of Device to be used as communication object. Device index for sample is always 0.
      Parameters:
      dev - Instance of Device this object belongs to.
  • Method Details

    • claim

      public void claim(int timeout) throws jpos.JposException
      Description copied from interface: JposBaseInterface
      Final part of setting claim. Can be overwritten within derived classes. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • The device is not claimed,
      • ExclusiveUse dos not equal ExclusiveNo,
      • timeout is negative not equal to FOREVER.
      Specified by:
      claim in interface JposBaseInterface
      Overrides:
      claim in class JposCommonProperties
      Parameters:
      timeout - see UPOS specification, method Claim
      Throws:
      jpos.JposException - If an error occurs while claiming the device
    • release

      public void release() throws jpos.JposException
      Description copied from interface: JposBaseInterface
      Final part of release 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 claimed,
      • ExclusiveUse equals ExclusiveYes: Device is not enabled.
      Specified by:
      release in interface JposBaseInterface
      Overrides:
      release in class JposCommonProperties
      Throws:
      jpos.JposException - See UPOS specification, method Release
    • deviceEnabled

      public void deviceEnabled(boolean enable) throws jpos.JposException
      Description copied from interface: JposBaseInterface
      Final part of setting DeviceEnabled. Can be overwritten within derived classes. Performs initOnEnable method of corresponding property set in addition to setting DeviceEnabled. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • ExclusiveUse equals ExclusiveYes: Device is claimed,
      • DeviceEnabled != enabled.
      Specified by:
      deviceEnabled in interface JposBaseInterface
      Overrides:
      deviceEnabled in class JposCommonProperties
      Parameters:
      enable - True to enable, false to disable
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • checkHealth

      public void checkHealth(int level) throws jpos.JposException
      Description copied from interface: JposBaseInterface
      Final part of CheckHealth method. Can be overwritten in derived class, if necessary. Keep in mind that dvice class specific checks (e.g. check of Claimed or DeviceEnabled) must be done within derived classes. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is neither enabled nor claimed.
      Specified by:
      checkHealth in interface JposBaseInterface
      Overrides:
      checkHealth in class JposCommonProperties
      Parameters:
      level - See UPOS specification, method CheckHealth
      Throws:
      jpos.JposException - See UPOS specification, method CheckHealth
    • setDataProperties

      public void setDataProperties(Object o)
      Description copied from interface: MSRInterface
      Sets data properties according to the track data. This method will be called whenever data properties must be filled before a data event will be fired.
      Specified by:
      setDataProperties in interface MSRInterface
      Overrides:
      setDataProperties in class MSRProperties
      Parameters:
      o - Contents of track data.
    • transmitSentinels

      public void transmitSentinels(boolean transmit) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting TransmitSentinels. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • CapTransmitSentinels is false: The new value is false as well,
      • internal property AllowAlwaysSetProperties is true or flag equals the previous value of TransmitSentinels.
      Specified by:
      transmitSentinels in interface MSRInterface
      Overrides:
      transmitSentinels in class MSRProperties
      Parameters:
      transmit - New TransmitSentinels value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • decodeData

      public void decodeData(boolean decode) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting DecodeData. Can be overwritten within derived classes, if necessary. If set to false, ParseDecodeData will be set to false as well. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • internal property AllowAlwaysSetProperties is true or flag equals the previous value of DecodeData.
      Specified by:
      decodeData in interface MSRInterface
      Overrides:
      decodeData in class MSRProperties
      Parameters:
      decode - New DecodeData value
      Throws:
      jpos.JposException - If an error occurs during enable or disable