rest collector call added
This commit is contained in:
parent
61b3f1c140
commit
4dc045bdee
13
.classpath
13
.classpath
|
@ -6,20 +6,11 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
<attribute name="test" value="true"/>
|
||||||
</classpathentry>
|
|
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
@ -27,7 +18,7 @@
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
||||||
import org.gcube.resources.discovery.client.api.DiscoveryException;
|
import org.gcube.resources.discovery.client.api.DiscoveryException;
|
||||||
import org.gcube.resources.discovery.client.queries.api.Query;
|
import org.gcube.resources.discovery.client.queries.api.Query;
|
||||||
import org.gcube.resources.discovery.icclient.stubs.CollectorStub;
|
import org.gcube.resources.discovery.icclient.stubs.CollectorStub;
|
||||||
|
import org.gcube.resources.discovery.icclient.stubs.CollectorStubRestImpl;
|
||||||
import org.gcube.resources.discovery.icclient.stubs.MalformedQueryException;
|
import org.gcube.resources.discovery.icclient.stubs.MalformedQueryException;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -70,11 +71,14 @@ public class ICClient implements DiscoveryClient<String> {
|
||||||
//helper
|
//helper
|
||||||
private CollectorStub getStub() {
|
private CollectorStub getStub() {
|
||||||
|
|
||||||
//find endpoint address in service map currently in scope
|
ServiceMap serviceMap = ServiceMap.instance;
|
||||||
String address = ServiceMap.instance.endpoint(localname);
|
String address = serviceMap.endpoint(localname);
|
||||||
log.info("connectinfg to "+address);
|
log.info("connecting to {}",address);
|
||||||
//obtain a JAXWS stub configured for gCube calls
|
if (serviceMap.version().equals("2.0.0"))
|
||||||
return stubFor(collector).at(URI.create(address));
|
return new CollectorStubRestImpl(address);
|
||||||
|
else
|
||||||
|
return stubFor(collector).at(URI.create(address));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//helper
|
//helper
|
||||||
|
|
Loading…
Reference in New Issue