Records a deferred recognition level notification for one participant, either a close-to-level warning or an achieved-level announcement. The kind is held in notificationType, which is closeToLevel or achievedLevel. Detection creates the row with a scheduledFireDate in the future rather than notifying immediately, so that a participant whose level is still moving is only told about the level they settle on. A poller later re-validates the condition and either fires the notification event, setting firedDate, or cancels it, setting cancelledDate and cancelReason.

Group: Database Entities

Implements: Serializable, Relational


Properties

PropertyReturnsDescription
adminDomainOrganisationThe organisation which owns this notification, used to scope polling to a single account and to a cluster. Never null.
awardedToBaseEntityThe participant the notification is for. Recognition can be awarded to either a profile or an organisation, so this is the common base type of both. Never null.
cancelledDateDateWhen the notification was cancelled instead of fired, because re-validation found the condition no longer held, or null if it was not cancelled.
cancelReasonStringHuman readable explanation of why the notification was cancelled, taken from the cancel reason constants on this class, for example that the level was reached or that the participant dropped below the notification threshold. Null unless the notification was cancelled.
createdDateDateWhen detection queued this notification, which is not when the participant is told - firedDate records that. Never null.
firedDateDateWhen the notification event was actually fired, or null while it is still pending. A row with neither a firedDate nor a cancelledDate is pending; the two are mutually exclusive because firing is claimed atomically.
idlongUnique database identifier for this notification record.
notificationTypeStringWhich kind of notification this is: closeToLevel when the participant got within the configured percentage of the next level, or achievedLevel when they reached a level. Null on rows created before achieved-level notifications existed, which are treated as closeToLevel, so test the value with isType rather than comparing it directly.
percentAtDetectionBigDecimalHow close, as a percentage of the way to the next level, the participant was when the notification was queued. Only set for close-to-level notifications; null for achieved-level ones. The value is a snapshot from detection time and is not refreshed when the notification fires.
periodRecognitionPeriodThe recognition period this notification belongs to, for topics which reset each period. Null for non-periodic topics, and searches never mix periods, so a scan of one period cannot disturb another period's pending notifications.
recognitionRecognitionLevelThe level this notification is about: for a close-to-level notification the level being approached, and for an achieved-level notification the level that was reached. Never null.
scheduledFireDateDateThe earliest time the poller may re-check this notification and fire it. The delay between creation and this date is the settling window that lets a participant's level stop moving before they are notified. Never null.
topicRecognitionTopicThe recognition topic whose levels this notification relates to. The topic's settings decide whether close-to-level and achieved-level notifications are enabled at all, so a notification can be cancelled if they are turned off before it fires. Never null.

Methods

getId() · getAdminDomain() · getTopic() · getRecognition() · getAwardedTo() · getPeriod() · getPercentAtDetection() · getNotificationType() · isType(String type) · getCreatedDate() · getScheduledFireDate() · getFiredDate() · getCancelledDate() · getCancelReason()

getId()

Returns: long

Unique database identifier for this notification record.

getAdminDomain()

Returns: Organisation

The organisation which owns this notification, used to scope polling to a single account and to a cluster. Never null.

getTopic()

Returns: RecognitionTopic

The recognition topic whose levels this notification relates to. The topic's settings decide whether close-to-level and achieved-level notifications are enabled at all, so a notification can be cancelled if they are turned off before it fires. Never null.

getRecognition()

Returns: RecognitionLevel

The level this notification is about: for a close-to-level notification the level being approached, and for an achieved-level notification the level that was reached. Never null.

getAwardedTo()

Returns: BaseEntity

The participant the notification is for. Recognition can be awarded to either a profile or an organisation, so this is the common base type of both. Never null.

getPeriod()

Returns: RecognitionPeriod

The recognition period this notification belongs to, for topics which reset each period. Null for non-periodic topics, and searches never mix periods, so a scan of one period cannot disturb another period's pending notifications.

getPercentAtDetection()

Returns: BigDecimal

How close, as a percentage of the way to the next level, the participant was when the notification was queued. Only set for close-to-level notifications; null for achieved-level ones. The value is a snapshot from detection time and is not refreshed when the notification fires.

getNotificationType()

Returns: String

Which kind of notification this is: closeToLevel when the participant got within the configured percentage of the next level, or achievedLevel when they reached a level. Null on rows created before achieved-level notifications existed, which are treated as closeToLevel, so test the value with isType rather than comparing it directly.

isType(String type)

Returns: boolean

Whether this notification is of the given type, treating a null notificationType as closeToLevel so rows created before achieved-level notifications existed keep working without a backfill. Use this in preference to comparing getNotificationType directly.

ParameterDescription
typeone of the type constants, closeToLevel or achievedLevel

getCreatedDate()

Returns: Date

When detection queued this notification, which is not when the participant is told - firedDate records that. Never null.

getScheduledFireDate()

Returns: Date

The earliest time the poller may re-check this notification and fire it. The delay between creation and this date is the settling window that lets a participant's level stop moving before they are notified. Never null.

getFiredDate()

Returns: Date

When the notification event was actually fired, or null while it is still pending. A row with neither a firedDate nor a cancelledDate is pending; the two are mutually exclusive because firing is claimed atomically.

getCancelledDate()

Returns: Date

When the notification was cancelled instead of fired, because re-validation found the condition no longer held, or null if it was not cancelled.

getCancelReason()

Returns: String

Human readable explanation of why the notification was cancelled, taken from the cancel reason constants on this class, for example that the level was reached or that the participant dropped below the notification threshold. Null unless the notification was cancelled.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.