Class WeatherSettings
java.lang.Object
org.silverpeas.looks.aurora.service.weather.WeatherSettings
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic WeatherSettingsget()Gets an instance of theWeatherSettingsbundle.Gets the API key to use to request the remote weather service used by Silverpeas.Gets the list of cities for which the weather forecast have to be requested.Gets the client key to use to request the remote weather service used by Silverpeas.Gets the client secret to use to request the remote weather service used by Silverpeas.Gets the weather service to request for weather forecast.voidsetSettingsFile(String settingsFile) Sets the name of the properties file in which are defined the weather settings to be taken in charge by thisWeatherSettingsinstance.
-
Field Details
-
DEFAULT_SETTINGS
- See Also:
-
-
Constructor Details
-
WeatherSettings
public WeatherSettings()
-
-
Method Details
-
get
Gets an instance of theWeatherSettingsbundle.- Returns:
- a
WeatherSettingsinstance.
-
setSettingsFile
Sets the name of the properties file in which are defined the weather settings to be taken in charge by thisWeatherSettingsinstance. The properties file has to be located into theproperties/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 theproperties/org/silverpeas/weather/settings/directory to be found and loaded by this object.
-
getCities
Gets the list of cities for which the weather forecast have to be requested.- Returns:
- a list of cities. Can be empty.
-
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
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
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
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.
-