Package de.gmxhome.conrad.jpos.jpos_base
Class JposStatusUpdateEvent
java.lang.Object
java.util.EventObject
jpos.events.JposEvent
jpos.events.StatusUpdateEvent
de.gmxhome.conrad.jpos.jpos_base.JposStatusUpdateEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BeltStatusUpdateEvent
,BillAcceptorStatusUpdateEvent
,BillDispenserStatusUpdateEvent
,BiometricsStatusUpdateEvent
,CashChangerStatusUpdateEvent
,CashDrawerStatusUpdateEvent
,CATStatusUpdateEvent
,CheckScannerStatusUpdateEvent
,CoinAcceptorStatusUpdateEvent
,CoinDispenserStatusUpdateEvent
,DelayedStatusUpdateEvent
,DeviceMonitorStatusUpdateEvent
,ElectronicJournalStatusUpdateEvent
,ElectronicValueRWStatusUpdateEvent
,FiscalPrinterStatusUpdateEvent
,GateStatusUpdateEvent
,GestureControlStatusUpdateEvent
,GraphicDisplayStatusUpdateEvent
,ItemDispenserStatusUpdateEvent
,KeylockStatusUpdateEvent
,MSRStatusUpdateEvent
,PointCardRWStatusUpdateEvent
,POSPowerStatusUpdateEvent
,POSPrinterStatusUpdateEvent
,ScaleStatusUpdateEvent
,SmartCardRWStatusUpdateEvent
,SoundPlayerStatusUpdateEvent
,SoundRecorderStatusUpdateEvent
,SpeechSynthesisStatusUpdateEvent
,UnitStatusUpdateEvent
,VideoCaptureStatusUpdateEvent
,VoiceRecognitionStatusUpdateEvent
public class JposStatusUpdateEvent
extends jpos.events.StatusUpdateEvent
Status update event with method to fill status properties.
The default implementation for event handling does not handle instances of StatusUpdateEvent, it handles only
instances of JposStatusUpdateEvent instead.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class jpos.events.StatusUpdateEvent
status
Fields inherited from class jpos.events.JposEvent
sequenceNumber
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionJposStatusUpdateEvent(JposBase source, int state)
Constructor, Parameters passed to base class unchanged. -
Method Summary
Modifier and TypeMethodDescriptionboolean
block()
Checks whether event must be blocked due to missing or delayed status support.boolean
Checks if the device state corresponds to the event status.Creates copy of given event for a different property set.Returns property set bound to the event source.Object[]
getPropertyValues(String[] properties)
Retrieves the values of a given set of properties.boolean
propertiesHaveBeenChanged(String[] properties, Object[] oldproperties)
Checks whether properties specified by name have been changed.boolean
Sets status properties and checks whether status properties have been changed.void
Sets those properties that shall be set immediately before the event will be fired to the application.void
setStatus(int newstate)
Sets Status property to the given value.boolean
Set status properties to reflect the given status.Generates string describing the data event for logging purposes.Methods inherited from class jpos.events.StatusUpdateEvent
getStatus
Methods inherited from class jpos.events.JposEvent
getSequenceNumber, getWhen, incrSequenceNumber, updateSequenceNumber
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
JposStatusUpdateEvent
Constructor, Parameters passed to base class unchanged.- Parameters:
source
- Source, for services implemented with this framework, the (deviceclass.)DeviceClassService object.state
- Status, see UPOS specification.
-
-
Method Details
-
copyEvent
Creates copy of given event for a different property set. Needed for shareable devices only.- Parameters:
source
- Source (JposDevice) of the event- Returns:
- Copy of the event to be handled by the given source.
-
setStatusProperties
public boolean setStatusProperties()Set status properties to reflect the given status. These properties must be set immediately before the event is buffered into the event queue.- Returns:
- true, if properties have been updated, false otherwise
-
setAndCheckStatusProperties
public boolean setAndCheckStatusProperties()Sets status properties and checks whether status properties have been changed. If so, logs status change.- Returns:
- true if state might have been really changed, false otherwise.
-
propertiesHaveBeenChanged
Checks whether properties specified by name have been changed. Works for all basic type properties (String, int, long) and array type properties (byte[]).- Parameters:
properties
- Array of property names.oldproperties
- Array of the corresponding property values before possible change.- Returns:
- true if at least one of the given property values differs from its corresponding current value.
-
getPropertyValues
Retrieves the values of a given set of properties. The names of the properties to be retrieved will be passed as an array of String. The corresponding values will be returned in an array of Object with the same size (or size 0 if properties is null), in the same order. For example, if properties is {"Status", "Result"}, the returned array is { value of Status, value of Result}. If a property does not exist, "[error]" will be stored in the corresponding place within the returned array.- Parameters:
properties
- Array of names of properties to be retrieved.- Returns:
- Array of property values.
-
setLateProperties
public void setLateProperties()Sets those properties that shall be set immediately before the event will be fired to the application. Should be used for properties with a relationship to the event. For pure status values, use method setStatusProperties instead. -
checkStatusCorresponds
public boolean checkStatusCorresponds()Checks if the device state corresponds to the event status.- Returns:
- true if device state corresponds to event state, false otherwise.
-
block
public boolean block()Checks whether event must be blocked due to missing or delayed status support. Currently power status update events will be blocked if PowerNotify is disabled.- Returns:
- true if event must be blocked.
-
toLogString
Generates string describing the data event for logging purposes.- Returns:
- Describing string.
-
getPropertySet
Returns property set bound to the event source.- Returns:
- Property set.
-
setStatus
public void setStatus(int newstate)Sets Status property to the given value. ATTENTION: This implementation might fail if jpos114.jar is replaced by a newer version when the name of the protected status field changes.- Parameters:
newstate
- New status value.
-