Class JposErrorEvent

java.lang.Object
java.util.EventObject
jpos.events.JposEvent
jpos.events.ErrorEvent
de.gmxhome.conrad.jpos.jpos_base.JposErrorEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FiscalPrinterErrorEvent, IndividualRecognitionErrorEvent, MICRErrorEvent, MSRErrorEvent, PINPadErrorEvent, PointCardRWErrorEvent, POSPrinterErrorEvent, RFIDScannerErrorEvent, UnitOutputErrorEvent

public class JposErrorEvent extends jpos.events.ErrorEvent
Error event. The default implementation for event handling does not handle instances of ErrorEvent, it handles only instances of JposErrorEvent instead.
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Contains the error message stored in a JposException passed to method createErrorEvent of a JposOutputRequest.

    Fields inherited from class jpos.events.ErrorEvent

    errorCode, errorCodeExtended, errorLocus, errorResponse

    Fields inherited from class jpos.events.JposEvent

    sequenceNumber

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    JposErrorEvent​(JposBase source, int errorcode, int extended, int locus)
    Constructor.
    JposErrorEvent​(JposBase source, int errorcode, int extended, int locus, String message)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all input data or buffered output requests, error and output complete events that belong to this error event.
    Returns an input data event corresponding to the given event.
    Returns property set bound to the event source.
    void
    Sets the error properties stored within the JposErrorEvent into the JposCommonProperties object stored in Source.
    void
    setErrorResponse​(int resp)
    Set ErrorResponse property of the ErrorEvent instance.
    Generates string describing the error event for logging purposes.

    Methods inherited from class jpos.events.ErrorEvent

    getErrorCode, getErrorCodeExtended, getErrorLocus, getErrorResponse

    Methods inherited from class jpos.events.JposEvent

    getSequenceNumber, getWhen, incrSequenceNumber, updateSequenceNumber

    Methods inherited from class java.util.EventObject

    getSource, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • Message

      public final String Message
      Contains the error message stored in a JposException passed to method createErrorEvent of a JposOutputRequest. Contains an empty string as default otherwise.
  • Constructor Details

    • JposErrorEvent

      public JposErrorEvent(JposBase source, int errorcode, int extended, int locus)
      Constructor. Parameters passed to base class unchanged.
      Parameters:
      source - Source, for services implemented with this framework, the (deviceclass.)DeviceClassService object.
      errorcode - ErrorCode, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
      extended - ErrorCodeExtended, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
      locus - ErrorLocus, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
    • JposErrorEvent

      public JposErrorEvent(JposBase source, int errorcode, int extended, int locus, String message)
      Constructor. Parameters passed to base class unchanged.
      Parameters:
      source - Source, for services implemented with this framework, the (deviceclass.)DeviceClassService object.
      errorcode - ErrorCode, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
      extended - ErrorCodeExtended, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
      locus - ErrorLocus, see UPOS specification, chapter Common Properties, Methods, and Events - Events - ErrorEvent.
      message - Error message from exception.
  • Method Details

    • setErrorProperties

      public void setErrorProperties()
      Sets the error properties stored within the JposErrorEvent into the JposCommonProperties object stored in Source. The corresponding properties must be defined within derived classes.
    • toLogString

      public String toLogString()
      Generates string describing the error event for logging purposes.
      Returns:
      Describing string.
    • getPropertySet

      public JposCommonProperties getPropertySet()
      Returns property set bound to the event source.
      Returns:
      Property set.
    • getInputDataErrorEvent

      public JposErrorEvent getInputDataErrorEvent()
      Returns an input data event corresponding to the given event. Will be created automatically within input event handler.
      Returns:
      JposErrorEvent with locus input data.
    • clear

      public void clear()
      Clears all input data or buffered output requests, error and output complete events that belong to this error event. Neither ClearInput nor ClearOutput should throw an exception because both operations should be implemented as internal operations that do not need to throw an exception. However, if an implementation should throw a JposException, it will be caught and ignored.
    • setErrorResponse

      public void setErrorResponse(int resp)
      Set ErrorResponse property of the ErrorEvent instance. Trying to set an invalid value is not allowed and the previous value remains unchanged.
      The following values are valid:
      • ER_CLEAR is always allowed.
      • ER_RETRY is normally allowed if ErrorLocus is EL_OUTPUT.
      • In addition, ER_RETRY is normally allowed if ErrorLocus is EL_INPUT and the delivering control is not one of BumpBar, CheckScanner, ImageScanner, MICR, MSR, PINPad, POSKeyboard, RemoteOrderDisplay, Scanner or SignatureCapture. ER_CONTINUEINPUT is only allowed if ErrorLocus is EL_INPUT_DATA.
      All other values are not allowed.
      Some device services can decide to generate ErrorEvent objects derived from JposErrorEvent where ER_RETRY is not allowed, for example because the device does not allow retries.
      UPOS does not specify what happens
      Overrides:
      setErrorResponse in class jpos.events.ErrorEvent
      Parameters:
      resp - New value for ErrorResponse.