You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GoodData HTTP Client is an extension of [Apache HTTP Client](http://hc.apache.org/httpcomponents-client-4.3.x/index.html) (former Jakarta Commons).
4
+
GoodData HTTP Client is an extension of [Apache HTTP Client 5.x](https://hc.apache.org/httpcomponents-client-5.3.x/index.html).
5
5
This specialized Java client transparently handles [GoodData authentication](https://help.gooddata.com/display/doc/API+Reference#/reference/authentication/log-in)
6
6
so you can focus on writing logic on top of [GoodData API](https://help.gooddata.com/display/doc/API+Reference).
7
7
8
+
## ⚠️ Version 2.0+ Breaking Changes
9
+
10
+
**Version 2.0.0** introduces a major update migrating from Apache HttpClient 4.x to 5.x. See the [Migration Guide](#migration-guide) below for upgrade instructions.
11
+
12
+
## Requirements
13
+
14
+
-**Java 17+** (updated from Java 8)
15
+
-**Apache HttpClient 5.5+** (migrated from 4.x)
16
+
-**Maven 3.6+** (for building)
17
+
8
18
## Design
9
19
10
-
```com.gooddata.http.client.GoodDataHttpClient``` central class implements [org.apache.http.client.HttpClient interface](http://hc.apache.org/httpcomponents-client-4.2.x/httpclient/apidocs/org/apache/http/client/HttpClient.html)
11
-
It allows seamless switch for existing code base currently using ```org.apache.http.client.HttpClient```. Business logic encapsulating
12
-
access to [GoodData API](https://help.gooddata.com/display/doc/API+Reference) should use ```org.apache.http.client.HttpClient``` interface
13
-
and keep ```com.gooddata.http.client.GoodDataHttpClient``` inside a factory class. ```com.gooddata.http.client.GoodDataHttpClient``` uses underlying ```org.apache.http.client.HttpClient```. A HTTP client
14
-
instance can be passed via the constructor.
20
+
`com.gooddata.http.client.GoodDataHttpClient` is a thread-safe HTTP client that wraps Apache HttpClient 5.x and provides transparent GoodData authentication handling. The client automatically manages SST (Super Secure Token) and TT (Temporary Token) lifecycle, including:
21
+
22
+
- Automatic token refresh on expiration
23
+
- Retry logic for authentication failures
24
+
- Thread-safe token management
25
+
- Support for all HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS)
26
+
27
+
Business logic should use the `GoodDataHttpClient` class directly, which handles all authentication concerns internally.
15
28
16
29
## Usage
17
30
@@ -32,52 +45,190 @@ If your project is managed by Maven you can add GoodData HTTP client as a new de
32
45
33
46
### <aname="credentials"/>Authentication using credentials</a>
-**Thread Safety**: All requests now use write locks for consistency. This may reduce throughput under high concurrency but ensures reliable token management.
199
+
-**Entity Handling**: Non-repeatable request entities are automatically buffered for retry scenarios.
200
+
-**Error Handling**: More specific exceptions for authentication failures.
201
+
-**HTTP Methods**: Full support for POST, PUT, PATCH in addition to GET and DELETE.
202
+
203
+
#### 8. Testing Your Migration
204
+
205
+
After updating your code:
206
+
207
+
1.**Compile**: Ensure no compilation errors
208
+
2.**Test**: Run your existing test suite
209
+
3.**Integration Test**: Test against GoodData API with real credentials
210
+
4.**Monitor**: Watch for authentication issues or performance changes
211
+
212
+
#### Common Migration Issues
213
+
214
+
**Issue: NoClassDefFoundError**
215
+
-**Cause**: Conflicting HttpClient versions in classpath
216
+
-**Fix**: Use `mvn dependency:tree` to identify conflicts and exclude old HttpClient 4.x dependencies
217
+
218
+
**Issue: Method not found errors**
219
+
-**Cause**: Using old HttpClient 4.x APIs
220
+
-**Fix**: Update all imports and method calls to HttpClient 5.x equivalents
221
+
222
+
**Issue: Authentication failures**
223
+
-**Cause**: Token handling differences
224
+
-**Fix**: Ensure SST/TT tokens are being passed correctly; check logs for authentication errors
225
+
226
+
### Need Help?
227
+
228
+
- Review the [complete API documentation](http://javadoc.io/doc/com.gooddata/gooddata-http-client)
0 commit comments