Package de.elo.utils.webapp.status
Class StatusData
java.lang.Object
de.elo.utils.webapp.status.StatusData
public class StatusData
extends java.lang.Object
This class holds the data that have to be printed on the status page.
The status page can display the following kinds of information:
Titel | Program name |
Menu actions | One row of HTML links for arbitary requests |
Application state | RUNNING, INITIALIZING or STOPPED |
List of warnings, errors, fatal errors | This lists can hold up to 5 messages. |
Application dependent status values (properties) | E.g. "number of processed documents". StatusData provides functions to generate commonly used values (like version, server time, log-level, ...). A status value row in the table can contain an optional action element. E.g. the log-level value uses a combobox. |
List of information messages | This list can be up to 5 messages long and should be used to show informational messages like "Retry to connect to database" during the startup phase. |
The class StatusPageHtml can be used to print the status data on an HTML page. In order to
provide the data in text format, the class StatusPageText
is to be used. In text format,
only properties with an ID are printed.
Example for a status page with an error message:
Example for a status page with an information massage:
- See Also:
StatusPageServletExample
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StatusData.Action
This class defines a menu action.class
StatusData.Actions
List of actionsstatic class
StatusData.DataList<T>
This class defines a collection that can be constrained to a maximum number of items.static class
StatusData.Info
This class defines an information, warning, error or fatal error.class
StatusData.Infos
List of infosclass
StatusData.Properties
List of Property objects.static class
StatusData.Property
An object of the Property class provides one status value.static class
StatusData.State
Enumeration for application state values. -
Field Summary
Fields Modifier and Type Field Description protected StatusData.Actions
actions
List of actionsprotected StatusData.Infos
errors
List of errorsprotected StatusData.Infos
fatals
List of fatal errorsprotected StatusData.Infos
infos
List of informationsprotected static int
MAX_INFOS
Maximum number of informations, warnings, errors, fatal errors.protected java.lang.String
programName
Application nameprotected java.lang.String
programVersion
Applicationo versionprotected StatusData.Properties
properties
List of propertiesprotected StatusData.State
state
Stateprotected StatusData.Infos
warnings
List of warnings -
Constructor Summary
Constructors Constructor Description StatusData(java.lang.String programName, java.lang.String programVersion)
Constructor -
Method Summary
Modifier and Type Method Description void
clear()
Clear all internally stored members.StatusData.Actions
getActions()
List of actionsStatusData.Infos
getErrors()
List of errors.StatusData.Infos
getFatals()
List of fatal errorsStatusData.Infos
getInfos()
List of informationsjava.lang.String
getProgramName()
Application namejava.lang.String
getProgramVersion()
Application versionStatusData.Properties
getProperties()
List of propertiesStatusData.State
getState()
Application statusStatusData.Infos
getWarnings()
List of warningslong
incrRequestCounter(long n)
Increment request countervoid
setActions(java.util.List<StatusData.Action> v)
Set list of actions.void
setErrors(java.util.List<StatusData.Info> v)
Set list of errors.void
setFatals(java.util.List<StatusData.Info> v)
Set list of fatal errors.void
setInfos(java.util.List<StatusData.Info> v)
Set list of informations.void
setProgramVersion(java.lang.String version)
Set application version.void
setProperties(java.util.List<StatusData.Property> v)
Set list of properties.void
setState(StatusData.State state)
Application statusvoid
setWarnings(java.util.List<StatusData.Info> v)
Set list of warnings.
-
Field Details
-
programName
protected java.lang.String programNameApplication name -
programVersion
protected java.lang.String programVersionApplicationo version -
state
State -
MAX_INFOS
protected static final int MAX_INFOSMaximum number of informations, warnings, errors, fatal errors.- See Also:
- Constant Field Values
-
errors
List of errors -
fatals
List of fatal errors -
infos
List of informations -
warnings
List of warnings -
properties
List of properties -
actions
List of actions
-
-
Constructor Details
-
StatusData
public StatusData(java.lang.String programName, java.lang.String programVersion)Constructor- Parameters:
programName
- Application nameprogramVersion
- Application version
-
-
Method Details
-
clear
public void clear()Clear all internally stored members. -
getErrors
List of errors.- Returns:
- list
-
getFatals
List of fatal errors- Returns:
- list
-
getInfos
List of informations- Returns:
- list
-
getWarnings
List of warnings- Returns:
- list
-
getProperties
List of properties- Returns:
- list
-
getActions
List of actions- Returns:
- list
-
setErrors
Set list of errors.- Parameters:
v
- list (does not copy the list)
-
setFatals
Set list of fatal errors.- Parameters:
v
- list (does not copy the list)
-
setInfos
Set list of informations.- Parameters:
v
- list (does not copy the list)
-
setWarnings
Set list of warnings.- Parameters:
v
- list (does not copy the list)
-
setProperties
Set list of properties.- Parameters:
v
- list (is copied)
-
setActions
Set list of actions.- Parameters:
v
- list (is copied)
-
getState
Application status- Returns:
- value
-
setState
Application status- Parameters:
state
- value
-
getProgramName
public java.lang.String getProgramName()Application name- Returns:
- value
-
getProgramVersion
public java.lang.String getProgramVersion()Application version- Returns:
- value
-
setProgramVersion
public void setProgramVersion(java.lang.String version)Set application version.- Parameters:
version
-
-
incrRequestCounter
public long incrRequestCounter(long n)Increment request counter- Parameters:
n
- add to counter value.- Returns:
- value
-