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

public class HardTotalsService extends JposBase implements jpos.services.HardTotalsService116
HardTotals service implementation. For more details about getter, setter and method implementations, see JposBase.
  • Field Details

    • HardTotals

      public HardTotalsInterface 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

      public HardTotalsService(HardTotalsProperties props, JposDevice device)
      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.JposException
      Description copied from class: JposBase
      Deletes the service instance. Called to perform cleanup operations.
      Specified by:
      deleteInstance in interface jpos.loader.JposServiceInstance
      Overrides:
      deleteInstance in class JposBase
      Throws:
      jpos.JposException - If close() failed or if device cannot be found in list of all devices.
    • startClaiming

      public JposCommonProperties startClaiming(SyncObject waiter)
      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 class JposBase
      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

      public JposCommonProperties startClaiming(int handle, SyncObject waiter)
      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 interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getCapSingleFile

      public boolean getCapSingleFile() throws jpos.JposException
      Specified by:
      getCapSingleFile in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getCapTransactions

      public boolean getCapTransactions() throws jpos.JposException
      Specified by:
      getCapTransactions in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getFreeData

      public int getFreeData() throws jpos.JposException
      Specified by:
      getFreeData in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getNumberOfFiles

      public int getNumberOfFiles() throws jpos.JposException
      Specified by:
      getNumberOfFiles in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getTotalsSize

      public int getTotalsSize() throws jpos.JposException
      Specified by:
      getTotalsSize in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • getTransactionInProgress

      public boolean getTransactionInProgress() throws jpos.JposException
      Specified by:
      getTransactionInProgress in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • beginTrans

      public void beginTrans() throws jpos.JposException
      Specified by:
      beginTrans in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • claimFile

      public void claimFile(int hTotalsFile, int timeout) throws jpos.JposException
      Specified by:
      claimFile in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • commitTrans

      public void commitTrans() throws jpos.JposException
      Specified by:
      commitTrans in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • create

      public void create(String fileName, int[] hTotalsFile, int size, boolean errorDetection) throws jpos.JposException
      Specified by:
      create in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • delete

      public void delete(String fileName) throws jpos.JposException
      Specified by:
      delete in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • find

      public void find(String fileName, int[] hTotalsFile, int[] size) throws jpos.JposException
      Specified by:
      find in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • findByIndex

      public void findByIndex(int index, String[] fileName) throws jpos.JposException
      Specified by:
      findByIndex in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • read

      public void read(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException
      Specified by:
      read in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • recalculateValidationData

      public void recalculateValidationData(int hTotalsFile) throws jpos.JposException
      Specified by:
      recalculateValidationData in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • releaseFile

      public void releaseFile(int hTotalsFile) throws jpos.JposException
      Specified by:
      releaseFile in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • rename

      public void rename(int hTotalsFile, String fileName) throws jpos.JposException
      Specified by:
      rename in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • rollback

      public void rollback() throws jpos.JposException
      Specified by:
      rollback in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • setAll

      public void setAll(int hTotalsFile, byte value) throws jpos.JposException
      Specified by:
      setAll in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • validateData

      public void validateData(int hTotalsFile) throws jpos.JposException
      Specified by:
      validateData in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException
    • write

      public void write(int hTotalsFile, byte[] data, int offset, int count) throws jpos.JposException
      Specified by:
      write in interface jpos.services.HardTotalsService12
      Throws:
      jpos.JposException