Package org.opencms.main
Class CmsBroadcast
java.lang.Object
org.opencms.main.CmsBroadcast
- All Implemented Interfaces:
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The content mode describes how the text used for a broadcast message should be interpreted. -
Field Summary
Modifier and TypeFieldDescriptionstatic long
Time interval between displays of repeated messages. -
Constructor Summary
ConstructorDescriptionCmsBroadcast
(CmsUser sender, String message) Deprecated.use the constructors with the content mode insteadCmsBroadcast
(CmsUser sender, String message, boolean repeat) Deprecated.use the constructors with the content mode insteadCmsBroadcast
(CmsUser sender, String message, boolean repeat, CmsBroadcast.ContentMode mode) Creates a new broadcast, with the current system time set as send time.CmsBroadcast
(CmsUser sender, String message, long sendTime, long lastDisplay, boolean repeat) Deprecated.use the constructors with the content mode insteadCmsBroadcast
(CmsUser sender, String message, long sendTime, long lastDisplay, boolean repeat, CmsBroadcast.ContentMode mode) Deprecated.CmsBroadcast
(CmsUser sender, String message, CmsBroadcast.ContentMode mode) Creates a new broadcast, with the current system time set as send time. -
Method Summary
Modifier and TypeMethodDescriptionGets the content mode.long
Gets the last display time.Returns the processed broadcast message content as HTML.Returns the original message text passed in the constructor.long
Returns the time this broadcast was send.getUser()
Returns the user that was the sender of this broadcast.boolean
isRepeat()
Returns true if this is a repeating message.withLastDisplay
(long lastDisplay) Produces a copy of this object, but with a changed lastDisplay attribute.
-
Field Details
-
DISPLAY_AGAIN_TIME
Time interval between displays of repeated messages.
-
-
Constructor Details
-
CmsBroadcast
Deprecated.use the constructors with the content mode insteadCreates a new broadcast, with the current system time set as send time.- Parameters:
sender
- the sender of the broadcastmessage
- the message to send
-
CmsBroadcast
Deprecated.use the constructors with the content mode insteadCreates a new broadcast, with the current system time set as send time.- Parameters:
sender
- the sender of the broadcastmessage
- the message to sendrepeat
- true if message shoul be repeated
-
CmsBroadcast
Creates a new broadcast, with the current system time set as send time.- Parameters:
sender
- the sender of the broadcastmessage
- the message to sendrepeat
- true if message should be repeatedmode
- the content mode
-
CmsBroadcast
Creates a new broadcast, with the current system time set as send time.- Parameters:
sender
- the sender of the broadcastmessage
- the message to sendmode
- 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 insteadCreates a new broadcast, with the current system time set as send time.- Parameters:
sender
- the sender of the broadcastmessage
- the message to sendsendTime
- time when broadcast initaly was sendlastDisplay
- last display timerepeat
- 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 broadcastmessage
- the message to sendsendTime
- time when broadcast initaly was sendlastDisplay
- last display timerepeat
- true if the message should be repeatedmode
- the content mode
-
-
Method Details
-
getContentMode
Gets the content mode.- Returns:
- the content mode
-
getLastDisplay
Gets the last display time.- Returns:
- the last display time
-
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
Returns the time this broadcast was send.- Returns:
- the time this broadcast was send
-
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
Returns true if this is a repeating message.- Returns:
- true if this is a repeating message
-
withLastDisplay
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
-