Class PublishedMessageTracker

java.lang.Object
com.reallifedeveloper.common.infrastructure.persistence.BaseJpaEntity<Long>
com.reallifedeveloper.common.application.notification.PublishedMessageTracker

@Entity public class PublishedMessageTracker extends BaseJpaEntity<Long>
Keeps track of the most recently published message on a certain publication channel.

The publication channel can, for example, be an exchange in a messaging system.

Author:
RealLifeDeveloper
  • Constructor Summary

    Constructors
    Constructor
    Description
    PublishedMessageTracker(long lastPublishedMessageId, String publicationChannel)
    Creates a new PublishedMessageTracker with the id of the most recently published message on the given publication channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gives the id of the most recently published message on the publication channel associated with this PublishedMessageTracker.
    Gives the name of the publication channel for this PublishedMessageTracker.
    void
    setLastPublishedMessageid(long newLastPublishedMessageId)
    Sets the id of the most recently published message on the publication channel associated with this PublishedMessageTracker.

    Methods inherited from class com.reallifedeveloper.common.infrastructure.persistence.BaseJpaEntity

    finalize, id

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PublishedMessageTracker

      public PublishedMessageTracker(long lastPublishedMessageId, String publicationChannel)
      Creates a new PublishedMessageTracker with the id of the most recently published message on the given publication channel.
      Parameters:
      lastPublishedMessageId - the id of the most recently published message on the publication channel
      publicationChannel - the name of the publication channel, e.g., the name of an exchange in a messaging system
  • Method Details

    • lastPublishedMessageId

      public Long lastPublishedMessageId()
      Gives the id of the most recently published message on the publication channel associated with this PublishedMessageTracker.
      Returns:
      the id of the most recently published message
    • setLastPublishedMessageid

      public void setLastPublishedMessageid(long newLastPublishedMessageId)
      Sets the id of the most recently published message on the publication channel associated with this PublishedMessageTracker.
      Parameters:
      newLastPublishedMessageId - the new id of the most recently published message
    • publicationChannel

      public String publicationChannel()
      Gives the name of the publication channel for this PublishedMessageTracker.
      Returns:
      the name of the publication channel