Package SampleElectronicValueRW
Class Device
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
de.gmxhome.conrad.jpos.jpos_base.JposDevice
SampleElectronicValueRW.Device
- All Implemented Interfaces:
Runnable
Base of a JposDevice based implementation of JavaPOS ElectronicValueRW device service implementations for the
sample device implemented in SampleCAT.tcl. The sample device simulates EFT payment transactions without ticket
printing (the simulator sends ticket and display data to its target).
Supported features are:
Transition events with EventNumber TE_CONFIRM_DEVICE_DATA will be used to request the ticket printer state. The application must set AdditionalSecurityInformation to "0" if ticket printing is possible, to "1" if ticket printing is currently not available and to "2" if ticket printing is not supported. If not an empty string, Ticket data will be passed directly via property pString. If pString is an empty string, only the ticket printing state is requested. In synchronous mode, ticket data will be written to property AdditionalSecurityInformation.
Even if passed via TransitionEvent or via AdditionalSecurityInformation, the format of ticket data is of the form
In case of a signature based operation, a TransitionEvent with EventNumber TE_CONFIRM_CANCEL will be fired. The application must change the event property pData to 1 to cancel the operation or to 0 to finish the operation successfully.
In case of synchronous operation, no TransitionEvent event with EventNumber TE_CONFIRM_CANCEL can be fired. In this case, ticket data part count = 2 implies that validation must be performed afterwards. If validation fails, the transaction must be voided.
Here a full list of all device specific properties that can be changed via jpos.xml:
Supported features are:
- Sale, refund and void.
- Start transaction before amount to approve is known.
- Confirmation in case of signature based approval.
- Lock / unlock terminal.
- Card issuer, transaction number, transaction date, tip, approved amount, approval result, terminal result, masked card number (last 4 digit readable), expiration date sent in case of successful operation.
- Display output will be used to generate specific TransitionEvent events.
- Ticket layout will be passed to the application via TransitionEvent events.
- In synchronous mode, passing display data to the application and operator confirmation in case of signature based authorizations will not be possible. The service will expect a positive confirmation whenever needed.
Transition events with EventNumber TE_CONFIRM_DEVICE_DATA will be used to request the ticket printer state. The application must set AdditionalSecurityInformation to "0" if ticket printing is possible, to "1" if ticket printing is currently not available and to "2" if ticket printing is not supported. If not an empty string, Ticket data will be passed directly via property pString. If pString is an empty string, only the ticket printing state is requested. In synchronous mode, ticket data will be written to property AdditionalSecurityInformation.
Even if passed via TransitionEvent or via AdditionalSecurityInformation, the format of ticket data is of the form
sequenceNo STX count STX ticket datawhere sequenceNo is the sequence number of the current operation, count specifies the number of tickets to be printed (if two, one ticket must be signed by the customer and verified by the user) and ticket dataspecifies the ticket data to be printed, with LF (0Ah) as line separator. STX (02h) will be used as delimiter between count, sequenceNo and ticket data.
In case of a signature based operation, a TransitionEvent with EventNumber TE_CONFIRM_CANCEL will be fired. The application must change the event property pData to 1 to cancel the operation or to 0 to finish the operation successfully.
In case of synchronous operation, no TransitionEvent event with EventNumber TE_CONFIRM_CANCEL can be fired. In this case, ticket data part count = 2 implies that validation must be performed afterwards. If validation fails, the transaction must be voided.
Here a full list of all device specific properties that can be changed via jpos.xml:
- CharacterTimeout: Positive integer value, specifying the maximum delay between bytes that belong to the same frame. Default value: 50 milliseconds.
- ClientPort: Integer value between 0 and 65535 specifying the TCP port used for communication with the device simulator. Default: 0 (for random port number selected by operating system).
- MinClaimTimeout: Minimum timeout in milliseconds used by method Claim to ensure correct working. Must be a positive value. If this value is too small, Claim might throw a JposException even if everything is OK if the specified timeout is less than or equal to MinClaimTimeout. Default: 100.
- PollDelay: The interval for printer status polling if response is "1" (currently not available), default: 200.
- Port: The IPv4 address of the device. Must always be specified and not empty. Notation: address:port, where address is a IPv4 address and port the TCP port of the device.
- RequestTimeout: Maximum time the service object waits for the reception of a response frame after sending a request to the target, in milliseconds. Default: 1000.
- TicketWidth: Length of one ticket line passed vie TransitionEvent. Must be a value between 28 and 99 (inclusive). Default: 32.
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
Belts, BillAcceptors, BillDispensers, Biometricss, BumpBars, CashChangers, CashDrawers, CATs, CheckScanners, ClaimedBelt, ClaimedBillAcceptor, ClaimedBillDispenser, ClaimedBiometrics, ClaimedBumpBar, ClaimedCashChanger, ClaimedCashDrawer, ClaimedCAT, ClaimedCheckScanner, ClaimedCoinAcceptor, ClaimedCoinDispenser, ClaimedDeviceMonitor, ClaimedElectronicJournal, ClaimedElectronicValueRW, ClaimedFiscalPrinter, ClaimedGate, ClaimedGestureControl, ClaimedGraphicDisplay, ClaimedHardTotals, ClaimedImageScanner, ClaimedIndividualRecognition, ClaimedItemDispenser, ClaimedKeylock, ClaimedLights, ClaimedLineDisplay, ClaimedMICR, ClaimedMotionSensor, ClaimedMSR, ClaimedPINPad, ClaimedPointCardRW, ClaimedPOSKeyboard, ClaimedPOSPower, ClaimedPOSPrinter, ClaimedRemoteOrderDisplay, ClaimedRFIDScanner, ClaimedScale, ClaimedScanner, ClaimedSignatureCapture, ClaimedSmartCardRW, ClaimedSoundPlayer, ClaimedSoundRecorder, ClaimedSpeechSynthesis, ClaimedToneIndicator, ClaimedVideoCapture, ClaimedVoiceRecognition, CoinAcceptors, CoinDispensers, DeviceMonitors, ElectronicJournals, ElectronicValueRWs, FiscalPrinters, Gates, GestureControls, GraphicDisplays, HardTotalss, ImageScanners, IndividualRecognitions, ItemDispensers, Keylocks, Lightss, LineDisplays, MICRs, MotionSensors, MSRs, PINPads, PointCardRWs, POSKeyboards, POSPowers, POSPrinters, RemoteOrderDisplays, RFIDScanners, Scales, Scanners, SignatureCaptures, SmartCardRWs, SoundPlayers, SoundRecorders, SpeechSynthesiss, ToneIndicators, VideoCaptures, VoiceRecognitions
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
AllowAlwaysSetProperties, AsyncProcessorRunning, CapCompareFirmwareVersion, CapPowerReporting, CapUpdateFirmware, CurrentCommand, DrawerBeepVolume, ID, JposVersion, Log, LogFilePath, LogFilePattern, LoggerFormat, LoggerName, LogLevel, MaxArrayStringElements, MaximumConfirmationEventWaitingTime, PendingCommands, PhysicalDeviceDescription, PhysicalDeviceName, SerialIOAdapterClass, StrictFIFOEventHandling
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Cesar's encryption: Simply add keyValue to each character for encryption.void
Change defaults of properties.void
checkProperties(jpos.config.JposEntry entry)
Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver valuegetElectronicValueRWProperties(int index)
Returns device implementation of ElectronicValueRWProperties.void
run()
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposDevice
beltInit, billAcceptorInit, billDispenserInit, biometricsInit, bumpBarInit, cashChangerInit, cashDrawerInit, cATInit, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, changeDefaults, checkScannerInit, coinAcceptorInit, coinDispenserInit, deviceMonitorInit, electronicJournalInit, electronicValueRWInit, fiscalPrinterInit, gateInit, gestureControlInit, getArrayOf, getBeltProperties, getBillAcceptorProperties, getBillDispenserProperties, getBiometricsProperties, getBumpBarProperties, getCashChangerProperties, getCashDrawerProperties, getCATProperties, getCheckScannerProperties, getCoinAcceptorProperties, getCoinDispenserProperties, getDeviceMonitorProperties, getElectronicJournalProperties, getFiscalPrinterProperties, getGateProperties, getGestureControlProperties, getGraphicDisplayProperties, getHardTotalsProperties, getImageScannerProperties, getIndividualRecognitionProperties, getItemDispenserProperties, getKeylockProperties, getLightsProperties, getLineDisplayProperties, getMICRProperties, getMotionSensorProperties, getMSRProperties, getPINPadProperties, getPointCardRWProperties, getPOSKeyboardProperties, getPOSPowerProperties, getPOSPrinterProperties, getRemoteOrderDisplayProperties, getRFIDScannerProperties, getScaleProperties, getScannerProperties, getSignatureCaptureProperties, getSmartCardRWProperties, getSoundPlayerProperties, getSoundRecorderProperties, getSpeechSynthesisProperties, getToneIndicatorProperties, getVideoCaptureProperties, getVoiceRecognitionProperties, graphicDisplayInit, hardTotalsInit, imageScannerInit, individualRecognitionInit, itemDispenserInit, keylockInit, lightsInit, lineDisplayInit, mICRInit, motionSensorInit, mSRInit, noOfPropertySets, pINPadInit, pointCardRWInit, pOSKeyboardInit, pOSPowerInit, pOSPrinterInit, remoteOrderDisplayInit, rFIDScannerInit, scaleInit, scannerInit, signatureCaptureInit, smartCardRWInit, soundPlayerInit, soundRecorderInit, speechSynthesisInit, toneIndicatorInit, videoCaptureInit, voiceRecognitionInit
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposBaseDevice
check, checkext, checkMember, checkRange, concurrentProcessingSupported, createConcurrentRequestThread, delay, getClaimingInstance, getCount, getPropertySetInstance, getRequestRunnersRequest, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handleEvent, handlePowerStateOnEnable, invokeRequestThread, log, member, member, postDirectIOProcessing, postTransitionProcessing, prepareSignalStatusWaits, processEventList, removePropertySet, signalStatusWaits, stringArrayToLongArray, synchronizedMessageBox
-
Constructor Details
-
Device
Constructor. ID is the network address of the EFT (as ElectronicValueRW).- Parameters:
id
- Network address of the display controller.
-
-
Method Details
-
checkProperties
public void checkProperties(jpos.config.JposEntry entry) throws jpos.JposExceptionDescription copied from class:JposBaseDevice
Checks whether a JposEntry belongs to a predefined property value an if so, sets the corresponding driver value- Overrides:
checkProperties
in classJposBaseDevice
- Parameters:
entry
- Entry to be checked, contains value to be set- Throws:
jpos.JposException
- if a property value is invalid
-
changeDefaults
Description copied from class:JposDevice
Change defaults of properties. Must be implemented within derived classed that support electronic value reader / writer services.- Overrides:
changeDefaults
in classJposDevice
- Parameters:
props
- Property set for setting the property defaults
-
caesar
Cesar's encryption: Simply add keyValue to each character for encryption. For decryption, pass -keyValue.- Parameters:
s
- String to be encrypted or decrypted.keyValue
- Encryption key.- Returns:
- The encrypted text.
-
run
public void run() -
getElectronicValueRWProperties
Description copied from class:JposDevice
Returns device implementation of ElectronicValueRWProperties.- Overrides:
getElectronicValueRWProperties
in classJposDevice
- Parameters:
index
- Device index, see constructor of JposCommonProperties.- Returns:
- Instance of ElectronicValueRWProperties that matches the requirements of the corresponding device service.
-