Class TokenSetterImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.cfg.TokenSetterImpl
- All Implemented Interfaces:
TokenSetter
The default implementation of the
TokenSetter-
Constructor Summary
ConstructorsConstructorDescriptionTokenSetterImpl(SdkConfigurationPropertiesReader sdkConfigurationPropertiesReader, SdkConfigurationYamlReader sdkConfigurationYamlReader, Function<UofConfiguration, WhoAmIReader> buildWhoAmIReader, Function<UofConfiguration, ProducerDataProvider> buildProducerDataProvider) -
Method Summary
Modifier and TypeMethodDescriptionSets the general configuration properties to values read from configuration file.Sets the general configuration properties to values read from configuration file.setAccessToken(String token) Sets the access token used to access feed resources (AMQP broker, Sports API, ...)Sets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from the application.yml The YAML file should be named "application.properties" and localed in the application resources folderSets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from the sdk properties The properties file should be named "UFSdkConfiguration.properties" and localed in the application resources folderSets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from system variable "uf.accesstoken"
-
Constructor Details
-
TokenSetterImpl
public TokenSetterImpl(SdkConfigurationPropertiesReader sdkConfigurationPropertiesReader, SdkConfigurationYamlReader sdkConfigurationYamlReader, Function<UofConfiguration, WhoAmIReader> buildWhoAmIReader, Function<UofConfiguration, ProducerDataProvider> buildProducerDataProvider)
-
-
Method Details
-
setAccessToken
Sets the access token used to access feed resources (AMQP broker, Sports API, ...)- Specified by:
setAccessTokenin interfaceTokenSetter- Parameters:
token- the access token used to access feed resources- Returns:
- the
EnvironmentSelectorinstance allowing the selection of target environment
-
setAccessTokenFromSdkProperties
Sets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from the sdk properties The properties file should be named "UFSdkConfiguration.properties" and localed in the application resources folder- Specified by:
setAccessTokenFromSdkPropertiesin interfaceTokenSetter- Returns:
- the
EnvironmentSelectorinstance allowing the selection of target environment
-
setAccessTokenFromApplicationYaml
Sets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from the application.yml The YAML file should be named "application.properties" and localed in the application resources folder- Specified by:
setAccessTokenFromApplicationYamlin interfaceTokenSetter- Returns:
- the
EnvironmentSelectorinstance allowing the selection of target environment
-
setAccessTokenFromSystemVar
Sets the access token used to access feed resources (AMQP broker, Sports API, ...) to value read from system variable "uf.accesstoken"You can set the access token with the following JVM argument -Duf.accesstoken=your-access-token
- Specified by:
setAccessTokenFromSystemVarin interfaceTokenSetter- Returns:
- the
EnvironmentSelectorinstance allowing the selection of target environment
-
buildConfigFromSdkProperties
Sets the general configuration properties to values read from configuration file. Only value which can be set throughConfigurationBuilderBasemethods are set. Any values already set by methods on the current instance are overridden. Builds and returns aUofConfigurationImplinstanceThe properties file should be named "UFSdkConfiguration.properties" and localed in the application resources folder
- Specified by:
buildConfigFromSdkPropertiesin interfaceTokenSetter- Returns:
- builds and returns a
UofConfigurationImplinstance
-
buildConfigFromApplicationYml
Sets the general configuration properties to values read from configuration file. Only value which can be set throughConfigurationBuilderBasemethods are set. Any values already set by methods on the current instance are overridden. Builds and returns aUofConfigurationImplinstanceThe YAML file should be named "application.yml" and localed in the application resources folder
- Specified by:
buildConfigFromApplicationYmlin interfaceTokenSetter- Returns:
- builds and returns a
UofConfigurationImplinstance
-