Class MSRProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.msr.MSRProperties
All Implemented Interfaces:
JposBaseInterface, MSRInterface
Direct Known Subclasses:
MSR

public class MSRProperties extends JposCommonProperties implements MSRInterface
Class containing the MSR specific properties, their default values and default implementations of MSRInterface. For details about properties, methods and method parameters, see UPOS specification, chapter MSR - Magnetic Stripe Reader.
  • Field Details

    • CapCardAuthentication

      public String CapCardAuthentication
      UPOS property CapCardAuthentication. Default: "". Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapDataEncryption

      public int CapDataEncryption
      UPOS property CapDataEncryption. Default: DE_NONE. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapDeviceAuthentication

      public int CapDeviceAuthentication
      UPOS property CapDeviceAuthentication. Default: DA_NOT_SUPPORTED. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapTrackDataMasking

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

      public int CapWritableTracks
      UPOS property CapWritableTracks. Default: TR_NONE. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapTransmitSentinels

      public boolean CapTransmitSentinels
      UPOS property CapTransmitSentinels. Default: true. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapISO

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

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

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

      public byte[] AdditionalSecurityInformation
      UPOS property AdditionalSecurityInformation.
    • CardAuthenticationData

      public byte[] CardAuthenticationData
      UPOS property CardAuthenticationData.
    • CardAuthenticationDataLength

      public int CardAuthenticationDataLength
      UPOS property CardAuthenticationDataLength.
    • CardPropertyList

      public String CardPropertyList
      UPOS property CardPropertyList.
    • CardType

      public String CardType
      UPOS property CardType.
    • CardTypeList

      public String CardTypeList
      UPOS property CardTypeList. Default: "". Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • DataEncryptionAlgorithm

      public int DataEncryptionAlgorithm
      UPOS property DataEncryptionAlgorithm. Default: DE_NONE. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • DeviceAuthenticated

      public boolean DeviceAuthenticated
      UPOS property DeviceAuthenticated.
    • DeviceAuthenticationProtocol

      public int DeviceAuthenticationProtocol
      UPOS property DeviceAuthenticationProtocol. Default: AP_NONE. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • Track1EncryptedData

      public byte[] Track1EncryptedData
      UPOS property Track1EncryptedData.
    • Track1EncryptedDataLength

      public int Track1EncryptedDataLength
      UPOS property Track1EncryptedDataLength.
    • Track2EncryptedData

      public byte[] Track2EncryptedData
      UPOS property Track2EncryptedData.
    • Track2EncryptedDataLength

      public int Track2EncryptedDataLength
      UPOS property Track2EncryptedDataLength.
    • Track3EncryptedData

      public byte[] Track3EncryptedData
      UPOS property Track3EncryptedData.
    • Track3EncryptedDataLength

      public int Track3EncryptedDataLength
      UPOS property Track3EncryptedDataLength.
    • Track4EncryptedData

      public byte[] Track4EncryptedData
      UPOS property Track4EncryptedData.
    • Track4EncryptedDataLength

      public int Track4EncryptedDataLength
      UPOS property Track4EncryptedDataLength.
    • WriteCardType

      public String WriteCardType
      UPOS property WriteCardType.
    • EncodingMaxLength

      public int EncodingMaxLength
      UPOS property EncodingMaxLength.
    • TracksToWrite

      public int TracksToWrite
      UPOS property TracksToWrite.
    • Track1Data

      public byte[] Track1Data
      UPOS property Track1Data.
    • Track2Data

      public byte[] Track2Data
      UPOS property Track2Data.
    • Track3Data

      public byte[] Track3Data
      UPOS property Track3Data.
    • Track4Data

      public byte[] Track4Data
      UPOS property Track4Data.
    • TransmitSentinels

      public boolean TransmitSentinels
      UPOS property TransmitSentinels.
    • AccountNumber

      public String AccountNumber
      UPOS property AccountNumber.
    • DecodeData

      public boolean DecodeData
      UPOS property DecodeData.
    • ErrorReportingType

      public int ErrorReportingType
      UPOS property ErrorReportingType.
    • ExpirationDate

      public String ExpirationDate
      UPOS property ExpirationDate.
    • FirstName

      public String FirstName
      UPOS property FirstName.
    • MiddleInitial

      public String MiddleInitial
      UPOS property MiddleInitial.
    • ParseDecodeData

      public boolean ParseDecodeData
      UPOS property ParseDecodeData.
    • ServiceCode

      public String ServiceCode
      UPOS property ServiceCode.
    • Suffix

      public String Suffix
      UPOS property Suffix.
    • Surname

      public String Surname
      UPOS property Surname.
    • Title

      public String Title
      UPOS property Title.
    • Track1DiscretionaryData

      public byte[] Track1DiscretionaryData
      UPOS property Track1DiscretionaryData.
    • Track2DiscretionaryData

      public byte[] Track2DiscretionaryData
      UPOS property Track2DiscretionaryData.
    • TracksToRead

      public int TracksToRead
      UPOS property TracksToRead.
  • Constructor Details

    • MSRProperties

      public MSRProperties(int dev)
      Constructor. Sets ExclusiveUse to ExclusiveYes to match the MSR device model.
      Parameters:
      dev - Device index
  • Method Details

    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • initOnEnable

      public void initOnEnable(boolean enable)
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during deviceEnable.
      Overrides:
      initOnEnable in class JposCommonProperties
      Parameters:
      enable - True: initialize properties, false: do nothing
    • setDataProperties

      public void setDataProperties(Object tracks)
      Description copied from interface: MSRInterface
      Sets data properties according to the track data. This method will be called whenever data properties must be filled before a data event will be fired.
      Specified by:
      setDataProperties in interface MSRInterface
      Parameters:
      tracks - Contents of track data.
    • dataEncryptionAlgorithm

      public void dataEncryptionAlgorithm(int b) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting DataEncryptionAlgorithm. 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 claimed,
      • Device is not enabled,
      • The new algorith value matches CapDataEncryption.
      Specified by:
      dataEncryptionAlgorithm in interface MSRInterface
      Parameters:
      b - New DataEncryptionAlgorithm value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • writeCardType

      public void writeCardType(String type) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting WriteCardType. 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 has not been closed,
      • The new card type matches one of the names specified in CardTypeList,
      • internal property AllowAlwaysSetProperties is true or type equals the previous value of WriteCardType.
      Specified by:
      writeCardType in interface MSRInterface
      Parameters:
      type - New WriteCardType value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tracksToWrite

      public void tracksToWrite(int t2w) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting TracksToWrite. 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 has not been closed,
      • The given value for tracks to write specifies only tracks present in CapWritableTracks,
      • internal property AllowAlwaysSetProperties is true or t2w equals the previous value of TracksToWrite.
      Specified by:
      tracksToWrite in interface MSRInterface
      Parameters:
      t2w - New TracksToWrite value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • transmitSentinels

      public void transmitSentinels(boolean flag) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting TransmitSentinels. 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 has not been closed,
      • CapTransmitSentinels is false: The new value is false as well,
      • internal property AllowAlwaysSetProperties is true or flag equals the previous value of TransmitSentinels.
      Specified by:
      transmitSentinels in interface MSRInterface
      Parameters:
      flag - New TransmitSentinels value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • decodeData

      public void decodeData(boolean flag) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting DecodeData. Can be overwritten within derived classes, if necessary. If set to false, ParseDecodeData will be set to false as well. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • internal property AllowAlwaysSetProperties is true or flag equals the previous value of DecodeData.
      Specified by:
      decodeData in interface MSRInterface
      Parameters:
      flag - New DecodeData value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • errorReportingType

      public void errorReportingType(int type) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting ErrorReportingType. 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 has not been closed,
      • CapDataEncryption != MSR_DE_NONE,
      • The new value is one of MSR_ERT_CARD or MSR_ERT_TRACK,
      • internal property AllowAlwaysSetProperties is true or type equals the previous value of ErrorReportingType.
      Specified by:
      errorReportingType in interface MSRInterface
      Parameters:
      type - New ErrorReportingType value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • parseDecodeData

      public void parseDecodeData(boolean flag) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting ParseDecodeData. Can be overwritten within derived classes, if necessary. If ParseDecodeData becomes true, DecodeData will be set to rue as well. This method will be called only if the following plausibility checks lead to a positive result:
      • Device has not been closed,
      • internal property AllowAlwaysSetProperties is true or flag equals the previous value of ParseDecodeData.
      Specified by:
      parseDecodeData in interface MSRInterface
      Parameters:
      flag - New ParseDecodeData value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tracksToRead

      public void tracksToRead(int t2r) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of setting TracksToRead. 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 has not been closed,
      • Track to be read specifies a combination of up to 4 tracks,
      • internal property AllowAlwaysSetProperties is true or t2r equals the previous value of TracksToRead.
      Specified by:
      tracksToRead in interface MSRInterface
      Parameters:
      t2r - New TracksToRead value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • authenticateDevice

      public void authenticateDevice(byte[] response) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of AuthenticateDevice 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,
      • CapDeviceAuthentication is not MSR_DA_NOT_SUPPORTED.
      Specified by:
      authenticateDevice in interface MSRInterface
      Parameters:
      response - see UPOS specification, method AuthenticateDevice
      Throws:
      jpos.JposException - See UPOS specification, method AuthenticateDevice
    • deauthenticateDevice

      public void deauthenticateDevice(byte[] response) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of DeauthenticateDevice 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,
      • CapDeviceAuthentication is not MSR_DA_NOT_SUPPORTED.
      Specified by:
      deauthenticateDevice in interface MSRInterface
      Parameters:
      response - see UPOS specification, method DeauthenticateDevice
      Throws:
      jpos.JposException - See UPOS specification, method DeauthenticateDevice
    • retrieveCardProperty

      public void retrieveCardProperty(String name, String[] value) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of RetrieveCardProperty 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,
      • CapDeviceAuthentication is not MSR_DA_NOT_SUPPORTED,
      • The given name must match one of the names specified in CardPropertyList,
      • The value argument is an array of length 1.
      Specified by:
      retrieveCardProperty in interface MSRInterface
      Parameters:
      name - see UPOS specification, method RetrieveCardProperty
      value - see UPOS specification, method RetrieveCardProperty
      Throws:
      jpos.JposException - See UPOS specification, method RetrieveCardProperty
    • retrieveDeviceAuthenticationData

      public void retrieveDeviceAuthenticationData(byte[][] challenge) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of RetrieveDeviceAuthenticationData 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,
      • CapDeviceAuthentication is not MSR_DA_NOT_SUPPORTED,
      • The challenge argument is an array of length 1.
      Specified by:
      retrieveDeviceAuthenticationData in interface MSRInterface
      Parameters:
      challenge - see UPOS specification, method RetrieveDeviceAuthenticationData
      Throws:
      jpos.JposException - See UPOS specification, method RetrieveDeviceAuthenticationData
    • updateKey

      public void updateKey(String key, String keyName) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of UpdateKey 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,
      • CapDeviceAuthentication is not MSR_DA_NOT_SUPPORTED.
      Specified by:
      updateKey in interface MSRInterface
      Parameters:
      key - see UPOS specification, method UpdateKey
      keyName - see UPOS specification, method UpdateKey
      Throws:
      jpos.JposException - See UPOS specification, method UpdateKey
    • writeTracks

      public void writeTracks(byte[][] data, int timeout) throws jpos.JposException
      Description copied from interface: MSRInterface
      Final part of WriteTracks 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,
      • Argument data is an array of 4 non-null byte arrays,
      • CapWritableTracks is not MSR_TR_NONE,
      • All non-writable tracks have been specified as zero-length byte array.
      Specified by:
      writeTracks in interface MSRInterface
      Parameters:
      data - see UPOS specification, method WriteTracks
      timeout - see UPOS specification, method WriteTracks
      Throws:
      jpos.JposException - See UPOS specification, method WriteTracks