Class POSPowerStatusUpdateEvent
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.pospower.POSPowerStatusUpdateEvent
- All Implemented Interfaces:
Serializable
Status update event implementation for POSPower devices.
- 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
ConstructorsConstructorDescriptionPOSPowerStatusUpdateEvent(JposBase source, int state)
Constructor, Parameters passed to base class unchanged.POSPowerStatusUpdateEvent(JposBase source, int state, int add)
Constructor, Parameters source and state passed to base class unchanged.POSPowerStatusUpdateEvent(JposBase source, POSPowerStatusUpdateEvent ev)
Constructor, used by copyEvent to create a copy of this with changed source only. -
Method Summary
Modifier and TypeMethodDescriptionboolean
block()
Blocks event if derived class would block it and if status is BAT_CRITICAL or BAT_LOW and the corresponding property, BatteryCriticallyLowThreshold or BatteryLowThreshold is 0.boolean
Checks if the device state corresponds to the event status.Creates copy of given event for a different property set.boolean
Sets status properties and checks whether status properties have been changed.boolean
Set status properties to reflect the given status.Generates string describing the data event for logging purposes.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposStatusUpdateEvent
getPropertySet, getPropertyValues, propertiesHaveBeenChanged, setLateProperties, setStatus
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
-
POSPowerStatusUpdateEvent
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.
-
POSPowerStatusUpdateEvent
Constructor, Parameters source and state passed to base class unchanged. Parameter add consists of additional information about the status change, e.g. power source or current battery capacity.- Parameters:
source
- Source, for services implemented with this framework, the (deviceclass.)DeviceClassService object.state
- Status, see UPOS specification.add
- Additional data specifying detail of status change.
-
POSPowerStatusUpdateEvent
Constructor, used by copyEvent to create a copy of this with changed source only.- Parameters:
source
- New event source.ev
- Event to be copied.
-
-
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 classJposStatusUpdateEvent
- Parameters:
o
- Source (JposDevice) of the event- Returns:
- Copy of the event to be handled by the given source.
-
setStatusProperties
public boolean setStatusProperties()Description copied from class:JposStatusUpdateEvent
Set status properties to reflect the given status. These properties must be set immediately before the event is buffered into the event queue.- Overrides:
setStatusProperties
in classJposStatusUpdateEvent
- Returns:
- true, if properties have been updated, false otherwise
-
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.
-
block
public boolean block()Blocks event if derived class would block it and if status is BAT_CRITICAL or BAT_LOW and the corresponding property, BatteryCriticallyLowThreshold or BatteryLowThreshold is 0.- Overrides:
block
in classJposStatusUpdateEvent
- Returns:
- true If event shall be blocked, otherwise false.
-
toLogString
Description copied from class:JposStatusUpdateEvent
Generates string describing the data event for logging purposes.- Overrides:
toLogString
in classJposStatusUpdateEvent
- Returns:
- Describing string.
-