Interface JposBaseInterface

All Known Subinterfaces:
BeltInterface, BillAcceptorInterface, BillDispenserInterface, BiometricsInterface, BumpBarInterface, CashChangerInterface, CashDrawerInterface, CATInterface, CheckScannerInterface, CoinAcceptorInterface, CoinDispenserInterface, DeviceMonitorInterface, ElectronicJournalInterface, ElectronicValueRWInterface, FiscalPrinterInterface, GateInterface, GestureControlInterface, GraphicDisplayInterface, HardTotalsInterface, ImageScannerInterface, IndividualRecognitionInterface, ItemDispenserInterface, KeylockInterface, LightsInterface, LineDisplayInterface, MICRInterface, MotionSensorInterface, MSRInterface, PINPadInterface, PointCardRWInterface, POSKeyboardInterface, POSPowerInterface, POSPrinterInterface, RemoteOrderDisplayInterface, RFIDScannerInterface, ScaleInterface, ScannerInterface, SignatureCaptureInterface, SmartCardRWInterface, SoundPlayerInterface, SoundRecorderInterface, SpeechSynthesisInterface, ToneIndicatorInterface, VideoCaptureInterface, VoiceRecognitionInterface
All Known Implementing Classes:
BeltProperties, BillAcceptorProperties, BillDispenserProperties, BiometricsProperties, BumpBarProperties, CashChangerProperties, CashDrawer, CashDrawerProperties, CAT, CATProperties, CheckScannerProperties, CoinAcceptorProperties, CoinDispenserProperties, Device.SampleScaleAccessor, DeviceMonitorProperties, ElectronicJournal, ElectronicJournalProperties, ElectronicValueRWProperties, FiscalPrinterProperties, GateProperties, GestureControlProperties, GraphicDisplayProperties, HardTotalsProperties, ImageScannerProperties, IndividualRecognitionProperties, ItemDispenserProperties, JposCommonProperties, Keylock, KeylockProperties, LightsProperties, LineDisplay, LineDisplayProperties, MICR, MICRProperties, MotionSensorProperties, MSR, MSRProperties, PINPadProperties, PointCardRWProperties, POSKeyboard, POSKeyboardProperties, POSPowerProperties, POSPrinter, POSPrinterProperties, RemoteOrderDisplayProperties, RFIDScannerProperties, ScaleProperties, Scanner, ScannerProperties, SignatureCaptureProperties, SmartCardRWProperties, SoundPlayerProperties, SoundRecorderProperties, SpeechSynthesisProperties, ToneIndicator, ToneIndicatorProperties, VideoCaptureProperties, VoiceRecognitionProperties

public interface JposBaseInterface
Interface for methods that implement common property setter and common method calls. Each class that implements this interface must have access to the property set used by the interface function. Since almost always the property set class implements the interface, this is no real restriction.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    asyncMode​(boolean b)
    Final part of setting AsyncMode.
    void
    autoDisable​(boolean b)
    Final part of setting AutoDisable.
    void
    checkHealth​(int level)
    Final part of CheckHealth method.
    void
    claim​(int timeout)
    Final part of setting claim.
    void
    Clear input processing: Clear data event list, clear data event count, set State to idle.
    void
    Clear output processing.
    void
    Final part of close method.
    void
    compareFirmwareVersion​(String firmwareFileName, int[] result)
    Final part of CompareFirmwareVersion method.
    void
    dataEventEnabled​(boolean b)
    Final part of setting DataEventEnabled.
    void
    deviceEnabled​(boolean enable)
    Final part of setting DeviceEnabled.
    directIO​(int command, int[] data, Object object)
    Final or validation part of DirectIO method.
    void
    directIO​(DirectIO request)
    Final part of DirectIO method.
    void
    flagWhenIdle​(boolean b)
    Final part of setting FlagWhenIdle.
    void
    freezeEvents​(boolean freezeEvents)
    Final part of setting FreezeEvents.
    void
    Will be called whenever DeviceEnabled will be set to true if power notification is enabled (PowerNotify = PN_ENABLED).
    Class factory for JposOutputRequests.
    void
    Final part of open method.
    void
    powerNotify​(int powerNotify)
    Final part of setting PowerNotify.
    void
    Final part of release method.
    void
    Removes property set from device specific property set list.
    void
    resetStatistics​(String statisticsBuffer)
    Final part of ResetStatistics method.
    void
    retrieveStatistics​(String[] statisticsBuffer)
    Final part of RetrieveStatistics method.
    void
    Initiates input retrieval.
    void
    Initiates output retrieval.
    int
    Counts enqueued data events of subsystem unit specified by CurrentUnitID.
    void
    Final part of UpdateFirmware method.
    updateFirmware​(String firmwareFileName)
    Final or validation part of UpdateFirmware method.
    void
    updateStatistics​(String statisticsBuffer)
    Final part of UpdateStatistics method.
  • Method Details

    • removeFromPropertySetList

      void removeFromPropertySetList()
      Removes property set from device specific property set list.
    • deviceEnabled

      void deviceEnabled(boolean enable) throws jpos.JposException
      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.
      Parameters:
      enable - True to enable, false to disable
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • freezeEvents

      void freezeEvents(boolean freezeEvents) throws jpos.JposException
      Final part of setting FreezeEvents. Can be overwritten within derived classes, if necessary. Calls processEventList and processDataEventList in addition to setting FreezeEvents. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed.
      Parameters:
      freezeEvents - False to enable, true to disable event delivery
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • powerNotify

      void powerNotify(int powerNotify) throws jpos.JposException
      Final part of setting PowerNotify. 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,
      • Device is not enabled,
      • powerNotify is PN_DISABLED or PN_ENABLED,
      • CapPowerReporting is not PR_NONE or powerNotify is PN_DISABLED.
      If powerNotify equals PN_DISABLED, PowerState will be set to PS_UNKNOWN after this method returns.
      Parameters:
      powerNotify - New property value
      Throws:
      jpos.JposException - If an error occurs while setting the property
    • autoDisable

      void autoDisable(boolean b) throws jpos.JposException
      Final part of setting AutoDisable. 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.
      Parameters:
      b - New property value
      Throws:
      jpos.JposException - If an error occurs while setting the property
    • asyncMode

      void asyncMode(boolean b) throws jpos.JposException
      Final part of setting AsyncMode. Can be overwritten within derived classes. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Parameters:
      b - New property value
      Throws:
      jpos.JposException - If an error occurs while setting the property.
    • dataEventEnabled

      void dataEventEnabled(boolean b) throws jpos.JposException
      Final part of setting DataEventEnabled. Can be overwritten within derived classes. Calls processDataEventList in addition to setting DataEventEnabled This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed.
      Parameters:
      b - New property value
      Throws:
      jpos.JposException - If an error occurs while setting the property DataEventEnabled.
    • flagWhenIdle

      void flagWhenIdle(boolean b) throws jpos.JposException
      Final part of setting FlagWhenIdle. Can be overwritten within derived classes. Setting it to true will be processed only if State is neither S_ERROR nor S_BUSY. Otherwise, a StatusUpdateEvent with the device type specific FlagWhenIdle status value will be generated and FlagWhenIdle remains false. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has been enabled.
      Parameters:
      b - New property value
      Throws:
      jpos.JposException - If an error occurs while setting the property FlagWhenIdle.
    • claim

      void claim(int timeout) throws jpos.JposException
      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.
      Parameters:
      timeout - see UPOS specification, method Claim
      Throws:
      jpos.JposException - If an error occurs while claiming the device
    • close

      void close() throws jpos.JposException
      Final part of close 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 neither enabled nor claimed.
      Throws:
      jpos.JposException - See UPOS specification, method Close
    • checkHealth

      void checkHealth(int level) throws jpos.JposException
      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.
      Parameters:
      level - See UPOS specification, method CheckHealth
      Throws:
      jpos.JposException - See UPOS specification, method CheckHealth
    • directIO

      DirectIO directIO(int command, int[] data, Object object) throws jpos.JposException
      Final or validation part of DirectIO 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:
      • data is an integer array with length 1 or null, if data will not be used in case of the given command.
      All other checks, if necessary, must be implemented within the derived service implementation.
      In case of validation only (asynchronous mode), a DirectIO object created with command, data[0] and object as parameters must be returned.
      Parameters:
      command - See UPOS specification, method DirectIO
      data - See UPOS specification, method DirectIO
      object - See UPOS specification, method DirectIO
      Returns:
      DirectIO object for use in final part or null if method has been performed synchronously.
      Throws:
      jpos.JposException - See UPOS specification, method DirectIO.
    • directIO

      void directIO(DirectIO request) throws jpos.JposException
      Final part of DirectIO method. Can be overwritten within derived classes, if necessary. The parameters of the method will be passed via a DirectIO object. This method will be called when the corresponding operation shall be performed asynchronously. All plausibility checks have been made before, only runtime errors can occur.
      This method will only be called if the validation method threw a JposException with ErrorCode = 0.
      Parameters:
      request - Output request object that contains all parameters to be used by ReadWeight.
      Throws:
      jpos.JposException - If an error occurs.
    • open

      void open() throws jpos.JposException
      Final part of open method. Can be overwritten in derived class, if necessary. sets State property and calls method initOnOpen of object specified by dev. This method will be called whenever the service's open method will be called. All checks, if necessary, must be implemented within the derived service implementation.
      Throws:
      jpos.JposException - See UPOS specification, method Open
    • release

      void release() throws jpos.JposException
      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.
      Throws:
      jpos.JposException - See UPOS specification, method Release
    • clearInput

      void clearInput() throws jpos.JposException
      Clear input processing: Clear data event list, clear data event count, set State to idle. 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.
      Throws:
      jpos.JposException - See UPOS specification, method ClearInput
    • newJposOutputRequest

      JposOutputRequest newJposOutputRequest()
      Class factory for JposOutputRequests.
      Returns:
      A new instance of JposOutputRequest or a derived class.
    • clearOutput

      void clearOutput() throws jpos.JposException
      Clear output processing. Removes all OutputCompleteEvents and ErrorEvents from event queue and sets State to S_IDLE. Clears all outstanding commands of the given property set as well. 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.
      Throws:
      jpos.JposException - See UPOS specification, method ClearOutput
    • compareFirmwareVersion

      void compareFirmwareVersion(String firmwareFileName, int[] result) throws jpos.JposException
      Final part of CompareFirmwareVersion 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,
      • CapCompareFirmwareVersion is true.
      Parameters:
      firmwareFileName - See UPOS specification, method CompareFirmwareVersion.
      result - See UPOS specification, method CompareFirmwareVersion.
      Throws:
      jpos.JposException - See UPOS specification, method CompareFirmwareVersion
    • updateFirmware

      UpdateFirmware updateFirmware(String firmwareFileName) throws jpos.JposException
      Final or validation part of UpdateFirmware 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,
      • CapUpdateFirmware is true.
      In case of successful validation, an UpdateFirmware object created with firmwareFileName as parameters must be returned because updateFirmware will always be performed asynchronously.
      Parameters:
      firmwareFileName - See UPOS specification, method UpdateFirmware
      Returns:
      UpdateFirmware object for use in final part.
      Throws:
      jpos.JposException - See UPOS specification, method UpdateFirmware
    • updateFirmware

      void updateFirmware(UpdateFirmware request) throws jpos.JposException
      Final part of UpdateFirmware method. Can be overwritten within derived classes, if necessary. The parameters of the method will be passed via an UpdateFirmware object. All plausibility checks have been made before, only runtime errors can occur.
      The result of this method will always be provided by the framework via StatusUpdateEvent. Its Status property can be set as follows:
      • If the method ends normally, Status will be SUE_UF_COMPLETE.
      • If the method ends with a JposException with ErrorCodeExtended set to SUE_UF_COMPLETE, SUE_UF_COMPLETE_DEV_NOT_RESTORED, SUE_UF_FAILED_DEV_OK, SUE_UF_FAILED_DEV_UNRECOVERABLE, SUE_UF_FAILED_DEV_NEEDS_FIRMWARE or SUE_UF_FAILED_DEV_UNKNOWN, Status will be set to ErrorCodeExtended.
      • In case of any other exception, Status will be set to the value stored in the Result property of request. The default is SUE_UF_FAILED_DEV_UNKNOWN, but can be changed via method setResult of request.
      Parameters:
      request - Output request object that contains all parameters to be used by ReadWeight.
      Throws:
      jpos.JposException - If an error occurs.
    • resetStatistics

      void resetStatistics(String statisticsBuffer) throws jpos.JposException
      Final part of ResetStatistics 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,
      • CapUpdateStatistics and CapStatisticsReporting are true.
      Parameters:
      statisticsBuffer - See UPOS specification, method ResetStatistics
      Throws:
      jpos.JposException - See UPOS specification, method ResetStatistics
    • retrieveStatistics

      void retrieveStatistics(String[] statisticsBuffer) throws jpos.JposException
      Final part of RetrieveStatistics 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,
      • CapStatisticsReporting are true,
      • statisticsBuffer is not null.
      Parameters:
      statisticsBuffer - See UPOS specification, method RetrieveStatistics
      Throws:
      jpos.JposException - See UPOS specification, method RetrieveStatistics
    • updateStatistics

      void updateStatistics(String statisticsBuffer) throws jpos.JposException
      Final part of UpdateStatistics 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,
      • CapUpdateStatistics and CapStatisticsReporting are true.
      Parameters:
      statisticsBuffer - See UPOS specification, method UpdateStatistics
      Throws:
      jpos.JposException - See UPOS specification, method UpdateStatistics
    • retryInput

      void retryInput() throws jpos.JposException
      Initiates input retrieval. Must be overwritten in devices that support retrying input operation.
      Throws:
      jpos.JposException - Should never be thrown. Instead, the retryInput implementation should generate an ErrorEvent whenever retryInput fails. The application should set ErrorResponse of that ErrorEvent after some unsuccessful retries.
    • retryOutput

      void retryOutput() throws jpos.JposException
      Initiates output retrieval. Must be overwritten in devices that support retrying output operations.
      Throws:
      jpos.JposException - Should never be thrown. Since retryOutput should only re-add the previously suspended requests to the request queue and - if necessary - restart the JposOutputRequest handler, a JposException should not be necessary.
    • handlePowerStateOnEnable

      void handlePowerStateOnEnable() throws jpos.JposException
      Will be called whenever DeviceEnabled will be set to true if power notification is enabled (PowerNotify = PN_ENABLED). Should update the PowerState property. Further processing like firing a StatusUpdateEvent is not necessary, this will be made by the framework automatically.
      Throws:
      jpos.JposException - If an error occurs.
    • unitDataCount

      int unitDataCount()
      Counts enqueued data events of subsystem unit specified by CurrentUnitID.
      Returns:
      Number of enqueued data events from subsystem unit specified by CurrentUnitID.