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 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 withsetSettingsFilePath(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 Summary
Constructors Constructor Description WeatherSettings()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WeatherSettings
get()
Gets an instance of theWeatherSettings
bundle.String
getAPIKey()
Gets the API key to use to request the remote weather service used by Silverpeas.List<City>
getCities()
Gets the list of cities for which the weather forecast have to be requested.String
getClientKey()
Gets the client key to use to request the remote weather service used by Silverpeas.String
getClientSecret()
Gets the client secret to use to request the remote weather service used by Silverpeas.String
getService()
Gets the weather service to request for weather forecast.void
setSettingsFilePath(String settingsPath)
Sets the path of the properties file in which are defined the weather settings to be taken in charge by thisWeatherSettings
instance.
-
-
-
Method Detail
-
get
public static WeatherSettings get()
Gets an instance of theWeatherSettings
bundle.- Returns:
- a
WeatherSettings
instance.
-
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 thisWeatherSettings
instance.- Parameters:
settingsPath
- the path of the properties file the in Java-package format. For example,org.silverpeas.weather.settings.myOwnSettings
refer the properties filemyOwnSettings.properties
located in the directoryproperties/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.
-
-