Package com.pnfsoftware.jeb.core.units
Class UnitNotification
java.lang.Object
com.pnfsoftware.jeb.core.units.UnitNotification
- All Implemented Interfaces:
IUnitNotification
Standard implementation of a notification.
-
Constructor Summary
ConstructorsConstructorDescriptionGeneric copy constructor.UnitNotification(NotificationType type, String description) Create a notification.UnitNotification(NotificationType type, String description, String address) Create a notification.UnitNotification(NotificationType type, String description, String address, String key) Create a notification. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the optional address of this notification, if relevant.Get a custom description of the notification.getKey()Retrieve the notification key (or name).longRetrieve the creation timestamp of this notification.getType()Get the notification type.toString()
-
Constructor Details
-
UnitNotification
Create a notification.- Parameters:
type- mandatory typedescription- optional description stringaddress- optional address, useful forinteractive unitskey- unique key; if null, a random key will be generated and assigned to the notification
-
UnitNotification
Create a notification. A random key will be generated and assigned to the notification.- Parameters:
type- mandatory typedescription- optional description stringaddress- optional address, useful forinteractive units
-
UnitNotification
Create a notification. A random key will be generated and assigned to the notification.- Parameters:
type- mandatory typedescription- optional description string
-
UnitNotification
Generic copy constructor.- Parameters:
src-
-
-
Method Details
-
getType
Description copied from interface:IUnitNotificationGet the notification type.- Specified by:
getTypein interfaceIUnitNotification- Returns:
- the non-null type
-
getDescription
Description copied from interface:IUnitNotificationGet a custom description of the notification. This comes as a complement of the type, if necessary.- Specified by:
getDescriptionin interfaceIUnitNotification- Returns:
- an optional description string
-
getAddress
Description copied from interface:IUnitNotificationRetrieve the optional address of this notification, if relevant. If the unit does support addressing (ie, the unit implementsIAddressableUnit), that field may be used by clients for easy navigation to the location of interest.- Specified by:
getAddressin interfaceIUnitNotification- Returns:
- the optional address
-
getKey
Description copied from interface:IUnitNotificationRetrieve the notification key (or name). For a given unit, only one notification with a given key may exist; adding a notification will erase a previously existing one.- Specified by:
getKeyin interfaceIUnitNotification- Returns:
-
getTimestampMs
public long getTimestampMs()Description copied from interface:IUnitNotificationRetrieve the creation timestamp of this notification.- Specified by:
getTimestampMsin interfaceIUnitNotification- Returns:
-
toString
-