Class HardTotalsService
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposBase
de.gmxhome.conrad.jpos.jpos_base.hardtotals.HardTotalsService
- All Implemented Interfaces:
jpos.loader.JposServiceInstance
,jpos.services.BaseService
,jpos.services.HardTotalsService110
,jpos.services.HardTotalsService111
,jpos.services.HardTotalsService112
,jpos.services.HardTotalsService113
,jpos.services.HardTotalsService114
,jpos.services.HardTotalsService115
,jpos.services.HardTotalsService116
,jpos.services.HardTotalsService12
,jpos.services.HardTotalsService13
,jpos.services.HardTotalsService14
,jpos.services.HardTotalsService15
,jpos.services.HardTotalsService16
,jpos.services.HardTotalsService17
,jpos.services.HardTotalsService18
,jpos.services.HardTotalsService19
HardTotals service implementation. For more details about getter, setter and method implementations,
see JposBase.
-
Field Summary
FieldsModifier and TypeFieldDescriptionInstance of a class implementing the HardTotalsInterface for hard totals specific setter and method calls bound to the property set.Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBase
Device, DeviceInterface, Props
-
Constructor Summary
ConstructorsConstructorDescriptionHardTotalsService(HardTotalsProperties props, JposDevice device)
Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
claimFile(int hTotalsFile, int timeout)
void
void
void
void
Deletes the service instance.void
void
findByIndex(int index, String[] fileName)
boolean
boolean
boolean
int
int
int
boolean
void
read(int hTotalsFile, byte[] data, int offset, int count)
void
recalculateValidationData(int hTotalsFile)
void
releaseFile(int hTotalsFile)
void
void
rollback()
void
setAll(int hTotalsFile, byte value)
void
signalRelease(int handle)
Signals release after claimFile.startClaiming(int handle, SyncObject waiter)
Starts claiming of file.startClaiming(SyncObject waiter)
Starts claiming.void
validateData(int hTotalsFile)
void
write(int hTotalsFile, byte[] data, int offset, int count)
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBase
callNowOrLater, check, check, check, check, checkBusy, checkClaimed, checkEnabled, checkEnabledUnclaimed, checkFirstEnabled, checkHealth, checkNoChangedOrClaimed, checkOpened, claim, clearInput, clearInputProperties, clearOutput, close, compareFirmwareVersion, deepToString, directIO, getAsyncMode, getAutoDisable, getCapCompareFirmwareVersion, getCapPowerReporting, getCapStatisticsReporting, getCapUpdateFirmware, getCapUpdateStatistics, getCheckHealthText, getClaimed, getDataCount, getDataEventEnabled, getDeviceEnabled, getDeviceServiceDescription, getDeviceServiceVersion, getFreezeEvents, getOutputID, getPhysicalDeviceDescription, getPhysicalDeviceName, getPowerNotify, getPowerState, getPropertyString, getState, logAsyncCall, logCall, logCall, logGet, logGet, logPreCall, logPreCall, logPreSet, logSet, open, release, removeOuterArraySpecifier, resetStatistics, retrieveStatistics, setAsyncMode, setAutoDisable, setDataEventEnabled, setDeviceEnabled, setFreezeEvents, setPowerNotify, signalRelease, updateFirmware, updateStatistics
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jpos.services.BaseService
checkHealth, claim, close, directIO, getCheckHealthText, getClaimed, getDeviceEnabled, getDeviceServiceDescription, getDeviceServiceVersion, getFreezeEvents, getPhysicalDeviceDescription, getPhysicalDeviceName, getState, open, release, setDeviceEnabled, setFreezeEvents
Methods inherited from interface jpos.services.HardTotalsService13
getCapPowerReporting, getPowerNotify, getPowerState, setPowerNotify
Methods inherited from interface jpos.services.HardTotalsService18
getCapStatisticsReporting, getCapUpdateStatistics, resetStatistics, retrieveStatistics, updateStatistics
Methods inherited from interface jpos.services.HardTotalsService19
compareFirmwareVersion, getCapCompareFirmwareVersion, getCapUpdateFirmware, updateFirmware
-
Field Details
-
HardTotals
Instance of a class implementing the HardTotalsInterface for hard totals specific setter and method calls bound to the property set. Almost always the same object as Data.
-
-
Constructor Details
-
HardTotalsService
Constructor. Stores given property set and device implementation object.- Parameters:
props
- Property set.device
- Device implementation object.
-
-
Method Details
-
deleteInstance
public void deleteInstance() throws jpos.JposExceptionDescription copied from class:JposBase
Deletes the service instance. Called to perform cleanup operations.- Specified by:
deleteInstance
in interfacejpos.loader.JposServiceInstance
- Overrides:
deleteInstance
in classJposBase
- Throws:
jpos.JposException
- If close() failed or if device cannot be found in list of all devices.
-
startClaiming
Description copied from class:JposBase
Starts claiming. Should be called whenever a device tries to claim a device.
Returns null, if the device is not claimed. Otherwise, the given SyncObject instance will be inserted into the ClaimWaiters list of the claiming instance. Since this object will be signalled during release or close of that instance, it should be used to wait before retrying start claiming.- Overrides:
startClaiming
in classJposBase
- Parameters:
waiter
- SyncOject to be used for synchronization with currently claiming instance, if any.- Returns:
- null on success, property set of currently claiming instance otherwise.
-
startClaiming
Starts claiming of file. Checks whether device and file can be claimed. If so, stores property set in property Claiming, which is a reservation for successful claim operation. Otherwise stores the given SyncObject in the claiming object. The claiming object will signal the object after successful release or releaseFile operation.- Parameters:
handle
- Handle of file to be claimed.waiter
- SyncObject the caller can use to wait in case of no success.- Returns:
- null on success, property set of the instance that claimed the device or file.
-
signalRelease
public void signalRelease(int handle)Signals release after claimFile. Should be called whenever a claimed file becomes unclaimed to wake up any other waiting instances.- Parameters:
handle
- File handle of file to be released.
-
getCapErrorDetection
public boolean getCapErrorDetection() throws jpos.JposException- Specified by:
getCapErrorDetection
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getCapSingleFile
public boolean getCapSingleFile() throws jpos.JposException- Specified by:
getCapSingleFile
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getCapTransactions
public boolean getCapTransactions() throws jpos.JposException- Specified by:
getCapTransactions
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getFreeData
public int getFreeData() throws jpos.JposException- Specified by:
getFreeData
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getNumberOfFiles
public int getNumberOfFiles() throws jpos.JposException- Specified by:
getNumberOfFiles
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getTotalsSize
public int getTotalsSize() throws jpos.JposException- Specified by:
getTotalsSize
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
getTransactionInProgress
public boolean getTransactionInProgress() throws jpos.JposException- Specified by:
getTransactionInProgress
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
beginTrans
public void beginTrans() throws jpos.JposException- Specified by:
beginTrans
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
claimFile
public void claimFile(int hTotalsFile, int timeout) throws jpos.JposException- Specified by:
claimFile
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
commitTrans
public void commitTrans() throws jpos.JposException- Specified by:
commitTrans
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
create
public void create(String fileName, int[] hTotalsFile, int size, boolean errorDetection) throws jpos.JposException- Specified by:
create
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
delete
- Specified by:
delete
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
find
- Specified by:
find
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
findByIndex
- Specified by:
findByIndex
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
read
public void read(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException- Specified by:
read
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
recalculateValidationData
public void recalculateValidationData(int hTotalsFile) throws jpos.JposException- Specified by:
recalculateValidationData
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
releaseFile
public void releaseFile(int hTotalsFile) throws jpos.JposException- Specified by:
releaseFile
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
rename
- Specified by:
rename
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
rollback
public void rollback() throws jpos.JposException- Specified by:
rollback
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
setAll
public void setAll(int hTotalsFile, byte value) throws jpos.JposException- Specified by:
setAll
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
validateData
public void validateData(int hTotalsFile) throws jpos.JposException- Specified by:
validateData
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-
write
public void write(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException- Specified by:
write
in interfacejpos.services.HardTotalsService12
- Throws:
jpos.JposException
-