Class 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 propreties/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 setSettingsFilePath(String) method. Only the cache time-to-live defined in the default propreties file is taken into account.
    Author:
    mmoquillon
    See Also:
    Serialized Form
    • Constructor Detail

      • WeatherSettings

        public WeatherSettings()
    • Method Detail

      • setSettingsFilePath

        public void setSettingsFilePath​(String settingsPath)
        Sets the path of the properties file in which are defined the weather settings to be taken in charge by this WeatherSettings instance.
        Parameters:
        settingsPath - the path of the properties file the in Java-package format. For example, org.silverpeas.weather.settings.myOwnSettings refer the properties file myOwnSettings.properties located in the directory properties/org/silverpeas/weather/settings/.
      • 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.