Skip to content

Commit

Permalink
Merge pull request #54 from sportradar/v3.0.0-rc1
Browse files Browse the repository at this point in the history
v3.0.0-rc1
  • Loading branch information
dhrovat authored Oct 25, 2023
2 parents f050272 + 64303f4 commit 711f219
Show file tree
Hide file tree
Showing 819 changed files with 31,204 additions and 14,619 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ buildNumber.properties
#custom exclusions
/uf-sdk-logs/
**/uf-sdk-logs/

UFSdkConfiguration.properties
!/sdk-integration-tests/**/src/test/resources/UFSdkConfiguration.properties
application.yml
!/sdk-integration-tests/**/src/test/resources/application.yml

**/custom
**/generatedsources
/git-ignored-playground/

# logs
*.log.gz
37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
### Unified Feed SDK 2.x changelog

**2.0.61 (2023-07-20)**
* Stages can be of SprintRace type
**3.0.0 (2023-XX-YY)**
* Consistent casing used in naming in java code as per Google java style guidelines (refer to Migration Guide)
* Upgrading Apache http client library from 4 to 5
* methods getName/s exposed more consistently in classes: categoryData, sportData, currentSeason, drawResult, manager, tournamentInfo
* upgrading sdk libraries. Rabbit, slf4j, guava, guice, icu4j, snakeyaml, jaxb
* removing libraries: logback
* removing deprecated methods
* OddsFeedConfiguration renamed to UofSdkConfiguration
* Removed selectIntegration and selectProduction from EnvironmentSelector (use selectEnvironment)
* user agent indicating basic environment information is submitted on Sports API calls
* Configuration from file - renamed values:
* defaultLocale -> defaultLanguage
* desiredLocales -> desiredLanguages
* ufEnvironment -> environment
* useMessagingSsl -> messagingUseSll
* useApiSsl -> apiUseSsl
* moved HttpClient configuration to UofConfigurationBuilder
* removing OddsFeedSessionBuilder.setSpecificListeners method
* renaming class SportsInfoProvider to SportDataProvider
* renaming method UofSdk.getSportsInfoProvider to UofSdk.getSportDataProvider
* renaming OddsFeed to uofSdk
* renaming OddsFeedSession to UofSession
* renaming OddsFeedSessionBuilder to UofSessionBuilder
* renaming OddsFeedListener to UofListener,
* renaming OddsFeedConfigurationBuilder to UofConfigurationBuilder
* renaming UofSdk.getOddsFeedConfigurationBuilder to UofConfigurationBuilder
* renaming OddsFeedException to UofException
* renaming ReplayOddsFeed to UofSdkForReplay
* removed OperationManager
* Venue can now contain multiple courses, each with holes, id, and name translations.
* venue.getCourses signature was changed from returning List<Hole> to List<Course> to accommodate multiple courses and carry additionally id and name for each of them. Corresponding changes were made to ExportableCompetitorCi
* teamCompetitor.getDivision method was moved up in the inheritance hierarchy to competitorCi and its signature was changed from returning Integer to Division in order for Decision to also carry division name. Corresponding changes were made to ExportableCompetitorCi
* timelineEvent.getHomeScore and timelineEvent.getAwayScore signatures were changed from returning double to BigDecimal to make these methods return types consistent with other occurrences of these same methods elsewhere in the SDK API. Corresponding changes were made to ExportableTimelineEventCi
* removed round.getGroupName along with corresponding adjustments in ExportableCompleteRoundCi and ExportableLoadableRoundCi
* round.getName, round.getNames and round.getPhaseOrGroupLongName are backed by their own corresponding attributes "name" and "group_name" only in the Sports API responses, and no longer falls back to other attributes.

**2.0.60.0 (2023-05-17)**
* CustomBetManager respects ExceptionHandlingStrategy for all non-argument-validating exceptions
Expand Down
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ Unified Feed SDK 2.x
The Unified Odds SDK provides a simple and efficient way to access Sportradar's odds and sport information for a bookmaker.
It combines subscription of messages and RESTful API calls into a unified Java interface that hides most of the complexity including recovery.

### A Basic way to use the OddsFeed
### A Basic way to use the UofSdk

First you need to implement the SDK event listeners that will receive callbacks for each message/event.
* [OddsFeedListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeedListener.html)
* [SDKGlobalEventsListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SDKGlobalEventsListener.html)
* [UofListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofListener.html)
* [UofGlobalEventsListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofGlobalEventsListener.html)

Then to actually connect and start receiving messages you do the following:
```java
MyOddsFeedListener listener = new MyOddsFeedListener();
MySDKGlobalEventsListener globalEventsListener = new MySDKGlobalEventsListener();
MyUofListener listener = new MyUofListener();
MyUofGlobalEventsListener globalEventsListener = new MyUofGlobalEventsListener();

OddsFeedConfiguration config = OddsFeed.getConfigurationBuilder().setAccessToken("your-token").build();
UofConfiguration config = UofSdk.getConfigurationBuilder().setAccessToken("your-token").build();

OddsFeed oddsFeed = new OddsFeed(globalEventsListener, config);
UofSdk uofSdk = new UofSdk(globalEventsListener, config);

OddsFeedSessionBuilder sessionBuilder = oddsFeed.getSessionBuilder();
UofSessionBuilder sessionBuilder = uofSdk.getSessionBuilder();
sessionBuilder.setListener(listener).setMessageInterest(MessageInterest.AllMessages).build();

oddsFeed.open();
uofSdk.open();
```

See: [OddsFeed](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeed.html),
[OddsFeedSessionBuilder](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeedSessionBuilder.html),
[SDKGlobalEventsListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SDKGlobalEventsListener.html)
and [OddsFeedListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeedListener.html)
See: [UofSdk](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofSdk.html),
[UofSessionBuilder](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofSessionBuilder.html),
[UofGlobalEventsListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofGlobalEventsListener.html)
and [UofListener](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofListener.html)

That should be it!

If you want to get available sport events, active tournaments, or all sports you can get the [SportsInfoManager](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SportsInfoManager.html)
from the main [OddsFeed](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeed.html) instance:
If you want to get available sport events, active tournaments, or all sports you can get the [SportDataProvider](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SportDataProvider.html)
from the main [UofSdk](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofSdk.html) instance:
```java
SportsInfoManager sportsInfoManager = oddsFeed.getSportsInfoManager();
SportDataProvider sportDataProvider = uofSdk.getSportDataProvider();
// Get all sports, translated in the desired locales
for (Sport sport : sportsInfoManager.getSports()) {
for (Sport sport : sportDataProvider.getSports()) {

}
// Get all soccer active tournaments, the returned data will be translated in the desired locales
for (SportEvent tournament : sportsInfoManager.getActiveTournaments("soccer")) {
for (SportEvent tournament : sportDataProvider.getActiveTournaments("soccer")) {

}
// Get all competitions scheduled for today
for (SportEvent sportEvent : sportsInfoManager.getCompetitionsFor(new Date())) {
for (SportEvent sportEvent : sportDataProvider.getCompetitionsFor(new Date())) {

}

// Get all live competitions
for (SportEvent sportEvent : sportsInfoManager.getLiveCompetitions()) {
for (SportEvent sportEvent : sportDataProvider.getLiveCompetitions()) {

}
```
Expand All @@ -68,18 +68,18 @@ is considered low-priority,
[OddsChange](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/oddsentities/OddsChange.html) is considered high-priority).
To create two different sessions for the high and low-priority messages you do the following:
```java
MyOddsFeedListener listener = new MyOddsFeedListener();
MySDKGlobalEventsListener globalEventsListener = new MySDKGlobalEventsListener();
MyUofListener listener = new MyUofListener();
MyUofGlobalEventsListener globalEventsListener = new MyUofGlobalEventsListener();

OddsFeedConfiguration config = OddsFeed.getConfigurationBuilder().setAccessToken("your-token").build();
UofConfiguration config = UofSdk.getConfigurationBuilder().setAccessToken("your-token").build();

OddsFeed oddsFeed = new OddsFeed(globalEventsListener, config);
UofSdk uofSdk = new UofSdk(globalEventsListener, config);

OddsFeedSessionBuilder sessionBuilder = oddsFeed.getSessionBuilder();
UofSessionBuilder sessionBuilder = uofSdk.getSessionBuilder();
sessionBuilder.setListener(listener).setMessageInterest(MessageInterest.HiPrioMessagesOnly).build();
sessionBuilder.setListener(listener).setMessageInterest(MessageInterest.LoPrioMessagesOnly).build();

oddsFeed.open();
uofSdk.open();
```

Note that the same listener is used for both channels, but when creating the two different sessions, different
Expand All @@ -106,12 +106,12 @@ when the game ends, but only after 15minutes or even later after the game confir
### Localization
By default all the data is available in English. You can add additional desired "prefetch" languages
and set the default locale with the use of the
[OddsFeedConfigurationBuilder](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/OddsFeedConfigurationBuilder.html)
([addDesiredLocales](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/OddsFeedConfigurationBuilder.html#addDesiredLocales-java.util.List-),
[setDefaultLocale](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/OddsFeedConfigurationBuilder.html#setDefaultLocale-java.util.Locale-)).
[UofConfigurationBuilder](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/UofConfigurationBuilder.html)
([addDesiredLocales](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/UofConfigurationBuilder.html#addDesiredLocales-java.util.List-),
[setDefaultLocale](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/cfg/UofConfigurationBuilder.html#setDefaultLocale-java.util.Locale-)).
If you need to access a locale that was not specified as the default locale and neither added to the desired locales
list, you can still access the locale translated content trough the
[SportsInfoManager](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SportsInfoManager.html)
[SportDataProvider](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/SportDataProvider.html)
and
[MarketDescriptionManager](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/MarketDescriptionManager.html).

Expand All @@ -132,7 +132,7 @@ message per producer, so the SDK performs the recovery for the missed messages(t
message can not be more than 3 days). You can do this trough the
[ProducerManager](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/ProducerManager.html)
available on the
[OddsFeed](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/OddsFeed.html)
[UofSdk](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/UofSdk.html)
instance. If the last processed message timestamp is not provided, the SDK will perform a
full recovery, beware: with a full recovery you do not recover any lost
[BetSettlement](http://sdk.sportradar.com/content/unifiedfeedsdk/java2/javadoc/com/sportradar/unifiedodds/sdk/oddsentities/BetSettlement.html)
Expand All @@ -141,12 +141,12 @@ messages!
// as an example, we set the last message received timestamp to 2 days ago for the producer with the id 1(LiveOdds)
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -2);
ProducerManager producerManager = oddsFeed.getProducerManager();
ProducerManager producerManager = uofSdk.getProducerManager();
producerManager.setProducerLastMessageTimestamp(1, cal.getTime().getTime());

// session creation,...

oddsFeed.open(); // finally we open the feed
uofSdk.open(); // finally we open the feed
```

### Further reading
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.sportradar.unifiedodds.sdk</groupId>
<artifactId>unified-feed-sdk-parent</artifactId>
<version>2.0.61</version>
<version>3.0.0</version>
<packaging>pom</packaging>
<name>Unified Odds Feed SDK - parent</name>
<description>UnifiedFeed SDK is a client library that enables easier integration with the Betradar XML feeds. SDK exposes XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing, data caching and dispatching. It also makes a client solution more stable and robust when it comes to feed handling, especially with the release of new and updated XML feed versions.</description>
Expand All @@ -26,17 +26,17 @@

<dataModel.version>1.0.69</dataModel.version>
<rabbitMQ.version>3.6.0</rabbitMQ.version>
<apache.httpComponents.version>4.5.1</apache.httpComponents.version>
<slf4j.version>1.7.13</slf4j.version>
<logback.version>1.2.3</logback.version>
<apache.httpComponents.version>4.5.14</apache.httpComponents.version>
<slf4j.version>2.0.7</slf4j.version>
<logback.version>1.3.8</logback.version>
<junit.version>4.12</junit.version>
<junitparams.version>1.1.1</junitparams.version>
<hamcrest.version>2.2</hamcrest.version>
<mockito.version>4.5.1</mockito.version>
<guava.version>21.0</guava.version>
<guava.version>31.1-jre</guava.version>
<guice.version>4.0</guice.version>
<icu4j.version>57.1</icu4j.version>
<snake.yaml.version>1.20</snake.yaml.version>
<snake.yaml.version>1.31</snake.yaml.version>
<org.springframework.spring-web.version>5.3.9</org.springframework.spring-web.version>
</properties>

Expand Down
Binary file added sdk-core/.DS_Store
Binary file not shown.
Loading

0 comments on commit 711f219

Please sign in to comment.