File tree Expand file tree Collapse file tree
src/main/java/com/amilesend/tvmaze/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,20 +66,41 @@ Include this package as a dependency in your project. Note: This package is publ
6666<dependency >
6767 <groupId >com.amilesend</groupId >
6868 <artifactId >tvmaze-java-client</artifactId >
69- <version >2.1.5 </version >
69+ <version >2.2 </version >
7070</dependency >
7171```
7272
7373## Recipes
7474
7575### Instantiation
7676
77+ Default:
7778``` java
7879TvMaze client = new TvMaze ();
7980SearchApi searchApi = client. getSearchApi();
8081List<ShowResult > results = searchApi. searchShows(" friends" );
8182```
8283
84+ With a RetryStrategy:
85+ ``` java
86+ TvMaze client = new TvMaze (new DefaultConnectionBuilder ()
87+ .httpClient(new OkHttpClient ())
88+ .baseUrl(TvMaze . API_URL )
89+ .userAgent(TvMaze . USER_AGENT )
90+ .authManager(new NoOpAuthManager ())
91+ .gsonFactory(new GsonFactory ())
92+ .isGzipContentEncodingEnabled(true )
93+ // Options are ExponentialDelayRetryStrategy, FixedDelayRetryStrategy
94+ // or NoRetryStrategy (default).
95+ .retryStrategy(ExponentialDelayRetryStrategy . builder()
96+ .baseDelayMs(500L )
97+ .maxJitterMs(100L )
98+ .maxAttempts(3 )
99+ .maxTotalDelayMs(2000L )
100+ .build())
101+ .build());
102+
103+ ```
83104### Customizing the HTTP client configuration
84105
85106<details >
Original file line number Diff line number Diff line change 2525
2626 <groupId >com.amilesend</groupId >
2727 <artifactId >tvmaze-java-client</artifactId >
28- <version >2.1.6-SNAPSHOT </version >
28+ <version >2.2 </version >
2929
3030 <name >tvmaze-java-client</name >
3131 <description >A client to access the TVMaze API</description >
Original file line number Diff line number Diff line change 3838 */
3939@ RequiredArgsConstructor
4040public class TvMaze {
41- public static final String USER_AGENT = "TvMazeJavaClient/2.1 " ;
41+ public static final String USER_AGENT = "TvMazeJavaClient/2.2 " ;
4242 public static final String API_URL = "https://api.tvmaze.com" ;
4343
4444 private final Connection <GsonFactory > connection ;
You can’t perform that action at this time.
0 commit comments