Class SmartCardRWProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.smartcardrw.SmartCardRWProperties
All Implemented Interfaces:
JposBaseInterface, SmartCardRWInterface

public class SmartCardRWProperties extends JposCommonProperties implements SmartCardRWInterface
Class containing the smart card reader / writer specific properties, their default values and default implementations of SmartCardRWInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Smart Card Reader / Writer. This is a base implementation only. The current implementor of JavaPOS-SPF has no experience with SmartCardRW and therefore has no idea about meaningful defaults for most SmartCardRD properties, transmission protocols and interface modes.
Especially, the author has no deeper knowledge about APDU structure or the ARTS XML standard for SCR/W functionality. As result, currently the common service does not perform any APDU or XML data checks, this must be done by the device specific implementation instead.
  • Field Details

    • CapCardErrorDetection

      public boolean CapCardErrorDetection
      UPOS property CapCardErrorDetection. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapInterfaceMode

      public int CapInterfaceMode
      UPOS property CapInterfaceMode. Default: CMODE_TRANS. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapIsoEmvMode

      public int CapIsoEmvMode
      UPOS property CapIsoEmvMode. Default: 0. Can be overwritten by objects derived from JposDevice within the changeDefaults method, should be overwritten if CapInterfaceMode contains CMODE_APDU.
    • CapSCPresentSensor

      public int CapSCPresentSensor
      UPOS property CapSCPresentSensor. Default: 0. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapSCSlots

      public int CapSCSlots
      UPOS property CapSCSlots. Default: 1.
    • CapTransmissionProtocol

      public int CapTransmissionProtocol
      UPOS property CapTransmissionProtocol. Default: 0. Must be overwritten by objects derived from JposDevice within the changeDefaults method to CTRANS_PROTOCOL_T0 or CTRANS_PROTOCOL_T1.
    • InterfaceMode

      public int InterfaceMode
      UPOS property InterfaceMode. Default: MODE_TRANS. Must be overwritten until first enabled if CapInterfaceMode does not contain CMODE_TRANS.
    • IsoEmvMode

      public int IsoEmvMode
      UPOS property IsoEmvMode. Default: 0.
    • SCPresentSensor

      public int SCPresentSensor
      UPOS property SCPresentSensor. Default: 0.
    • SCSlot

      public int SCSlot
      UPOS property SCSlot. Default: 1 (Slot 0).
    • TransactionInProgress

      public boolean TransactionInProgress
      UPOS property TransactionInProgress. Default: false.
    • TransmissionProtocol

      public int TransmissionProtocol
      UPOS property TransmissionProtocol. Default: 0. Must be overwritten until first enabled to match the transmission protocols specified in CapTransmissionProtocol.
  • Constructor Details

    • SmartCardRWProperties

      protected SmartCardRWProperties(int dev)
      Constructor.
      Parameters:
      dev - Device index
  • Method Details

    • interfaceMode

      public void interfaceMode(int mode) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of setting InterfaceMode. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • mode is one of MODE_TRANS, MODE_BLOCK, MODE_APDU or MODE_XML,
      • The corresponding capability bit in CapInterfaceMode, CMODE_TRANS, CMODE_BLOCK, CMODE_APDU or MODE_XML, is set, too.
      Specified by:
      interfaceMode in interface SmartCardRWInterface
      Parameters:
      mode - AdditionalSecurityInformation for subsequent storing data into journal.
      Throws:
      jpos.JposException - If an error occurs.
    • isoEmvMode

      public void isoEmvMode(int mode) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of setting IsoEmvMode. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • mode is one of MODE_ISO or MODE_EMV,
      • The corresponding capability bit in CapIsoEmvMode, CMODE_ISO or CMODE_EMV, is set, too.
      Specified by:
      isoEmvMode in interface SmartCardRWInterface
      Parameters:
      mode - Indicates the message modes the SCR/W shall use.
      Throws:
      jpos.JposException - If an error occurs.
    • sCSlot

      public void sCSlot(int slot) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of setting SCSlot. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • Only one bit has been set in slots,
      • The bit set in slots is set in CapSCSlots as well.
      Specified by:
      sCSlot in interface SmartCardRWInterface
      Parameters:
      slot - New current slot.
      Throws:
      jpos.JposException - If an error occurs.
    • beginInsertion

      public void beginInsertion(int timeout) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of BeginInsertion 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,
      • timeout is FOREVER or ≥ 0.
      Specified by:
      beginInsertion in interface SmartCardRWInterface
      Parameters:
      timeout - The number of milliseconds before failing the method.
      Throws:
      jpos.JposException - If an error occurs.
    • beginRemoval

      public void beginRemoval(int timeout) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of BeginRemoval 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,
      • timeout is FOREVER or ≥ 0.
      Specified by:
      beginRemoval in interface SmartCardRWInterface
      Parameters:
      timeout - The number of milliseconds before failing the method.
      Throws:
      jpos.JposException - If an error occurs.
    • endInsertion

      public void endInsertion() throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of EndInsertion 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.
      Specified by:
      endInsertion in interface SmartCardRWInterface
      Throws:
      jpos.JposException - If an error occurs.
    • endRemoval

      public void endRemoval() throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of EndRemoval 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.
      Specified by:
      endRemoval in interface SmartCardRWInterface
      Throws:
      jpos.JposException - If an error occurs.
    • readData

      public void readData(int action, int[] count, String[] data) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of ReadData 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,
      • count and data are arrays with length one,
      • action is one of READ_DATA, READ_PROGRAM, EXECUTE_AND_READ_DATAor XML_READ_BLOCK_DATA.
      Specified by:
      readData in interface SmartCardRWInterface
      Parameters:
      action - Indicates the type of processing of the data.
      count - The total number of data bytes that have been returned.
      data - The data that is returned.
      Throws:
      jpos.JposException - If an error occurs.
    • writeData

      public WriteData writeData(int action, int count, String data) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Validation part of WriteData method. Can be overwritten within derived classes, if necessary. This method shall only perform additional validation. It will be called before the service buffers the method call for asynchronous execution. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • action is one of STORE_DATA, STORE_PROGRAM, EXECUTE_DATA, XML_BLOCK_DATA, SECURITY_FUSE or RESET,
      • count is > 0.
      Specified by:
      writeData in interface SmartCardRWInterface
      Parameters:
      action - Indicates the type of processing of the data.
      count - The total number of data bytes that shall be sent.
      data - The data to be sent.
      Returns:
      WriteData object for use in final part.
      Throws:
      jpos.JposException - If an error occurs.
    • writeData

      public void writeData(WriteData request) throws jpos.JposException
      Description copied from interface: SmartCardRWInterface
      Final part of WriteData method. Can be overwritten within derived classes, if necessary. The parameters of the method will be passed via a WriteData object. This method will be called when the corresponding operation shall be performed, either synchronously during commit. All plausibility checks have been made before, only runtime errors can occur.
      The default implementation should be called within derived methods to ensure that the property TransactionInProgress is updated as expected.
      Specified by:
      writeData in interface SmartCardRWInterface
      Parameters:
      request - Output request object returned by validation method that contains all parameters to be used by WriteData.
      Throws:
      jpos.JposException - If an error occurs.