Closed jadelkhoury closed 4 years ago
I think we need to introduce an interface to make two clients interchangeable where possible.
Hi Jim! I am not sure how moving RootServicesHelper.java functionality into OslcClient helps. I needed this functionality even when I don't have an OslcClient. If we want to promote rootServices, why not make it more visible in the SDK with its own class, instead of hiding it within OslcClient?
@berezovskyi ! I can revert (almost) all changes to OslcClient, if I no longer make OslcOAthClient a subclass of OslcClient(). Instead OslcOAthClient has an attribute of type OslcClient that is then used to do the REST calls, once authenticated. But the central problem remains: the methods getResource() cannot share a common signature, since OslcOAuthClient needs to throw oauth exceptions. that is, I cannot define a common itnerface for both OslcOAthClient and OslcClient.
@berezovskyi
I read now on the mailing list your point about defining a LyoResponse
This is not 100% complete, but I wonder if this new structure is more acceptable.
Please explore the proposed client application on https://github.com/OSLC/lyo-samples/pull/10.
TODO:
TODO:
- [ ] throw IllegalStateException if the authorisation has not been performed. as it is, you throw IllegalArguemntException
- [ ] fix OslcClient merge conflict
Fixed. But @berezovskyi ! Sure we should not fix some class names before merging?
Here are the major changes in this reintroduction:
lyo.client\oslc4j-client\src...\oslc4j\client\RootServicesHelper.java
C:\Users\jelx25\git\lyo\lyo.client\oslc4j-client\src...\oslc4j\client\OslcClient.java
lyo.client\oslc4j-client\src...\oslc4j\client\OslcOAuthClient.java