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 TypeMethodDescriptionvoidvoidclaimFile(int hTotalsFile, int timeout)voidvoidvoidvoidDeletes the service instance.voidvoidfindByIndex(int index, String[] fileName)booleanbooleanbooleanintintintbooleanvoidread(int hTotalsFile, byte[] data, int offset, int count)voidrecalculateValidationData(int hTotalsFile)voidreleaseFile(int hTotalsFile)voidvoidrollback()voidsetAll(int hTotalsFile, byte value)voidsignalRelease(int handle)Signals release after claimFile.startClaiming(int handle, SyncObject waiter)Starts claiming of file.startClaiming(SyncObject waiter)Starts claiming.voidvalidateData(int hTotalsFile)voidwrite(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, updateStatisticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jpos.services.BaseService
checkHealth, claim, close, directIO, getCheckHealthText, getClaimed, getDeviceEnabled, getDeviceServiceDescription, getDeviceServiceVersion, getFreezeEvents, getPhysicalDeviceDescription, getPhysicalDeviceName, getState, open, release, setDeviceEnabled, setFreezeEventsMethods inherited from interface jpos.services.HardTotalsService13
getCapPowerReporting, getPowerNotify, getPowerState, setPowerNotifyMethods inherited from interface jpos.services.HardTotalsService18
getCapStatisticsReporting, getCapUpdateStatistics, resetStatistics, retrieveStatistics, updateStatisticsMethods 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:JposBaseDeletes the service instance. Called to perform cleanup operations.- Specified by:
deleteInstancein interfacejpos.loader.JposServiceInstance- Overrides:
deleteInstancein classJposBase- Throws:
jpos.JposException- If close() failed or if device cannot be found in list of all devices.
-
startClaiming
Description copied from class:JposBaseStarts 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:
startClaimingin 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:
getCapErrorDetectionin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getCapSingleFile
public boolean getCapSingleFile() throws jpos.JposException- Specified by:
getCapSingleFilein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getCapTransactions
public boolean getCapTransactions() throws jpos.JposException- Specified by:
getCapTransactionsin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getFreeData
public int getFreeData() throws jpos.JposException- Specified by:
getFreeDatain interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getNumberOfFiles
public int getNumberOfFiles() throws jpos.JposException- Specified by:
getNumberOfFilesin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getTotalsSize
public int getTotalsSize() throws jpos.JposException- Specified by:
getTotalsSizein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
getTransactionInProgress
public boolean getTransactionInProgress() throws jpos.JposException- Specified by:
getTransactionInProgressin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
beginTrans
public void beginTrans() throws jpos.JposException- Specified by:
beginTransin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
claimFile
public void claimFile(int hTotalsFile, int timeout) throws jpos.JposException- Specified by:
claimFilein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
commitTrans
public void commitTrans() throws jpos.JposException- Specified by:
commitTransin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
create
public void create(String fileName, int[] hTotalsFile, int size, boolean errorDetection) throws jpos.JposException- Specified by:
createin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
delete
- Specified by:
deletein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
find
- Specified by:
findin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
findByIndex
- Specified by:
findByIndexin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
read
public void read(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException- Specified by:
readin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
recalculateValidationData
public void recalculateValidationData(int hTotalsFile) throws jpos.JposException- Specified by:
recalculateValidationDatain interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
releaseFile
public void releaseFile(int hTotalsFile) throws jpos.JposException- Specified by:
releaseFilein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
rename
- Specified by:
renamein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
rollback
public void rollback() throws jpos.JposException- Specified by:
rollbackin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
setAll
public void setAll(int hTotalsFile, byte value) throws jpos.JposException- Specified by:
setAllin interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
validateData
public void validateData(int hTotalsFile) throws jpos.JposException- Specified by:
validateDatain interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-
write
public void write(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException- Specified by:
writein interfacejpos.services.HardTotalsService12- Throws:
jpos.JposException
-