Giter VIP home page Giter VIP logo

lyo.client's Introduction

lyo.client's People

Contributors

benjaminr-ps avatar berezovskyi avatar cenobyte321 avatar denisroy avatar dependabot[bot] avatar isccarrasco avatar jadelkhoury avatar jamsden avatar jruehlin avatar l-ohlen-ericsson avatar neormx avatar parysto avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lyo.client's Issues

Rename oslc4j-client to lyo-client and refactor

Rationale: we are trying to have all projects be named lyo-xyz and drop OSLC4J. I am also constantly confused with which of them is new and which is old.


Action plan

  • make a 4.0.0.M2 release before that to provide a temporary but reliable workaround for all the SNAPSHOT code out there
  • oslc-java-client stays with the same name, package namespace (org.eclipse.lyo.client.oslc), and a bumped version 4.0 but with all classes under client.oslc and client.jazz deprecated.
  • oslc4j-client is renamed to oslc-client and org.eclipse.lyo.oslc4j.client code is moved to org.eclipse.lyo.client. Note that oslc is missing at the end and this is how we avoid clashes technically. Also, classes are renamed from OslcClientXYZ to LyoClientXYZ; this is how we signal to developers which classes to use. dropped because of disagreement over the package name
  • client.exception and client.resources are moved into two differnt packages (read below why) and previously discussed deprecations are made to client.resources because lyo-domains is preferred. NB! Check the steps taken in eclipse/lyo.domains#20
  • oslc-java-client depends on oslc-client-base (where I will move client.exception code) and oslc-java-client-resources (where client.resources will go). However, lyo-client will only depend on lyo-client-base and users will be advised to depend on lyo-domains BUT they will be able to also load oslc-java-client-resources if really needed.

Query allowed values for a resource

Is it possible to query the "allowedValue"s for a resource as described in the resourceShape?

For example in the TestResult Resource Shape

<rdf:Description rdf:nodeID="A78">
        <oslc:allowedValue rdf:resource="http://jazz.net/ns/qm/rqm#com.ibm.rqm.execution.common.state.part_blocked"/>
        <oslc:allowedValue rdf:resource="http://jazz.net/ns/qm/rqm#com.ibm.rqm.execution.common.state.failed"/>
...

Attribute Value URI can't be resolved

While reading out a requirement using:

		ClientResponse requirementResponse = oslcOauthClient
			.getResource(requirementURL, OslcMediaType.APPLICATION_RDF_XML);
		Requirement requirement = requirementResponse.getEntity(Requirement.class);

...I get a requirement object that among many more easily parseable attributes also has some with URIs, such as this one (in contrast to an easier parseable value):

requirement
└extendedProperites
 ├[7]
 │├QName key = {http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/}attrDef-1003
 │└XMLLiteral value = <div>This is the Additional Info Value</div>
 └[8]
  ├QName key = {http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/}attrDef-1025
  └URI value = http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1

The main question is: How do I resolve the URI that is returned here (http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1) into an actual value?

Intuitively, I tried oslcOauthClient.getResource(http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1, OslcMediaType.APPLICATION_RDF_XML);. However, that just returned the Formal Module in its XML Form.

Or simply put, these two requests return effectively the same response:

  • oslcOauthClient.getResource(http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100)
  • oslcOauthClient.getResource(http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1)

By pasting these URLs into a browser, I was able to confirm that this appears to be a redirection issue in DWA, where http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1 for some reason is automatically redirected to http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100 .

So, what can I do about this? All that I know is that I have the URI http://localhost:8080/dwa/rm/urn:rational::1-5efc6f9a4ff877cf-M-00000100/types/attrDef-1025#1, and I want to know the value it contains. But for some reason that value is not accessible.

Am I using the wrong function in LYO? Or is does the problem lie somewhere else?

json-ld support fails if server also includes the OSLC client library

I have an adaptor that also includes the latest oslc-client library oslc4j-client (the one for jax-rs 2.0).

If I do a GET JSON-LD, I will get the exception below!
Why? As soon as I include the oslc4j-client library, I end up using the Apache httpclient version 4.0 (due to the old oauth library). Without oslc4j-client, I use the needed httpclient version 4.5.10.

Dependency Hierarchy for an adaptor without oslc4j-client

withoutOSLCClient

Dependency Hierarchy for an adaptor with oslc4j-client

withOSLCClient

Exception

javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/http/client/RedirectStrategy
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:168)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:505)

issues in the new client

Major portion of wink-based client is duplicated in the new client. I don't have time or energy to port/backport fixes like #5 to both clients. Thus, I would just leave the old client at 2.4.0 without further maintenance unless someone steps up to make 2.4.x releases.

Furthermore, duplicating resource classes makes it hard/impossible to develop proper libraries. I have raised this issue with @jadelkhoury regarding the code that is generated by LyoD (equally hard to write portable helpers) and Jad suggested to switch to something like https://github.com/eclipse/lyo.domains/

Please update OSLCClient to use apache http 4.5.x methods

This is an ehancement request.
From sample pom.xml file, it appears lyo.client is using apache http 4.5.x.
However the code still uses defaulthttpclient which has been deprecated since 4.3.
On top of that, there are various deficiencies that need to be fixed - it does not handle the javax.net.ssl.keystore., proxy, javax.net.ssl.truststore. system properties among others.
This would help poeple like me who are occasional users of lyo.client oslc tremendously.
Many thanks

Bundling the client as osgi bundle

Similar to Lyo.core (as defined in Bundling oslc4j as osgi bundle), it would be great if we can also build the client as a bundle.

Actual usage scenario, an EMF/eclipse application needs to consume OSLC resources from an OSLC server. We need to be able to include the client code as a plugin

Delete old client

Jad recently commented that he has no intention to maintain old client. I saw no changes to the client in 4.0.0 and I am not planning to maintain it either. Existing users are expected to stay on v2.x for the time being.

I suggest to remove it and not include it in the 4.0.0 release. I will remove it this week unless there are good arguments to keep it.

Provide example to configure OslcClient to trust self-assigned certificates

The old oslc-java-client OslcClient provided a constructor that client applications could use to configure TrustManagers as needed. It also provided a default that ignored all SSL security checks. But neither the JazzFormAuthClient nor the OslcOAuthClient subclasses exposed the constructor to configure the TrustManagers, calling the OslcClient default constructor which ignored SSL security checks. This is not really acceptable for a production environment.

The new oslc4j-client OslcClient provides a constructor that takes a ClientBuilder which can be configured for an SSLContext as needed by client applications.

At least one of the oslc4j-client-sample applications should demonstrate how to configure an SSLContext which trusts all self-assigned certificates. This is useful for testing, simple client development and OSLC client utilities used within a secure environment.

Ambiguous names

I can't tell apart the old client from the new one just a few days after reading your email @jamsden about a proposed artefact naming.

I suggest:

  • the old client needs to have either -legacy or -wink appended to its name
  • the new client need to have either -jaxrs or -ng appended to its name.

Also, I would like to stop using OSLC4J term. It's confusing people because really there is no difference between Lyo and OSLC4J.

OslcClient#getHttpClient method shall be removed

An instance of the Apache HTTP client is not used in the new OSLC4J client. Furthermore, it is not even initialised correctly. It shall be simply removed before anyone attempts to use it in their code.

Unable to create a very simple resource via the new OSLC4J client

I am trying to POST a new resource via a CreationFactory but the new client fails before even making a request. Here is the resource (serialised to Turtle via JMH from the POJO, so the problem should not be in the POJO or its annotations):

@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix oslc:  <http://open-services.net/ns/core#> .

<urn:uuid:17fcdedd-d90c-40a4-af00-2b365c26ac66>
        a       <http://ontology.cf.ericsson.net/ns/twins#PlanExecutionRequest> ;
        <http://ontology.cf.ericsson.net/pddl/plan>
                <http://sandbox-whc:8080/services/serviceProviders/default/service1/plans/2> .

Here is a 200 OK response when executing this request manually:

image

Here is the exception stack trace I am getting:

21:19:07.669 TRACE se.ericsson.cf.scott.sandbox.whc.xtra.clients.TwinClient - POSTing PlanExecutionRequest:
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix oslc:  <http://open-services.net/ns/core#> .

<urn:uuid:fd616662-2164-4b2f-b503-551834a358ba>
        a       <http://ontology.cf.ericsson.net/ns/twins#PlanExecutionRequest> ;
        <http://ontology.cf.ericsson.net/pddl/plan>
                <http://sandbox-whc:8080/services/serviceProviders/default/service1/plans/1> .

21:19:07.717 DEBUG org.jvnet.hk2.logger - Created ServiceLocator ServiceLocatorImpl(__HK2_Generated_1,2,2021468806)
21:19:07.818 INFO org.glassfish.jersey.process.internal.ExecutorProviders - Selected ExecutorServiceProvider implementation [org.glassfish.jersey.client.DefaultClientAsyncExecutorProvider] to be used for injection of executor qualified by [org.glassfish.jersey.client.ClientAsyncExecutor] annotation.
21:19:07.825 INFO org.glassfish.jersey.client.internal.HttpUrlConnector - Restricted headers are not enabled using [sun.net.http.allowRestrictedHeaders] system property (setting only takes effect on connections created after the property has been set/changed).
21:19:08.059 TRACE org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider - Using 'Turtle' writer for 'text/turtle' Accept media type
21:19:08.061 DEBUG org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper - An empty reified statement was stripped from the model
21:19:08.078 TRACE org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider - Using 'Turtle' writer for 'text/turtle' Accept media type
21:19:08.083 DEBUG org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper - An empty reified statement was stripped from the model
21:19:08.089 TRACE sun.net.www.protocol.http.HttpURLConnection - ProxySelector Request for http://sandbox-twin:8081/services/twins/robot/rb-2/planExecutionRequests/create
21:19:08.104 WARN org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider - OSLC015: An error occurred serializing the resource
org.apache.jena.atlas.RuntimeIOException: java.net.ConnectException: Connection refused (Connection refused)
	at org.apache.jena.atlas.io.IO.exception(IO.java:233)
	at org.apache.jena.atlas.io.IO.flush(IO.java:250)
	at org.apache.jena.atlas.io.BufferingWriter.flush(BufferingWriter.java:153)
	at org.apache.jena.atlas.io.IO.flush(IO.java:250)
	at org.apache.jena.atlas.io.IndentedWriter.flush(IndentedWriter.java:217)
	at org.apache.jena.riot.writer.TurtleWriterBase.output$(TurtleWriterBase.java:55)
	at org.apache.jena.riot.writer.TurtleWriterBase.write(TurtleWriterBase.java:48)
	at org.apache.jena.riot.adapters.RDFWriterRIOT.write(RDFWriterRIOT.java:91)
	at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeObjectsTo(AbstractOslcRdfXmlProvider.java:159)
	at org.eclipse.lyo.oslc4j.provider.jena.AbstractOslcRdfXmlProvider.writeTo(AbstractOslcRdfXmlProvider.java:127)
	at org.eclipse.lyo.oslc4j.provider.jena.OslcRdfXmlProvider.writeTo(OslcRdfXmlProvider.java:237)
	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265)
	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250)
	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)
	at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)
	at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517)
	at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499)
	at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:393)
	at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285)
	at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
	at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
	at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444)
	at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
	at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)
	at org.eclipse.lyo.oslc4j.client.OslcClient.createResource(OslcClient.java:273)
	at org.eclipse.lyo.oslc4j.client.OslcClient.createResource(OslcClient.java:257)
	at se.ericsson.cf.scott.sandbox.whc.xtra.clients.TwinClient.requestPlanExecution(TwinClient.kt:32)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.tryRegisterPlan(PlanningManager.kt:116)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.planForTwin(PlanningManager.kt:53)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.access$planForTwin(PlanningManager.kt:25)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager$planForEachTwin$1.accept(PlanningManager.kt:45)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager$planForEachTwin$1.accept(PlanningManager.kt:25)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401)
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734)
	at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583)
	at se.ericsson.cf.scott.sandbox.whc.xtra.managers.PlanningManager.planForEachTwin(PlanningManager.kt:44)
	at se.ericsson.cf.scott.sandbox.whc.xtra.services.AdminResource.triggerPlanning(AdminResource.kt:59)
	at se.ericsson.cf.scott.sandbox.whc.xtra.services.AdminResource$plan$1.invoke(AdminResource.kt:39)
	at se.ericsson.cf.scott.sandbox.whc.xtra.services.AdminResource$plan$1.invoke(AdminResource.kt:23)
	at se.ericsson.cf.scott.sandbox.whc.xtra.services.AdminResource$runAsync$1.run(AdminResource.kt:48)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
	at sun.net.www.http.HttpClient.New(HttpClient.java:339)
	at sun.net.www.http.HttpClient.New(HttpClient.java:357)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
	at org.glassfish.jersey.client.internal.HttpUrlConnector$4.getOutputStream(HttpUrlConnector.java:390)
	at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200)
	at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:194)
	at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:228)
	at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299)
	at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
	at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
	... 61 more

Add Jazz rootservices support to oslc4j-client OslcClient

In the old oslc-java-client, methods to support rootservices methods to discover ServiceProviderCatalog URLs was provided by JazzRootServicesHelper. But OslcClient supports similar discovery methods for ServiceProviderCatalog, ServiceProvider, and Service resources. Since many common OSLC servers support rootservices (and we've considered adding this to the OASIS OSLC Core standard), and since these are small methods that client applications not using root services can just ignore, we should handle discovery uniformly and in one place.

Another advantage of this is that clients applications won't interact with the OslcClient entirely differently depending on whether they use rootservices for discovery.

oslc4j-client OslcClient supports proactive login(user, password) method

This is primarily used for token-based authentication techniques where the user's credentials are exchanged for a token that is provided in a header or cookies in order to authenticate subsequent requests.

See:
https://stackoverflow.com/questions/26777083/best-practice-for-rest-token-based-authentication-with-jax-rs-and-jersey

This will eliminate the need for JazzFormAuthClient and any of the other classes in the org.eclipse.lyo.client.oslc.jazz package - in the oslc4j-client maven project.

OslcQueryResult returns no members

The JAX-RS 2.0/Jersey implementation of oslc-java-client does not return any members when running the GenericCMSample.java program. When initializeRdf() attempts to get the membersResource, its searching the refModel for a resource whose subject is the query.getCapabilityUrl(). When invoked from GenericCMSample, that URL looks like http://192.168.1.140:8080/OSLC4JChangeManagement/services/changeRequests. However, examining the content of the Jena rdfModel, the subject URIs look like http://localhost:8080/OSLC4JChangeManagement/services/changeRequests, so these aren't matching and the membersResource is null.

All the URLs in the ServiceProvider have http://192.168.1.140:8080, so that's why the queryCapability URI starts with http://192.168.1.140:8080.

Create new maven projects for JAX-RS 2.0 support and Java client simplification

The Apache Wink based Java client, oslc-java-client, and its sample programs in oslc-java-samples cannot be easily migrated to JAX-RS 2.0 without making API breaking changes.

Rather we should leave these maven projects as they are, and build new projects: oslc4j-client and oslc4j-client-samples to implement the new client.

Requirements are:

  • oslc4j-client is Java (as is eclipse/Lyo, so there's no need to have Java in the name) and can only depend on JAX-RS 2.0 API (no JAX-RS implementation)
  • The OslcClient constructor only requires a ClientBuilder argument, all client configuration is provided in this ClientBuilder by the OSLC client applications.
  • The oslc4j-client-samples demonstrate how to configure a ClientBuilder for:
    • Apache HttpClient instead of the HttpUrlConnection default
    • SSLContext supporting TrustManagers, including an example using TrustSelfSignedStrategy
    • Proactive Basic and Digest authentication (HttpAuthenticationFeature)
    • JEE Form and OpenIDConnect token based authentication (no OAuth 1.0a support, get that from the old oslc-java-client)
    • OSLC discovery methods based on ServiceProviderCatalog
    • Support for Jazz rootservices resources for discovering discovery (accessing ServiceProviderCatalog and authentication URLs without requiring authentication)

OSLC Client: can you provide a method createResource where custom headers can be provided?

Hi,

I am using OSLC4J and have found that there are a lot of APIs that are not completely OSLC. Especially Doors Next often requires additional headers. I had to create a subclass of org.eclipse.lyo.client.oslc.OslcClient to add a new method

public ClientResponse createResource(String url, final Object artifact, Map<String, String> requestHeaders,
String mediaType, String acceptType)

to add custom headers. This requires also creating a new RootServicesHelper delegating to the JazzRootServicesHelper in order to get a custom form auth client for which I had to copy the code from org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient.

This works, but is brittle and makes maintenance a bit harder, just to get the custom header in.

All the HTTP methods should allow additional headers, if possible.

Thanks, Ralph

Help Requested POM file

Hello OSLC experts,

I am beginer to OSLC, am trying to run the java file "lyo.client/oslc4j-client-samples/src/main/java/org/eclipse/lyo/client/oslc/samples/RMSample.java" in eclipse but in POM file i am getting below error

"Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until
the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://
repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to
requested target"

when i tried "POM->Run as ->Moven Clean" i am getting below error message "[INFO] Scanning for projects...
[INFO]
[INFO] -------< org.eclipse.lyo.samples.clients:oslc4j-client-samples >--------
[INFO] Building org.eclipse.lyo.samples.clients 2.3.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.117 s
[INFO] Finished at: 2019-03-18T11:12:32+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException'
can you please help me to resolve this error

There is no proxy

thanks in Advance

NoSuchFieldError: EXCLUDE_EMPTY

With the new client in place of the old one, I am getting the following exception:

java.lang.NoSuchFieldError: EXCLUDE_EMPTY
	at org.glassfish.jersey.client.ClientConfig$State.<init>(ClientConfig.java:150)
	at org.glassfish.jersey.client.ClientConfig.<init>(ClientConfig.java:468)
	at org.glassfish.jersey.client.JerseyClientBuilder.<init>(JerseyClientBuilder.java:94)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at javax.ws.rs.client.FactoryFinder.newInstance(FactoryFinder.java:114)
	at javax.ws.rs.client.FactoryFinder.find(FactoryFinder.java:209)
	at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:94)
	at org.eclipse.lyo.oslc4j.client.OslcClient.<init>(OslcClient.java:101)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.