eclipse-lyo / lyo.client

Lyo project repository (lyo.client)
11 stars 16 forks source link

Reintroducing OslcOauthClient from oslc-java-client to oslc4j-client library #77

Closed jadelkhoury closed 4 years ago

jadelkhoury commented 5 years ago

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

berezovskyi commented 5 years ago

I think we need to introduce an interface to make two clients interchangeable where possible.

jadelkhoury commented 5 years ago

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.

jadelkhoury commented 5 years ago

@berezovskyi I read now on the mailing list your point about defining a LyoResponse return value. We might need to do this together (to get it right the first time :-)) But I can prepare the grounds by reverting some of the changes on this branch.

jadelkhoury commented 5 years ago

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.

berezovskyi commented 4 years ago

TODO:

jadelkhoury commented 4 years ago

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?