Class CmsBroadcast

java.lang.Object
org.opencms.main.CmsBroadcast
All Implemented Interfaces:
Cloneable

public class CmsBroadcast extends Object implements Cloneable
A single broadcast message, send from one OpenCms user to another.

To addess a broadcast to another user, it must be placed in the broadcast queue of that user using for example CmsSessionManager.sendBroadcast(CmsUser, String, CmsUser).

Since:
6.0.0
  • Field Details

    • DISPLAY_AGAIN_TIME

      public static long DISPLAY_AGAIN_TIME
      Time interval between displays of repeated messages.
  • Constructor Details

    • CmsBroadcast

      @Deprecated public CmsBroadcast(CmsUser sender, String message)
      Deprecated.
      use the constructors with the content mode instead
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
    • CmsBroadcast

      @Deprecated public CmsBroadcast(CmsUser sender, String message, boolean repeat)
      Deprecated.
      use the constructors with the content mode instead
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
      repeat - true if message shoul be repeated
    • CmsBroadcast

      public CmsBroadcast(CmsUser sender, String message, boolean repeat, CmsBroadcast.ContentMode mode)
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
      repeat - true if message should be repeated
      mode - the content mode
    • CmsBroadcast

      public CmsBroadcast(CmsUser sender, String message, CmsBroadcast.ContentMode mode)
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
      mode - the content mode
    • CmsBroadcast

      @Deprecated public CmsBroadcast(CmsUser sender, String message, long sendTime, long lastDisplay, boolean repeat)
      Deprecated.
      use the constructors with the content mode instead
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
      sendTime - time when broadcast initaly was send
      lastDisplay - last display time
      repeat - true if message should be repeated
    • CmsBroadcast

      @Deprecated public CmsBroadcast(CmsUser sender, String message, long sendTime, long lastDisplay, boolean repeat, CmsBroadcast.ContentMode mode)
      Deprecated.
      Creates a new broadcast, with the current system time set as send time.

      Parameters:
      sender - the sender of the broadcast
      message - the message to send
      sendTime - time when broadcast initaly was send
      lastDisplay - last display time
      repeat - true if the message should be repeated
      mode - the content mode
  • Method Details

    • getContentMode

      Gets the content mode.
      Returns:
      the content mode
    • getLastDisplay

      public long getLastDisplay()
      Gets the last display time.
      Returns:
      the last display time
    • getMessage

      public String getMessage()
      Returns the processed broadcast message content as HTML.
      Returns:
      the broadcast message content HTML
    • getRawMessage

      Returns the original message text passed in the constructor.
      Returns:
      the original message text
    • getSendTime

      public long getSendTime()
      Returns the time this broadcast was send.

      Returns:
      the time this broadcast was send
    • getUser

      public CmsUser getUser()
      Returns the user that was the sender of this broadcast.

      It could be null to signalize a system message.

      Returns:
      the user that was the sender of this broadcast
    • isRepeat

      public boolean isRepeat()
      Returns true if this is a repeating message.
      Returns:
      true if this is a repeating message
    • withLastDisplay

      public CmsBroadcast withLastDisplay(long lastDisplay)
      Produces a copy of this object, but with a changed lastDisplay attribute.
      Parameters:
      lastDisplay - the new value for the lastDisplay attribute
      Returns:
      the copy with the modified time