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 TypeFieldDescriptionboolean
Storage for jpos.xml property AllowAlwaysSetProperties.boolean
Flag 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.boolean
State of asynchronous input processing.boolean
UPOS property AsyncMode.boolean
UPOS property AutoDisable.boolean
UPOS property CapStatisticsReporting.boolean
UPOS property CapStatisticsReporting.UPOS property CheckHealthText.boolean
UPOS 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.int
UPOS property CurrentUnitID.int
UPOS property DataCount.boolean
UPOS 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.boolean
UPOS property DeviceEnabled.UPOS property DeviceServiceDescription.int
UPOS property DeviceServiceVersion.List of all property sets sharing the same UPOS device.UPOS property ErrorString.int
UPOS property ErrorUnits.jpos.services.EventCallbacks
Object 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.int
UPOS property EventUnitID.int
UPOS property EventUnits.static int
Value for ExclusiveUse.static int
Value for ExclusiveUse.int
Specifies the device model the device supports.static int
Value for ExclusiveUse.boolean
Specifies whether first enable happened before.boolean
UPOS property FlagWhenIdle.Holds the value to be set in StatusUpdateEvents fired due to FlagWhenIdle = trueboolean
UPOS property FreezeEvents.int
Device index.Logical device name.int
Maximum time in milliseconds an event callback may block event processing (default: FOREVER).int
UPOS property OutputID.int
UPOS property PowerNotify.int
UPOS property PowerState.Runnable for serialized request processing.Output request runners waiting for service-specific serialization of asynchronous processing.int
UPOS property State.boolean
Specifies 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.int
UPOS property UnitsOnline.boolean
Specifies whether the device class supports use of subsystem units. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperties(List<JposCommonProperties>[] props)
Add this to the given array of property set lists.void
asyncMode(boolean b)
Final part of setting AsyncMode.void
Attach SyncObject for status synchronization.void
autoDisable(boolean b)
Final part of setting AutoDisable.void
checkForDeprecation(int firstDeprecatedVersion, String message)
Checks whether a method may throw a JposException with error code JPOS_E_DEPRECATED.void
checkHealth(int level)
Final part of CheckHealth method.void
checkProperties(jpos.config.JposEntry entry)
Checks jpos entries for service specific jpos property values and set corresponding service values.void
claim(int timeout)
Final part of setting claim.void
Clear data properties.void
Clear error properties.void
Clear input processing: Clear data event list, clear data event count, set State to idle.void
Clear output processing.void
Clear output error properties.void
close()
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.Final or validation part of DirectIO method.void
Final part of DirectIO method.void
flagWhenIdle(boolean b)
Final part of setting FlagWhenIdle.void
freezeEvents(boolean freezeEvents)
Final part of setting FreezeEvents.Retrieves the property set of the service instance that claims the device.void
Will be called whenever DeviceEnabled will be set to true if power notification is enabled (PowerNotify = PN_ENABLED).void
Initialize properties that must be initialized whenever the device will be claimed.void
initOnEnable(boolean enable)
Initialization of properties that must be initialized during deviceEnable.boolean
Initialize properties that must be initialized whenever the device will be enabled the first time-void
Initialization of properties that must be initialized during open.Class factory for JposOutputRequests.void
open()
Final part of open method.void
powerNotify(int powerNotify)
Final part of setting PowerNotify.void
release()
Final part of release method.void
Release SyncObject for status synchronization.void
remove this from the list of property sets.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.void
Signals SyncObject for status synchronization.int
Counts enqueued data events of subsystem unit specified by CurrentUnitID.void
updateFirmware(UpdateFirmware request)
Final part of UpdateFirmware method.updateFirmware(String firmwareFileName)
Final or validation part of UpdateFirmware method.void
updateStatistics(String statisticsBuffer)
Final part of UpdateStatistics method.boolean
waitWaiter(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:
removeFromPropertySetList
in 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: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 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:JposBaseInterface
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.
- Specified by:
freezeEvents
in 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:JposBaseInterface
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.
- Specified by:
powerNotify
in 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:JposBaseInterface
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.
- Specified by:
autoDisable
in 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:JposBaseInterface
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.
- Specified by:
asyncMode
in 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:JposBaseInterface
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.
- Specified by:
dataEventEnabled
in 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:JposBaseInterface
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.
- Specified by:
flagWhenIdle
in 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:JposBaseInterface
Counts enqueued data events of subsystem unit specified by CurrentUnitID.- Specified by:
unitDataCount
in 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: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 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:JposBaseInterface
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.
- Specified by:
close
in interfaceJposBaseInterface
- Throws:
jpos.JposException
- See UPOS specification, method Close
-
checkHealth
public void checkHealth(int level) throws jpos.JposExceptionDescription 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 interfaceJposBaseInterface
- Parameters:
level
- See UPOS specification, method CheckHealth- Throws:
jpos.JposException
- See UPOS specification, method CheckHealth
-
directIO
Description copied from interface:JposBaseInterface
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.
In case of validation only (asynchronous mode), a DirectIO object created with command, data[0] and object as parameters must be returned.- Specified by:
directIO
in 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:JposBaseInterface
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.- Specified by:
directIO
in 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:JposBaseInterface
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.- Specified by:
open
in interfaceJposBaseInterface
- Throws:
jpos.JposException
- See UPOS specification, method Open
-
release
public void release() throws jpos.JposExceptionDescription 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 interfaceJposBaseInterface
- Throws:
jpos.JposException
- See UPOS specification, method Release
-
clearInput
public void clearInput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterface
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.
- Specified by:
clearInput
in interfaceJposBaseInterface
- Throws:
jpos.JposException
- See UPOS specification, method ClearInput
-
retryInput
public void retryInput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterface
Initiates input retrieval. Must be overwritten in devices that support retrying input operation.- Specified by:
retryInput
in 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:JposBaseInterface
Class factory for JposOutputRequests.- Specified by:
newJposOutputRequest
in interfaceJposBaseInterface
- Returns:
- A new instance of JposOutputRequest or a derived class.
-
clearOutput
public void clearOutput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterface
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.
- Specified by:
clearOutput
in interfaceJposBaseInterface
- Throws:
jpos.JposException
- See UPOS specification, method ClearOutput
-
retryOutput
public void retryOutput() throws jpos.JposExceptionDescription copied from interface:JposBaseInterface
Initiates output retrieval. Must be overwritten in devices that support retrying output operations.- Specified by:
retryOutput
in 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:JposBaseInterface
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.
- Specified by:
compareFirmwareVersion
in 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:JposBaseInterface
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.
- Specified by:
updateFirmware
in 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:JposBaseInterface
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.
- Specified by:
updateFirmware
in 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:JposBaseInterface
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.
- Specified by:
resetStatistics
in interfaceJposBaseInterface
- Parameters:
statisticsBuffer
- See UPOS specification, method ResetStatistics- Throws:
jpos.JposException
- See UPOS specification, method ResetStatistics
-
retrieveStatistics
Description copied from interface:JposBaseInterface
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.
- Specified by:
retrieveStatistics
in interfaceJposBaseInterface
- Parameters:
statisticsBuffer
- See UPOS specification, method RetrieveStatistics- Throws:
jpos.JposException
- See UPOS specification, method RetrieveStatistics
-
updateStatistics
Description copied from interface:JposBaseInterface
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.
- Specified by:
updateStatistics
in 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:JposBaseInterface
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.- Specified by:
handlePowerStateOnEnable
in interfaceJposBaseInterface
- Throws:
jpos.JposException
- If an error occurs.
-