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 10 commits intoopensensorhub:masterfrom
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
...ice-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClientModule.java
Show resolved
Hide resolved
| 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
...e-consys/src/main/java/org/sensorhub/impl/service/consys/client/http/IHttpURLConnection.java
Outdated
Show resolved
Hide resolved
...ice-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClientModule.java
Outdated
Show resolved
Hide resolved
...ice-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClientConfig.java
Show resolved
Hide resolved
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!
| protected HttpClient http; | ||
| protected URI endpoint; | ||
| protected String token; | ||
| public ConSysApiClient(ConSysApiClientConfig config) throws SensorHubException { |
There was a problem hiding this comment.
I would like to keep the ConSysApi Client independent from the config object. Config objects are for modules but I also use the client w/o the module. I would like to keep using the builder and extend it with any parameter we need.
...b-service-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClient.java
Outdated
Show resolved
Hide resolved
...b-service-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClient.java
Show resolved
Hide resolved
...b-service-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClient.java
Show resolved
Hide resolved
...b-service-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClient.java
Outdated
Show resolved
Hide resolved
...b-service-consys/src/main/java/org/sensorhub/impl/service/consys/client/ConSysApiClient.java
Show resolved
Hide resolved
- 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