Package org.opencms.db
Class CmsLoginMessage
java.lang.Object
org.opencms.db.CmsLoginMessage
A message to display when a user logs in to the system.
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
The default end time (if none has been set).static final long
The default start time (if none has been set). -
Constructor Summary
ConstructorDescriptionCreates a new login message with all default values.CmsLoginMessage
(long timeStart, long timeEnd, String message, boolean loginForbidden) Creates a new login message with the given parameters.CmsLoginMessage
(String message, boolean loginForbidden) Creates a new login message with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Checks if this message is frozen.clone()
Returns the message.long
Returns the time the message ends.long
Returns the time the message starts.boolean
isActive()
Returnstrue
if this message is currently active.boolean
Returnstrue
if this login message is the enabled.boolean
Returnstrue
if logins are currently forbidden according to the settings of this message.boolean
Returnstrue
if logins are forbidden while this message is active.void
setEnabled
(boolean enabled) Sets the enabled status of this message.protected void
Freezes the configuration of this login message object to prevent later changes.void
setLoginForbidden
(boolean loginForbidden) Sets the flag that controls if logins are forbidden while this message is active.void
setMessage
(String message) Sets the message to display.void
setTimeEnd
(long timeEnd) Sets the time when to finish displaying this message.void
setTimeStart
(long timeStart) Sets the time when to start displaying this message.
-
Field Details
-
DEFAULT_TIME_END
The default end time (if none has been set). This is December 31, 2039. -
DEFAULT_TIME_START
The default start time (if none has been set). This is January 1, 2000.
-
-
Constructor Details
-
CmsLoginMessage
public CmsLoginMessage()Creates a new login message with all default values. -
CmsLoginMessage
Creates a new login message with the given parameters.- Parameters:
timeStart
- the time when to start displaying this messagetimeEnd
- the time when to finish displaying this messagemessage
- the message to displayloginForbidden
- controls if logins are forbidden while this message is active
-
CmsLoginMessage
Creates a new login message with the given parameters.- Parameters:
message
- the message to displayloginForbidden
- controls if logins are forbidden while this message is active
-
-
Method Details
-
clone
-
getMessage
Returns the message.- Returns:
- the message
-
getTimeEnd
Returns the time the message ends.- Returns:
- the time the message ends
-
getTimeStart
Returns the time the message starts.- Returns:
- the time the message starts
-
isActive
Returnstrue
if this message is currently active.A message is active if it is enabled and the current time is after the message start time and before the message end time.
- Returns:
true
if this message is currently active
-
isEnabled
Returnstrue
if this login message is the enabled.- Returns:
true
if this login message is the enabled
-
isLoginCurrentlyForbidden
Returnstrue
if logins are currently forbidden according to the settings of this message.This checks the time settings using
andisActive()
as well as theisEnabled()
flag.isLoginForbidden()
- Returns:
true
if logins are currently forbidden according to the settings of this message
-
isLoginForbidden
Returnstrue
if logins are forbidden while this message is active.- Returns:
true
if logins are forbidden while this message is active
-
setEnabled
Sets the enabled status of this message.- Parameters:
enabled
- the enabled status to set
-
setLoginForbidden
Sets the flag that controls if logins are forbidden while this message is active.- Parameters:
loginForbidden
- the flag to set
-
setMessage
Sets the message to display.- Parameters:
message
- the message to set
-
setTimeEnd
Sets the time when to finish displaying this message.- Parameters:
timeEnd
- the time to set
-
setTimeStart
Sets the time when to start displaying this message.- Parameters:
timeStart
- the time to set
-
checkFrozen
Checks if this message is frozen.- Throws:
CmsRuntimeException
- in case the message is already frozen
-
setFrozen
Freezes the configuration of this login message object to prevent later changes.
-