Package de.gmxhome.conrad.jpos.jpos_base
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
FieldsModifier and TypeFieldDescriptionContains 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
ConstructorsConstructorDescriptionJposErrorEvent(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 TypeMethodDescriptionvoid
clear()
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
-
Field Details
-
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
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
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
Generates string describing the error event for logging purposes.- Returns:
- Describing string.
-
getPropertySet
Returns property set bound to the event source.- Returns:
- Property set.
-
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.
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 classjpos.events.ErrorEvent
- Parameters:
resp
- New value for ErrorResponse.
-