Package de.gmxhome.conrad.jpos.jpos_base
Class JposCommonProperties
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
- All Implemented Interfaces:
JposBaseInterface
- Direct Known Subclasses:
BeltProperties,BillAcceptorProperties,BillDispenserProperties,BiometricsProperties,BumpBarProperties,CashChangerProperties,CashDrawerProperties,CATProperties,CheckScannerProperties,CoinAcceptorProperties,CoinDispenserProperties,DeviceMonitorProperties,ElectronicJournalProperties,ElectronicValueRWProperties,FiscalPrinterProperties,GateProperties,GestureControlProperties,GraphicDisplayProperties,HardTotalsProperties,ImageScannerProperties,IndividualRecognitionProperties,ItemDispenserProperties,KeylockProperties,LightsProperties,LineDisplayProperties,MICRProperties,MotionSensorProperties,MSRProperties,PINPadProperties,PointCardRWProperties,POSKeyboardProperties,POSPowerProperties,POSPrinterProperties,RemoteOrderDisplayProperties,RFIDScannerProperties,ScaleProperties,ScannerProperties,SignatureCaptureProperties,SmartCardRWProperties,SoundPlayerProperties,SoundRecorderProperties,SpeechSynthesisProperties,ToneIndicatorProperties,VideoCaptureProperties,VoiceRecognitionProperties
Class containing common properties, property defaults, several values necessary for
common event handling and for standardized asynchronous method call processing and default implementations of
JposBaseInterface.
For details about properties, methods and method parameters, see UPOS specification, chapter Common Properties, Methods and Events.
For details about properties, methods and method parameters, see UPOS specification, chapter Common Properties, Methods and Events.
Default values of properties that will be initialized with a device specific value when method open will be called, must be directly set during object construction. Default values for all other properties must be set within method changeDefault in the device implementation class by setting the default value into a property with name PropertyNameDef. Whenever the corresponding property shall be initialized (e.g. during enable), the default value will be copied to the property.
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanStorage for jpos.xml property AllowAlwaysSetProperties.booleanFlag that specifies whether the device supports deprecated methods in cases where UPOS specifies that a service may throw an exception with error code E_DEPRECATED.booleanState of asynchronous input processing.booleanUPOS property AsyncMode.booleanUPOS property AutoDisable.booleanUPOS property CapStatisticsReporting.booleanUPOS property CapStatisticsReporting.UPOS property CheckHealthText.booleanUPOS property Claimed.Array holding the property sets of the device service that claimed this device class.List containing SyncObject instances to be signalled after releasing a claimed object.Currently executed output requests if the service supports concurrent method execution.intUPOS property CurrentUnitID.intUPOS property DataCount.booleanUPOS property DataEventEnabled.protected List<jpos.events.JposEvent>Event list, holds all data and input error events until they can be fired.Instance of JposDevice implementation that has been bound to this property set.booleanUPOS property DeviceEnabled.UPOS property DeviceServiceDescription.intUPOS property DeviceServiceVersion.List of all property sets sharing the same UPOS device.UPOS property ErrorString.intUPOS property ErrorUnits.jpos.services.EventCallbacksObject for event callbacks.List<jpos.events.JposEvent>Event list, holds at least events until they can be fired.Object to be used as source of Jpos events.UPOS property EventString.intUPOS property EventUnitID.intUPOS property EventUnits.static intValue for ExclusiveUse.static intValue for ExclusiveUse.intSpecifies the device model the device supports.static intValue for ExclusiveUse.booleanSpecifies whether first enable happened before.booleanUPOS property FlagWhenIdle.Holds the value to be set in StatusUpdateEvents fired due to FlagWhenIdle = truebooleanUPOS property FreezeEvents.intDevice index.Logical device name.intMaximum time in milliseconds an event callback may block event processing (default: FOREVER).intUPOS property OutputID.intUPOS property PowerNotify.intUPOS property PowerState.Runnable for serialized request processing.Output request runners waiting for service-specific serialization of asynchronous processing.intUPOS property State.booleanSpecifies whether event handling conforms strictly to UPOS specification (all events handled in a first-in-first-out mammer) or not (data and input error can be bypassed by other events as long as DataEventEnabled is false).List holding asynchronous output requests whenever service is in error state.List holding asynchronous output requests which allow concurrent processing whenever service is in error state.intUPOS property UnitsOnline.booleanSpecifies whether the device class supports use of subsystem units. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperties(List<JposCommonProperties>[] props)Add this to the given array of property set lists.voidasyncMode(boolean b)Final part of setting AsyncMode.voidAttach SyncObject for status synchronization.voidautoDisable(boolean b)Final part of setting AutoDisable.voidcheckForDeprecation(int firstDeprecatedVersion, String message)Checks whether a method may throw a JposException with error code JPOS_E_DEPRECATED.voidcheckHealth(int level)Final part of CheckHealth method.voidcheckProperties(jpos.config.JposEntry entry)Checks jpos entries for service specific jpos property values and set corresponding service values.voidclaim(int timeout)Final part of setting claim.voidClear data properties.voidClear error properties.voidClear input processing: Clear data event list, clear data event count, set State to idle.voidClear output processing.voidClear output error properties.voidclose()Final part of close method.voidcompareFirmwareVersion(String firmwareFileName, int[] result)Final part of CompareFirmwareVersion method.voiddataEventEnabled(boolean b)Final part of setting DataEventEnabled.voiddeviceEnabled(boolean enable)Final part of setting DeviceEnabled.Final or validation part of DirectIO method.voidFinal part of DirectIO method.voidflagWhenIdle(boolean b)Final part of setting FlagWhenIdle.voidfreezeEvents(boolean freezeEvents)Final part of setting FreezeEvents.Retrieves the property set of the service instance that claims the device.voidWill be called whenever DeviceEnabled will be set to true if power notification is enabled (PowerNotify = PN_ENABLED).voidInitialize properties that must be initialized whenever the device will be claimed.voidinitOnEnable(boolean enable)Initialization of properties that must be initialized during deviceEnable.booleanInitialize properties that must be initialized whenever the device will be enabled the first time-voidInitialization of properties that must be initialized during open.Class factory for JposOutputRequests.voidopen()Final part of open method.voidpowerNotify(int powerNotify)Final part of setting PowerNotify.voidrelease()Final part of release method.voidRelease SyncObject for status synchronization.voidremove this from the list of property sets.voidresetStatistics(String statisticsBuffer)Final part of ResetStatistics method.voidretrieveStatistics(String[] statisticsBuffer)Final part of RetrieveStatistics method.voidInitiates input retrieval.voidInitiates output retrieval.voidSignals SyncObject for status synchronization.intCounts enqueued data events of subsystem unit specified by CurrentUnitID.voidupdateFirmware(UpdateFirmware request)Final part of UpdateFirmware method.updateFirmware(String firmwareFileName)Final or validation part of UpdateFirmware method.voidupdateStatistics(String statisticsBuffer)Final part of UpdateStatistics method.booleanwaitWaiter(long timeout)Suspend thread until SyncObject for status synchronization has been signalled.
-
Field Details
-
Device
Instance of JposDevice implementation that has been bound to this property set. -
CapStatisticsReporting
public boolean CapStatisticsReportingUPOS property CapStatisticsReporting. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method. -
CapUpdateStatistics
public boolean CapUpdateStatisticsUPOS property CapStatisticsReporting. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method. -
DeviceServiceDescription
UPOS property DeviceServiceDescription. Default: "Default service implementation". Can be overwritten by objects derived from JposDevice within the changeDefaults method. -
DeviceServiceVersion
public int DeviceServiceVersionUPOS property DeviceServiceVersion. Default: 1016000. Can be overwritten by objects derived from JposDevice within the changeDefaults method. -
State
public int StateUPOS property State. -
AsyncMode
public boolean AsyncModeUPOS property AsyncMode. -
AutoDisable
public boolean AutoDisableUPOS property AutoDisable. -
FlagWhenIdle
public boolean FlagWhenIdleUPOS property FlagWhenIdle. -
CheckHealthText
UPOS property CheckHealthText. -
Claimed
public boolean ClaimedUPOS property Claimed. -
DataCount
public int DataCountUPOS property DataCount. -
DataEventEnabled
public boolean DataEventEnabledUPOS property DataEventEnabled. -
DeviceEnabled
public boolean DeviceEnabledUPOS property DeviceEnabled. -
FreezeEvents
public boolean FreezeEventsUPOS property FreezeEvents. -
OutputID
public int OutputIDUPOS property OutputID. -
PowerNotify
public int PowerNotifyUPOS property PowerNotify. -
PowerState
public int PowerStateUPOS property PowerState. -
LogicalName
Logical device name. Passed by Open method. -
CurrentUnitID
public int CurrentUnitIDUPOS property CurrentUnitID. Must be initialized at least in initOnFirstEnable method of derived class, if UsesSubsystemUnits is true. -
ErrorString
UPOS property ErrorString. -
ErrorUnits
public int ErrorUnitsUPOS property ErrorUnits. -
EventString
UPOS property EventString. -
EventUnitID
public int EventUnitIDUPOS property EventUnitID. -
EventUnits
public int EventUnitsUPOS property EventUnits. -
UnitsOnline
public int UnitsOnlineUPOS property UnitsOnline. -
EventCB
public jpos.services.EventCallbacks EventCBObject for event callbacks. Passed by Open method. -
EventSource
Object to be used as source of Jpos events. -
AllowAlwaysSetProperties
public boolean AllowAlwaysSetPropertiesStorage for jpos.xml property AllowAlwaysSetProperties. Specifies how the service instance shall handle write access to writable properties while the device has not been claimed for exclusive-use devices:
If true, setting such properties will remain possible and it is up to the service how to handle the new value. Since no physical access to the device is allowed until the device has been claimed, the service can buffer the new value for later use after a successful call of method claim.
If false, only read access will be possible until the device has been claimed. If the application tries to change a writable property, a JposException will be thrown with error code E_NOTCLAIMED. -
MaximumConfirmationEventWaitingTime
public int MaximumConfirmationEventWaitingTimeMaximum time in milliseconds an event callback may block event processing (default: FOREVER). Only conforms to UPOS specification if FOREVER. lower values can lead to concurrent processing of event coroutines. -
StrictFIFOEventHandling
public boolean StrictFIFOEventHandlingSpecifies whether event handling conforms strictly to UPOS specification (all events handled in a first-in-first-out mammer) or not (data and input error can be bypassed by other events as long as DataEventEnabled is false). Since strict UPOS conformance is impractical, the default is false. -
ClaimWaiters
List containing SyncObject instances to be signalled after releasing a claimed object. Whenever a service tries to claim a device which has been claimed before by another instance, if adds a SyncObject to this list and waits until the object will be signalled. During release or close, all objects within this list will be signalled to allow all waiting instances to try claiming again. -
EventList
Event list, holds at least events until they can be fired. As long as DataEventEnabled = false, data events and (input) error events will be put into DataEventList instead. -
DataEventList
Event list, holds all data and input error events until they can be fired. -
DevProps
List of all property sets sharing the same UPOS device. -
Index
public int IndexDevice index. Must be betwen 0 and the number of devices of the device class that the driver supports minus one. -
ExclusiveYes
public static final int ExclusiveYesValue for ExclusiveUse. Must be set within derived classes that support only exclusive use.- See Also:
- Constant Field Values
-
ExclusiveAllowed
public static final int ExclusiveAllowedValue for ExclusiveUse. Must be set within derived classes that are sharable but allow exclusive use.- See Also:
- Constant Field Values
-
ExclusiveNo
public static final int ExclusiveNoValue for ExclusiveUse. Must be set within derived classes that are sharable and do not allow exclusive use.- See Also:
- Constant Field Values
-
ExclusiveUse
public int ExclusiveUseSpecifies the device model the device supports. Default is ExclusiveYes. -
UsesSubsystemUnits
public boolean UsesSubsystemUnitsSpecifies whether the device class supports use of subsystem units. If true, the service implements a device class that supports the properties EventUnitID, EventUnits, EventText, ErrorUnits, ErrorText and UnitsOnline. Currently, this restricts usage to device class BumpBar and RemoteOrderDisplay. -
FirstEnableHappened
public boolean FirstEnableHappenedSpecifies whether first enable happened before. -
Claiming
Array holding the property sets of the device service that claimed this device class. -
FlagWhenIdleStatusValue
Holds the value to be set in StatusUpdateEvents fired due to FlagWhenIdle = true -
AllowDeprecatedMethods
public boolean AllowDeprecatedMethodsFlag that specifies whether the device supports deprecated methods in cases where UPOS specifies that a service may throw an exception with error code E_DEPRECATED. This is the case whenever deprecation started more than 2 minor release numbers before the current UPOS release. Since this implementation is for UPOS release 1.16, this affects methods that are deprecated since UPOS version 1.13 or earlier. -
SuspendedCommands
List holding asynchronous output requests whenever service is in error state. -
CurrentCommands
Currently executed output requests if the service supports concurrent method execution. If a service supports concurrent method execution, it must set CurrentCommands to a non-null value. -
SuspendedConcurrentCommands
List holding asynchronous output requests which allow concurrent processing whenever service is in error state. -
SerializedRequestRunner
Runnable for serialized request processing. -
SerializedRequests
Output request runners waiting for service-specific serialization of asynchronous processing. -
AsyncInputActive
public boolean AsyncInputActiveState of asynchronous input processing. Will be set whenever asynchronous input request will be enqueued and reset when the last input operation has been finished.
-
-
Constructor Details
-
JposCommonProperties
protected JposCommonProperties(int dev)Constructor.- Parameters:
dev- Device index
-
-
Method Details
-
checkProperties
public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposExceptionChecks jpos entries for service specific jpos property values and set corresponding service values.- 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.
-
checkForDeprecation
public void checkForDeprecation(int firstDeprecatedVersion, String message) throws jpos.JposExceptionChecks whether a method may throw a JposException with error code JPOS_E_DEPRECATED.- Parameters:
firstDeprecatedVersion- Version when the method to be checked became deprecated.message- message to be used in JposException with JPOS_E_DEPRECATED will be thrown.- Throws:
jpos.JposException- If DeviceServiceVersion is more than two minor releases behind the deprecation and AllowDeprecatedMethods has not been set.
-
initOnOpen
public void initOnOpen()Initialization of properties that must be initialized during open. -
initOnEnable
public void initOnEnable(boolean enable)Initialization of properties that must be initialized during deviceEnable.- Parameters:
enable- True: initialize properties, false: do nothing
-
initOnFirstEnable
public boolean initOnFirstEnable()Initialize properties that must be initialized whenever the device will be enabled the first time-- Returns:
- Returns true in case of first enable.
-
initOnClaim
public void initOnClaim()Initialize properties that must be initialized whenever the device will be claimed. -
clearDataProperties
public void clearDataProperties()Clear data properties. Performed during ClearInput and ClearInputProperties. -
clearErrorProperties
public void clearErrorProperties()Clear error properties. Performed at the end of any error handling. -
clearOutputErrorProperties
public void clearOutputErrorProperties()Clear output error properties. Performed at the end of any output error handling. Must only be overwritten when different operation is necessary for input and output errors or if the device supports subsystem units. -
addProperties
Add this to the given array of property set lists. Index specifies to which list it will be added.- Parameters:
props- array of property set lists to be used
-
removeFromPropertySetList
public void removeFromPropertySetList()remove this from the list of property sets.- Specified by:
removeFromPropertySetListin interfaceJposBaseInterface
-
attachWaiter
public void attachWaiter()Attach SyncObject for status synchronization. Will be attached when a method needs to wait for a status change. After status changed, events derived from JposStatusUpdateEvents that support waiting for status change will signal the SyncObject after updating the corresponding properties. After being woken up, the previously waiting method should release the SyncObject as soon as possible. -
releaseWaiter
public void releaseWaiter()Release SyncObject for status synchronization. See attachWaiter for further details. -
signalWaiter
public void signalWaiter()Signals SyncObject for status synchronization. See attachWaiter for further details. -
waitWaiter
public boolean waitWaiter(long timeout)Suspend thread until SyncObject for status synchronization has been signalled. See attachWaiter for further details.- Parameters:
timeout- Maximum time to wait for status status change- Returns:
- true when signalled, false otherwise (timeout / no SyncObject present)
-
getClaimingInstance
Retrieves the property set of the service instance that claims the device.- Returns:
- property set of claiming instance, null if no instance claims the device.
-
deviceEnabled
public void deviceEnabled(boolean enable) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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:
deviceEnabledin interfaceJposBaseInterface- Parameters:
enable- True to enable, false to disable- Throws:
jpos.JposException- If an error occurs during enable or disable
-
freezeEvents
public void freezeEvents(boolean freezeEvents) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
freezeEventsin interfaceJposBaseInterface- Parameters:
freezeEvents- False to enable, true to disable event delivery- Throws:
jpos.JposException- If an error occurs during enable or disable
-
powerNotify
public void powerNotify(int powerNotify) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
powerNotifyin interfaceJposBaseInterface- Parameters:
powerNotify- New property value- Throws:
jpos.JposException- If an error occurs while setting the property
-
autoDisable
public void autoDisable(boolean b) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
autoDisablein interfaceJposBaseInterface- Parameters:
b- New property value- Throws:
jpos.JposException- If an error occurs while setting the property
-
asyncMode
public void asyncMode(boolean b) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
asyncModein interfaceJposBaseInterface- Parameters:
b- New property value- Throws:
jpos.JposException- If an error occurs while setting the property.
-
dataEventEnabled
public void dataEventEnabled(boolean b) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
dataEventEnabledin interfaceJposBaseInterface- Parameters:
b- New property value- Throws:
jpos.JposException- If an error occurs while setting the property DataEventEnabled.
-
flagWhenIdle
public void flagWhenIdle(boolean b) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
flagWhenIdlein interfaceJposBaseInterface- Parameters:
b- New property value- Throws:
jpos.JposException- If an error occurs while setting the property FlagWhenIdle.
-
unitDataCount
public int unitDataCount()Description copied from interface:JposBaseInterfaceCounts enqueued data events of subsystem unit specified by CurrentUnitID.- Specified by:
unitDataCountin interfaceJposBaseInterface- Returns:
- Number of enqueued data events from subsystem unit specified by CurrentUnitID.
-
claim
public void claim(int timeout) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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:
claimin interfaceJposBaseInterface- Parameters:
timeout- see UPOS specification, method Claim- Throws:
jpos.JposException- If an error occurs while claiming the device
-
close
public void close() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
closein interfaceJposBaseInterface- Throws:
jpos.JposException- See UPOS specification, method Close
-
checkHealth
public void checkHealth(int level) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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:
checkHealthin interfaceJposBaseInterface- Parameters:
level- See UPOS specification, method CheckHealth- Throws:
jpos.JposException- See UPOS specification, method CheckHealth
-
directIO
Description copied from interface:JposBaseInterfaceFinal 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.
In case of validation only (asynchronous mode), a DirectIO object created with command, data[0] and object as parameters must be returned.- Specified by:
directIOin interfaceJposBaseInterface- Parameters:
command- See UPOS specification, method DirectIOdata- See UPOS specification, method DirectIOobject- 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
Description copied from interface:JposBaseInterfaceFinal 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.- Specified by:
directIOin interfaceJposBaseInterface- Parameters:
request- Output request object that contains all parameters to be used by ReadWeight.- Throws:
jpos.JposException- If an error occurs.
-
open
public void open() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.- Specified by:
openin interfaceJposBaseInterface- Throws:
jpos.JposException- See UPOS specification, method Open
-
release
public void release() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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:
releasein interfaceJposBaseInterface- Throws:
jpos.JposException- See UPOS specification, method Release
-
clearInput
public void clearInput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceClear 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.
- Specified by:
clearInputin interfaceJposBaseInterface- Throws:
jpos.JposException- See UPOS specification, method ClearInput
-
retryInput
public void retryInput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceInitiates input retrieval. Must be overwritten in devices that support retrying input operation.- Specified by:
retryInputin interfaceJposBaseInterface- 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.
-
newJposOutputRequest
Description copied from interface:JposBaseInterfaceClass factory for JposOutputRequests.- Specified by:
newJposOutputRequestin interfaceJposBaseInterface- Returns:
- A new instance of JposOutputRequest or a derived class.
-
clearOutput
public void clearOutput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceClear 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.
- Specified by:
clearOutputin interfaceJposBaseInterface- Throws:
jpos.JposException- See UPOS specification, method ClearOutput
-
retryOutput
public void retryOutput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceInitiates output retrieval. Must be overwritten in devices that support retrying output operations.- Specified by:
retryOutputin interfaceJposBaseInterface- 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.
-
compareFirmwareVersion
public void compareFirmwareVersion(String firmwareFileName, int[] result) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
compareFirmwareVersionin interfaceJposBaseInterface- Parameters:
firmwareFileName- See UPOS specification, method CompareFirmwareVersion.result- See UPOS specification, method CompareFirmwareVersion.- Throws:
jpos.JposException- See UPOS specification, method CompareFirmwareVersion
-
updateFirmware
Description copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
updateFirmwarein interfaceJposBaseInterface- Parameters:
firmwareFileName- See UPOS specification, method UpdateFirmware- Returns:
- UpdateFirmware object for use in final part.
- Throws:
jpos.JposException- See UPOS specification, method UpdateFirmware
-
updateFirmware
Description copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
updateFirmwarein interfaceJposBaseInterface- Parameters:
request- Output request object that contains all parameters to be used by ReadWeight.- Throws:
jpos.JposException- If an error occurs.
-
resetStatistics
Description copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
resetStatisticsin interfaceJposBaseInterface- Parameters:
statisticsBuffer- See UPOS specification, method ResetStatistics- Throws:
jpos.JposException- See UPOS specification, method ResetStatistics
-
retrieveStatistics
Description copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
retrieveStatisticsin interfaceJposBaseInterface- Parameters:
statisticsBuffer- See UPOS specification, method RetrieveStatistics- Throws:
jpos.JposException- See UPOS specification, method RetrieveStatistics
-
updateStatistics
Description copied from interface:JposBaseInterfaceFinal 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.
- Specified by:
updateStatisticsin interfaceJposBaseInterface- Parameters:
statisticsBuffer- See UPOS specification, method UpdateStatistics- Throws:
jpos.JposException- See UPOS specification, method UpdateStatistics
-
handlePowerStateOnEnable
public void handlePowerStateOnEnable() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceWill 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.- Specified by:
handlePowerStateOnEnablein interfaceJposBaseInterface- Throws:
jpos.JposException- If an error occurs.
-