Class MotionSensorStatusUpdateEvent
java.lang.Object
java.util.EventObject
jpos.events.JposEvent
jpos.events.StatusUpdateEvent
de.gmxhome.conrad.jpos.jpos_base.JposStatusUpdateEvent
de.gmxhome.conrad.jpos.jpos_base.DelayedStatusUpdateEvent
de.gmxhome.conrad.jpos.jpos_base.motionsensor.MotionSensorStatusUpdateEvent
- All Implemented Interfaces:
Serializable
,Runnable
Status update event implementation for MotionSensor devices.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.DelayedStatusUpdateEvent
CANCEL_FIRE, CANCEL_ONLY
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
ConstructorsConstructorDescriptionMotionSensorStatusUpdateEvent(JposBase source, int state)
Constructor, see JposStatusUpdateEvent -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the device state corresponds to the event status.Creates copy of given event for a different property set.long
This method must be implemented in derived classes.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.Generates string describing the data event for logging purposes.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.DelayedStatusUpdateEvent
block, run
Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposStatusUpdateEvent
getPropertySet, getPropertyValues, propertiesHaveBeenChanged, setStatus, setStatusProperties
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
-
MotionSensorStatusUpdateEvent
Constructor, see JposStatusUpdateEvent- Parameters:
source
- Source, for services implemented with this framework, the (motionsensor.)MotionSensorService object.state
- New status value, see UPOS specification, chapter Cash Drawer - Events - StatusUpdateEvent.
-
-
Method Details
-
copyEvent
Description copied from class:JposStatusUpdateEvent
Creates copy of given event for a different property set. Needed for shareable devices only.- Overrides:
copyEvent
in classDelayedStatusUpdateEvent
- Parameters:
o
- Source (JposDevice) of the event- Returns:
- Copy of the event to be handled by the given source.
-
setLateProperties
public void setLateProperties()Description copied from class:JposStatusUpdateEvent
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.- Overrides:
setLateProperties
in classJposStatusUpdateEvent
-
checkStatusCorresponds
public boolean checkStatusCorresponds()Description copied from class:JposStatusUpdateEvent
Checks if the device state corresponds to the event status.- Overrides:
checkStatusCorresponds
in classJposStatusUpdateEvent
- Returns:
- true if device state corresponds to event state, false otherwise.
-
setAndCheckStatusProperties
public boolean setAndCheckStatusProperties()Description copied from class:JposStatusUpdateEvent
Sets status properties and checks whether status properties have been changed. If so, logs status change.- Overrides:
setAndCheckStatusProperties
in classJposStatusUpdateEvent
- Returns:
- true if state might have been really changed, false otherwise.
-
toLogString
Description copied from class:JposStatusUpdateEvent
Generates string describing the data event for logging purposes.- Overrides:
toLogString
in classJposStatusUpdateEvent
- Returns:
- Describing string.
-
handleDelay
public long handleDelay()Description copied from class:DelayedStatusUpdateEvent
This method must be implemented in derived classes. It specifies how delayed events shall be handled.- Overrides:
handleDelay
in classDelayedStatusUpdateEvent
- Returns:
- 0 if event shall be fired immediately without affecting any delayed event.
Any value > 0 specifies the delay (in milliseconds) for firing this event (any previously buffered delayed event will not be fired).
CANCEL_ONLY specifies that this event shall only be fired immediately if no delayed event has been buffered previously. Otherwise, neither the buffered nor this event shall be fired.
CANCEL_FIRE specify that any buffered event shall not be fired. This event will be fired immediately.
-