Class WeatherSettings

java.lang.Object
org.silverpeas.looks.aurora.service.weather.WeatherSettings
All Implemented Interfaces:
Serializable

@SessionScoped public class WeatherSettings extends Object implements Serializable
Settings of a weather module dedicated to work with a remote weather service. By default, those settings are defined in the properties/org/silverpeas/weather/settings/weather.properties file, but they can be defined in another properties file. In that case, the path of this file must be specified with setSettingsFile(String) method. Only the cache time-to-live defined in the default properties file is taken into account.
Author:
mmoquillon
See Also:
  • Field Details

  • Constructor Details

    • WeatherSettings

      public WeatherSettings()
  • Method Details

    • get

      public static WeatherSettings get()
      Gets an instance of the WeatherSettings bundle.
      Returns:
      a WeatherSettings instance.
    • setSettingsFile

      public void setSettingsFile(String settingsFile)
      Sets the name of the properties file in which are defined the weather settings to be taken in charge by this WeatherSettings instance. The properties file has to be located into the properties/org/silverpeas/weather/settings/ directory of the Silverpeas installation.
      Parameters:
      settingsFile - the name of the properties file without its extension. It must be located into the properties/org/silverpeas/weather/settings/ directory to be found and loaded by this object.
    • getCities

      public List<City> getCities()
      Gets the list of cities for which the weather forecast have to be requested.
      Returns:
      a list of cities. Can be empty.
    • getAPIKey

      public String getAPIKey()
      Gets the API key to use to request the remote weather service used by Silverpeas. The API key is used by the remote weather service to identify the requester and for weather requesting authorization.
      Returns:
      an API key.
    • getService

      public String getService()
      Gets the weather service to request for weather forecast. From this service name, the matching requester will be used.
      Returns:
      the name of the service.
    • getClientKey

      public String getClientKey()
      Gets the client key to use to request the remote weather service used by Silverpeas. Only some weather service requires a client key for authentication.
      Returns:
      a client key.
    • getClientSecret

      public String getClientSecret()
      Gets the client secret to use to request the remote weather service used by Silverpeas. Only some weather service requires a client secret for authentication. A client secret is always associated with a client key.
      Returns:
      a client secret.