-
Notifications
You must be signed in to change notification settings - Fork 2
Release 3.0.0
This release contains support for device class PointCardRW to complete support for all device classes specified in UPOS 1.15.
In addition, all device classes supported by jpos 1.15 have been prepared to work with jpos 1.16 as well. Therefore, a specific jar file - Jpos116Dummy.jar - has been provided: It contains a JavaPOS 1.16 implementation for device classes Lights and POSPower as well as the corresponding interfaces LightsConst and POSPowerConst. Until an official implementation for jpos 1.16 will become available, this should be enough because Lights and POSPower are the only device classes that have been changed since jpos 1.15.
To ensure that these implementations override the corresponding implementations of jpos1.15, this jar file must be within the class path before the jpos 1.15 jar file. When an official jpos 1.16 jar file will be available, Jpos116Dummy.jar should be removed from the class path.
Validation concept for POSPrinter, LineDisplay and PointCardRW has been changes slightly.
Due to a conversation with several members of OMG (Object Management Group, the UPOS standardization organization), it remains vendor specific how string representations of currency values must be made. For OPOS and POS for .NET, the situation seems to be clear: The string representation of 123.45 is "123.45" (perhaps with additional trailing zeroes). For JavaPOS, the situation is a little bit different: A Currency value of 123.45, stored within a variable of type long, is represented by a long value of 1234500. Therefore, some vendors provide a string representation of "1234500" for the currency value 123.45, while other vendors use the same string representation as OPOS and POS for .NET - "123.45" (perhaps with additional trailing zeroes).
This seems to be only a problem within FiscalPrinter class devices (for all known implementations of CAT and ElectronicValueRW service objects, string representations represent the currency value, not the internal integer representation), therefore a few new methods have be added to FiscalPrinterInterface that allow easier data exchange between the corresponding service and the device implementation: getData with data parameter of type long[] to store currency values and of type int[] to store numbers or counters, getTotalizer with data parameter of type long[] to store currency values and printRecPackageAdjustment and printRecPackageAdjustVoid with additional parameter parsedAdjustments of type Map<Integer,Number> which holds the adjustment amounts with the corresponding vat ids as key. Even if default implementations exist for backward compatibility, it is strictly recommended for implementations based on JavaPOS-SPF to use the new methods to avoid problems due to miss-interpretation of currency values passed in strings.
In addition, event handling did not follow the FIFO (first in - first out) principle strictly: In previous versions, JavaPOS-SPF used separate queues for status update events, data and input error events, output complete and output error events and transition events. Direct IO events could be handled by any of the other event queues. Since the corresponding event handlers worked in separate threads independent from each other, it could happen that an event fired after another event was delivered before, for example, if FreezeEvents was true while both events have been fired and after FreezeEvents has been set to false, the event handler handling the queue of the first event continued delivery after the event handler handling the queue of the second event. Therefore, the event handler has been changed to be able to follow the FIFO principle strictly (if StrictFIFOEventHandling will be set to true in jpos.xml) or with an exception for data and input error events (which can be bypassed by other events only while DataEventEnabled is false).
Furthermore, the UniqueIOProcessor class and the SerialIOAdapter class implement the AutoCloseable interface to support try-with-resources as specified for Java 7.
Class SSLClientIOProcessor has been added to support communication with secure socket services in addition to other IO processors for TCP, UDP and serial (COM port) communication.