HttpClientWrapper to use switch between using Java Http and Ok Http for android - #335
HttpClientWrapper to use switch between using Java Http and Ok Http for android#335kalynstricklin wants to merge 14 commits into
Conversation
kalynstricklin
commented
Feb 18, 2026
- Added httpclientwrapper to use java or okhttp during runtime based on httpclient availability
- Added oauth
- Added register system datastreams to update existing datastreams instead of creating new ones
…er system datastreams, reverted back to using foi id and obsstore
…access to an obs store
…plement android ok http wrapper or javahttpwrapper by default
| import org.sensorhub.impl.service.consys.client.ConSysApiClientConfig; | ||
| import org.sensorhub.impl.service.consys.resource.ResourceFormat; | ||
|
|
||
| public interface IHttpClient |
There was a problem hiding this comment.
We should probably make this more generic for a range of uses. For example, a driver could use this to send GET requests for sensor data and be compatible with Android by default. It also may be a good idea to have the client API and implementation live in sensorhub-core, but I'm not 100% sure
We cannot guarantee that the foi id on the local observations are the same as the ones registered on the remote node
|
@earocorn Can you leave input on the foi id additions |
|
This re-adds logic to use FOI IDs that are created on the remote node, since we can't guarantee that both nodes use the same ID encoders / encoding mechanism (db vs no db). |
alexrobin
left a comment
There was a problem hiding this comment.
I like the approach for allowing different IHttpClient implementations. However, this new code would break some existing functionality so please try to address my comments to avoid this. Thx, good job!
- changed text case of DataStream to match - Updated getDataStreams to return all dataStreams without systemId argument and added unit test - Added ITokenHandler interface and implemented it with Nick's OAuthTokenHandler - Removed client config from builder and added builder code back with changes to auth
|
@kalynstricklin Sorry but I cannot merge this until it is fully backward compatible with the previous version because it is used in production. Please address the remaining comments |
alexrobin
left a comment
There was a problem hiding this comment.
I made a few more comments. After you make these changes I will test the branch with Delta project and will let you know how things go.
In general, this client is a public API so we need to avoid ANY breaking changes until the next major version of osh-core.
If you add new methods, that's OK but if you modify existing methods, you have to make sure it doesn't introduce any incompatibilities with any existing code that would use these methods.
You cannot delete any public or protected methods, only deprecate them using the @Deprecated annotation