Class MaintenanceMode

java.lang.Object
io.goobi.viewer.model.administration.MaintenanceMode
All Implemented Interfaces:
IPolyglott

@Entity public class MaintenanceMode extends Object implements IPolyglott
JPA entity that stores the maintenance mode configuration, including its enabled state and multilingual message text displayed to visitors during scheduled downtime.
  • Constructor Details

    • MaintenanceMode

      public MaintenanceMode()
      Default constructor.
  • Method Details

    • getId

      public Long getId()
    • setId

      public void setId(Long id)
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • getTranslations

      public List<MaintenanceModeTranslation> getTranslations()
    • setTranslations

      public void setTranslations(List<MaintenanceModeTranslation> translations)
    • getText

      public String getText()
      Returns:
      Text value in the current language
    • getText

      public String getText(String language)
      Parameters:
      language - locale for the text translation to retrieve
      Returns:
      Text value in the given language
    • getTextOrDefault

      public String getTextOrDefault(String language)
      Parameters:
      language - locale for the text translation to retrieve, with fallback to default
      Returns:
      Text value in the given language
    • setText

      public void setText(String text)
      setText.
      Parameters:
      text - maintenance message text for the current locale
    • setText

      public void setText(String text, String language)
      Parameters:
      text - maintenance message text to store
      language - locale for which to set the text
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isComplete

      public boolean isComplete(Locale locale)
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless IPolyglott.isEmpty(Locale) also returns true.
      Specified by:
      isComplete in interface IPolyglott
      Parameters:
      locale - the locale to check translation completeness for
      Returns:
      true if IPolyglott.isValid(Locale) returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale, IPolyglott.isComplete(Locale) and IPolyglott.isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      public boolean isValid(Locale locale)
      Only meaningful for the default language for which all required fields must be filled.
      Specified by:
      isValid in interface IPolyglott
      Parameters:
      locale - the locale to validate required fields for
      Returns:
      true if all required fields contain a value in the given locale
    • isEmpty

      public boolean isEmpty(Locale locale)
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class.
      Specified by:
      isEmpty in interface IPolyglott
      Parameters:
      locale - the locale to check for empty fields
      Returns:
      true if no fields are filled for the given locale
    • getSelectedLocale

      public Locale getSelectedLocale()
      Specified by:
      getSelectedLocale in interface IPolyglott
      Returns:
      the locale currently set by IPolyglott.setSelectedLocale(Locale)
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      Description copied from interface: IPolyglott
      Sets the locale to use for display and editing.
      Specified by:
      setSelectedLocale in interface IPolyglott
      Parameters:
      locale - the locale to select