Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/META-INF/MANIFEST.MF27
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/osee.client.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientStandaloneSetup.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandaloneModule.java)18
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/search/QueryExecutorV1.java8
-rw-r--r--plugins/org.eclipse.osee.rest.client/.classpath7
-rw-r--r--plugins/org.eclipse.osee.rest.client/.project33
-rw-r--r--plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF36
-rw-r--r--plugins/org.eclipse.osee.rest.client/OSGI-INF/web.client.provider.xml (renamed from plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/web.client.provider.xml)6
-rw-r--r--plugins/org.eclipse.osee.rest.client/build.properties6
-rw-r--r--plugins/org.eclipse.osee.rest.client/pom.xml34
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeClientConfig.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientConfig.java)2
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeRestClientStandaloneSetup.java44
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/WebClientProvider.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProvider.java)2
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeHttpProxyAddress.java)2
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeServerAddress.java)2
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneUriProviderImpl.java)23
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneWebClientProvider.java)5
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandaloneModule.java37
-rw-r--r--plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/WebClientProviderImpl.java (renamed from plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProviderImpl.java)3
-rw-r--r--plugins/org.eclipse.osee.x.core.parent/pom.xml1
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/IntegrationUtil.java2
24 files changed, 247 insertions, 72 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.rest.client/META-INF/MANIFEST.MF
index 001c3add4a..dcdd725444 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.rest.client/META-INF/MANIFEST.MF
@@ -6,34 +6,17 @@ Bundle-Version: 0.16.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Eclipse Open System Engineering Environment
Service-Component: OSGI-INF/*.xml
-Import-Package: com.sun.jersey.client.apache,
- com.sun.jersey.client.apache.config,
- com.sun.jersey.api.client,
- com.sun.jersey.api.client.config,
- com.sun.jersey.core.impl.provider.entity,
- javax.inject,
- javax.ws.rs,
+Import-Package: com.sun.jersey.api.client,
javax.ws.rs.core,
- org.eclipse.core.net.proxy,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
- org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.services,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.orcs.rest.model,
- org.eclipse.osee.orcs.rest.model.search
+ org.eclipse.osee.orcs.rest.model.search,
+ org.eclipse.osee.rest.client
Export-Package: org.eclipse.osee.orcs.rest.client
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
- javax.servlet;visibility:=reexport,
- com.google.inject,
- org.apache.commons.httpclient;visibility:=reexport,
- org.apache.commons.logging;visibility:=reexport,
- org.apache.log4j;visibility:=reexport,
- org.slf4j.api;visibility:=reexport,
- org.codehaus.jackson.core;visibility:=reexport,
- org.codehaus.jackson.jaxrs;visibility:=reexport,
- org.codehaus.jackson.mapper;visibility:=reexport,
- com.sun.jersey;bundle-version="1.18.0",
- com.sun.jersey.client.apache;bundle-version="1.18.0"
+Require-Bundle: com.google.inject,
+ com.sun.jersey;bundle-version="1.18.0"
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/osee.client.xml b/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/osee.client.xml
index 6e36ac2a96..51cb216ad1 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/osee.client.xml
+++ b/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/osee.client.xml
@@ -4,6 +4,6 @@
<service>
<provide interface="org.eclipse.osee.orcs.rest.client.OseeClient"/>
</service>
- <reference bind="setWebClientProvider" cardinality="1..1" interface="org.eclipse.osee.orcs.rest.client.internal.WebClientProvider" name="WebClientProvider" policy="static"/>
+ <reference bind="setWebClientProvider" cardinality="1..1" interface="org.eclipse.osee.rest.client.WebClientProvider" name="WebClientProvider" policy="static"/>
<reference bind="setUriProvider" cardinality="1..1" interface="org.eclipse.osee.framework.core.services.URIProvider" name="URIProvider" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientStandaloneSetup.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientStandaloneSetup.java
index 71418709a0..e4241de1a4 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientStandaloneSetup.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientStandaloneSetup.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.client;
+import org.eclipse.osee.orcs.rest.client.internal.OrcsClientModule;
import org.eclipse.osee.orcs.rest.client.internal.OseeClientImpl;
-import org.eclipse.osee.orcs.rest.client.internal.StandaloneModule;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
+import org.eclipse.osee.rest.client.OseeClientConfig;
+import org.eclipse.osee.rest.client.OseeRestClientStandaloneSetup;
+import com.google.inject.Module;
/**
- * Class to use when using the API
+ * Class to use when using the API in a non-OSGI environment
*
* @author Roberto E. Escobar
*/
@@ -27,7 +28,7 @@ public final class OseeClientStandaloneSetup {
}
public static OseeClient createClient(OseeClientConfig config) {
- Injector injector = Guice.createInjector(new StandaloneModule(config));
- return injector.getInstance(OseeClientImpl.class);
+ Module module = new OrcsClientModule();
+ return OseeRestClientStandaloneSetup.createClient(OseeClientImpl.class, config, module);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandaloneModule.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java
index 73c98f0ae5..245802ce93 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandaloneModule.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java
@@ -10,9 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.rest.client.internal;
-import org.eclipse.osee.framework.core.services.URIProvider;
import org.eclipse.osee.orcs.rest.client.OseeClient;
-import org.eclipse.osee.orcs.rest.client.OseeClientConfig;
import com.google.inject.AbstractModule;
import com.google.inject.TypeLiteral;
import com.google.inject.matcher.AbstractMatcher;
@@ -24,23 +22,11 @@ import com.google.inject.spi.TypeListener;
/**
* @author Roberto E. Escobar
*/
-public class StandaloneModule extends AbstractModule {
-
- private final OseeClientConfig config;
-
- public StandaloneModule(OseeClientConfig config) {
- this.config = config;
- }
+public class OrcsClientModule extends AbstractModule {
@Override
protected void configure() {
- bindConstant().annotatedWith(OseeServerAddress.class).to(config.getServerAddress());
- bindConstant().annotatedWith(OseeHttpProxyAddress.class).to(config.getProxyAddress());
-
bind(OseeClient.class).to(OseeClientImpl.class);
- bind(WebClientProvider.class).to(StandadloneWebClientProvider.class);
- bind(URIProvider.class).to(StandadloneUriProviderImpl.class);
-
TypeListener listener = new TypeListener() {
@Override
@@ -74,6 +60,6 @@ public class StandaloneModule extends AbstractModule {
public boolean matches(TypeLiteral<?> subType) {
return subType.equals(superType) || superType.getRawType().isAssignableFrom(subType.getRawType());
}
-
}
+
}
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
index 9fff938516..6d1d7e0bef 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeClientImpl.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.orcs.rest.client.internal.search.QueryBuilderImpl;
import org.eclipse.osee.orcs.rest.client.internal.search.QueryExecutorV1;
import org.eclipse.osee.orcs.rest.client.internal.search.QueryOptions;
import org.eclipse.osee.orcs.rest.model.search.Predicate;
+import org.eclipse.osee.rest.client.WebClientProvider;
import com.google.inject.Inject;
/**
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/search/QueryExecutorV1.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/search/QueryExecutorV1.java
index b1d47ebcbf..eae3b16569 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/search/QueryExecutorV1.java
+++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/search/QueryExecutorV1.java
@@ -13,10 +13,10 @@ package org.eclipse.osee.orcs.rest.client.internal.search;
import java.net.URI;
import java.util.List;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.services.URIProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.orcs.rest.client.internal.WebClientProvider;
import org.eclipse.osee.orcs.rest.model.ExceptionEntity;
import org.eclipse.osee.orcs.rest.model.search.OutputFormat;
import org.eclipse.osee.orcs.rest.model.search.Predicate;
@@ -24,6 +24,7 @@ import org.eclipse.osee.orcs.rest.model.search.RequestType;
import org.eclipse.osee.orcs.rest.model.search.SearchRequest;
import org.eclipse.osee.orcs.rest.model.search.SearchResponse;
import org.eclipse.osee.orcs.rest.model.search.SearchResult;
+import org.eclipse.osee.rest.client.WebClientProvider;
import com.sun.jersey.api.client.UniformInterfaceException;
import com.sun.jersey.api.client.WebResource;
@@ -68,7 +69,9 @@ public class QueryExecutorV1 implements QueryExecutor {
new SearchRequest(branch.getGuid(), predicates, outputFormat.name().toLowerCase(),
requestType.name().toLowerCase(), fromTx, includeDeleted);
- URI uri = uriProvider.getEncodedURI(String.format("oseex/branch/%s/artifact/search/v1", branch.getGuid()), null);
+ UriBuilder path =
+ UriBuilder.fromUri(uriProvider.getApplicationServerURI()).path("oseex/branch/{branch-uuid}/artifact/search/v1");
+ URI uri = path.build(branch.getGuid());
WebResource resource = clientProvider.createResource(uri);
SearchResponse searchResult = null;
@@ -82,5 +85,4 @@ public class QueryExecutorV1 implements QueryExecutor {
}
return searchResult;
}
-
}
diff --git a/plugins/org.eclipse.osee.rest.client/.classpath b/plugins/org.eclipse.osee.rest.client/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.rest.client/.project b/plugins/org.eclipse.osee.rest.client/.project
new file mode 100644
index 0000000000..3f4eebace5
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.rest.client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cf2d3315ba
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OSEE REST Client (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.rest.client
+Bundle-Version: 0.16.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: Eclipse Open System Engineering Environment
+Bundle-ActivationPolicy: lazy
+Service-Component: OSGI-INF/*.xml
+Import-Package: com.google.inject,
+ com.google.inject.binder,
+ com.google.inject.matcher,
+ com.google.inject.name,
+ com.google.inject.spi,
+ com.google.inject.util,
+ javax.inject,
+ javax.ws.rs,
+ javax.ws.rs.core,
+ org.eclipse.core.net.proxy,
+ org.eclipse.osee.framework.core.exception,
+ org.eclipse.osee.framework.core.services,
+ org.eclipse.osee.framework.jdk.core.type,
+ org.eclipse.osee.framework.jdk.core.util
+Export-Package: org.eclipse.osee.rest.client
+Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
+ javax.servlet;visibility:=reexport,
+ com.google.inject,
+ org.apache.commons.httpclient;visibility:=reexport,
+ org.apache.commons.logging;visibility:=reexport,
+ org.apache.log4j;visibility:=reexport,
+ org.slf4j.api;visibility:=reexport,
+ org.codehaus.jackson.core;visibility:=reexport,
+ org.codehaus.jackson.jaxrs;visibility:=reexport,
+ org.codehaus.jackson.mapper;visibility:=reexport,
+ com.sun.jersey;bundle-version="1.18.0",
+ com.sun.jersey.client.apache;bundle-version="1.18.0"
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/web.client.provider.xml b/plugins/org.eclipse.osee.rest.client/OSGI-INF/web.client.provider.xml
index 80e11e746c..14aa625131 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/OSGI-INF/web.client.provider.xml
+++ b/plugins/org.eclipse.osee.rest.client/OSGI-INF/web.client.provider.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.rest.client.internal.WebClientProviderImpl">
- <implementation class="org.eclipse.osee.orcs.rest.client.internal.WebClientProviderImpl"/>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.rest.client.internal.WebClientProviderImpl">
+ <implementation class="org.eclipse.osee.rest.client.internal.WebClientProviderImpl"/>
<service>
- <provide interface="org.eclipse.osee.orcs.rest.client.internal.WebClientProvider"/>
+ <provide interface="org.eclipse.osee.rest.client.WebClientProvider"/>
</service>
<reference bind="setProxyService" cardinality="1..1" interface="org.eclipse.core.net.proxy.IProxyService" name="IProxyService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.rest.client/build.properties b/plugins/org.eclipse.osee.rest.client/build.properties
new file mode 100644
index 0000000000..6d4f3aa975
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
+additional.bundles = com.sun.jersey
diff --git a/plugins/org.eclipse.osee.rest.client/pom.xml b/plugins/org.eclipse.osee.rest.client/pom.xml
new file mode 100644
index 0000000000..3f0077cf3c
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/pom.xml
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.osee</groupId>
+ <artifactId>org.eclipse.osee.x.core.parent</artifactId>
+ <version>0.16.0-SNAPSHOT</version>
+ <relativePath>../../plugins/org.eclipse.osee.x.core.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.osee.rest.client</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>OSEE Rest Client - (Incubation)</name>
+
+ <build>
+ <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
+ <resources>
+ <resource>
+ <directory>src</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientConfig.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeClientConfig.java
index bbe2f9eec4..efb293c02c 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/OseeClientConfig.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeClientConfig.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client;
+package org.eclipse.osee.rest.client;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeRestClientStandaloneSetup.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeRestClientStandaloneSetup.java
new file mode 100644
index 0000000000..44630c8f0c
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeRestClientStandaloneSetup.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.rest.client;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.rest.client.internal.StandaloneModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+
+/**
+ * Class to use when using the API in a non-OSGI environment
+ *
+ * @author Roberto E. Escobar
+ */
+public final class OseeRestClientStandaloneSetup {
+
+ private OseeRestClientStandaloneSetup() {
+ // Utility class
+ }
+
+ public static <T> T createClient(Class<T> api, OseeClientConfig config, Module... modules) {
+ Injector injector = createInjector(config, modules);
+ return injector.getInstance(api);
+ }
+
+ private static Injector createInjector(OseeClientConfig config, Module... modules) {
+ List<Module> moduleList = new ArrayList<Module>();
+ moduleList.add(new StandaloneModule(config));
+ for (Module module : modules) {
+ moduleList.add(module);
+ }
+ return Guice.createInjector(moduleList);
+ }
+}
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProvider.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/WebClientProvider.java
index 607bc61d5a..8f32ad8401 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProvider.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/WebClientProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client;
import java.net.URI;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeHttpProxyAddress.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java
index d9ba79262f..e156d30885 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeHttpProxyAddress.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client.internal;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeServerAddress.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java
index 952e7526ca..7c3bfe1df2 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OseeServerAddress.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client.internal;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneUriProviderImpl.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java
index 3310ed9b18..787bbfb22a 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneUriProviderImpl.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java
@@ -8,15 +8,15 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client.internal;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import java.util.Map.Entry;
+import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.framework.core.services.URIProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.HttpUrlBuilder;
import com.google.inject.Inject;
/**
@@ -40,24 +40,23 @@ public class StandadloneUriProviderImpl implements URIProvider {
}
@Override
- public URI getApplicationServerURI() throws OseeCoreException {
+ public URI getApplicationServerURI() {
URI toReturn = null;
try {
toReturn = new URI(getServerAddress());
} catch (URISyntaxException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ throw new OseeCoreException(ex);
}
return toReturn;
}
@Override
- public URI getEncodedURI(String context, Map<String, String> params) throws OseeCoreException {
- URI toReturn = null;
- try {
- toReturn = new URI(HttpUrlBuilder.createURL(getServerAddress(), context, params));
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
+ public URI getEncodedURI(String context, Map<String, String> params) {
+ UriBuilder builder = UriBuilder.fromPath(getServerAddress()).path(context);
+ for (Entry<String, String> entry : params.entrySet()) {
+ builder.queryParam(entry.getKey(), entry.getValue());
}
- return toReturn;
+ return builder.build();
}
+
};
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneWebClientProvider.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java
index 1abed53231..93994d177f 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneWebClientProvider.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java
@@ -8,11 +8,12 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client.internal;
import java.net.URI;
import java.util.Map;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.rest.client.WebClientProvider;
import com.google.inject.Inject;
import com.sun.jersey.api.client.AsyncWebResource;
import com.sun.jersey.api.client.Client;
@@ -57,6 +58,8 @@ public class StandadloneWebClientProvider implements WebClientProvider {
properties.put(ApacheHttpClientConfig.PROPERTY_PROXY_URI, proxyAddress);
}
client = ApacheHttpClient.create(clientConfig);
+ // client.setReadTimeout(interval);
+ // client.setConnectTimeout(interval);
}
return client;
}
diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandaloneModule.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandaloneModule.java
new file mode 100644
index 0000000000..2266838786
--- /dev/null
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandaloneModule.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.rest.client.internal;
+
+import org.eclipse.osee.framework.core.services.URIProvider;
+import org.eclipse.osee.rest.client.OseeClientConfig;
+import org.eclipse.osee.rest.client.WebClientProvider;
+import com.google.inject.AbstractModule;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StandaloneModule extends AbstractModule {
+
+ private final OseeClientConfig config;
+
+ public StandaloneModule(OseeClientConfig config) {
+ this.config = config;
+ }
+
+ @Override
+ protected void configure() {
+ bindConstant().annotatedWith(OseeServerAddress.class).to(config.getServerAddress());
+ bindConstant().annotatedWith(OseeHttpProxyAddress.class).to(config.getProxyAddress());
+
+ bind(WebClientProvider.class).to(StandadloneWebClientProvider.class);
+ bind(URIProvider.class).to(StandadloneUriProviderImpl.class);
+ }
+}
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProviderImpl.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/WebClientProviderImpl.java
index 60e8d19e19..5cfe043f56 100644
--- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/WebClientProviderImpl.java
+++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/WebClientProviderImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.rest.client.internal;
+package org.eclipse.osee.rest.client.internal;
import java.net.URI;
import java.util.Map;
@@ -17,6 +17,7 @@ import org.eclipse.core.net.proxy.IProxyChangeEvent;
import org.eclipse.core.net.proxy.IProxyChangeListener;
import org.eclipse.core.net.proxy.IProxyData;
import org.eclipse.core.net.proxy.IProxyService;
+import org.eclipse.osee.rest.client.WebClientProvider;
import com.sun.jersey.api.client.AsyncWebResource;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
diff --git a/plugins/org.eclipse.osee.x.core.parent/pom.xml b/plugins/org.eclipse.osee.x.core.parent/pom.xml
index ab80caa42b..9f2c32efb1 100644
--- a/plugins/org.eclipse.osee.x.core.parent/pom.xml
+++ b/plugins/org.eclipse.osee.x.core.parent/pom.xml
@@ -53,6 +53,7 @@
<module>../../plugins/org.eclipse.osee.display.mvp.test</module>
<module>../../plugins/org.eclipse.osee.rest.admin</module>
+ <module>../../plugins/org.eclipse.osee.rest.client</module>
<module>../../features/org.eclipse.osee.x.core.external.feature</module>
<module>../../features/org.eclipse.osee.x.core.feature</module>
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
index d690aeb021..287c991bd1 100644
--- a/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/META-INF/MANIFEST.MF
@@ -5,11 +5,12 @@ Bundle-SymbolicName: org.eclipse.osee.x.server.integration.tests
Bundle-Version: 0.16.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: Eclipse Open System Engineering Environment
-Require-Bundle: org.junit;bundle-version="4.11.0",
+Require-Bundle: org.junit,
org.eclipse.osee.orcs.rest.model,
org.eclipse.osee.orcs.rest.client,
org.databene.contiperf
Import-Package: org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
- org.eclipse.osee.framework.jdk.core.type
+ org.eclipse.osee.framework.jdk.core.type,
+ org.eclipse.osee.rest.client
diff --git a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/IntegrationUtil.java b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/IntegrationUtil.java
index 545a03f165..0f0cdbe071 100644
--- a/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/IntegrationUtil.java
+++ b/plugins/org.eclipse.osee.x.server.integration.tests/src/org/eclipse/osee/x/server/integration/tests/performance/IntegrationUtil.java
@@ -15,8 +15,8 @@ import org.databene.contiperf.report.CSVLatencyReportModule;
import org.databene.contiperf.report.CSVSummaryReportModule;
import org.databene.contiperf.report.HtmlReportModule;
import org.eclipse.osee.orcs.rest.client.OseeClient;
-import org.eclipse.osee.orcs.rest.client.OseeClientConfig;
import org.eclipse.osee.orcs.rest.client.OseeClientStandaloneSetup;
+import org.eclipse.osee.rest.client.OseeClientConfig;
import org.junit.rules.MethodRule;
public final class IntegrationUtil {

Back to the top