diff options
author | Roberto E. Escobar | 2014-01-11 01:38:56 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2014-01-13 18:52:49 +0000 |
commit | 49e09eb4c46b84b2f5510d725b4c6db8986ac1a9 (patch) | |
tree | b847d17456493178ef6db4e10d0a86cd592a38fa /plugins/org.eclipse.osee.rest.client | |
parent | 3c82fe963f22246bf32eb341c71ebff41aebfe92 (diff) | |
download | org.eclipse.osee-49e09eb4c46b84b2f5510d725b4c6db8986ac1a9.tar.gz org.eclipse.osee-49e09eb4c46b84b2f5510d725b4c6db8986ac1a9.tar.xz org.eclipse.osee-49e09eb4c46b84b2f5510d725b4c6db8986ac1a9.zip |
bug[ats_ATS10062]: Remove core.model dependency from REST client
Change-Id: I8184de2ba740103b3e1b8ee3a13cedefe793f2d9
Diffstat (limited to 'plugins/org.eclipse.osee.rest.client')
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeHttpProxyAddress.java (renamed from plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeServerAddress.java (renamed from plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java) | 2 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java | 62 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java | 1 | ||||
-rw-r--r-- | plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandaloneModule.java | 4 |
6 files changed, 5 insertions, 68 deletions
diff --git a/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF index cf2d3315ba8..d3af4e848b1 100644 --- a/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.rest.client/META-INF/MANIFEST.MF @@ -17,8 +17,6 @@ Import-Package: com.google.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 diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeHttpProxyAddress.java index e156d308852..cab41a43c15 100644 --- a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeHttpProxyAddress.java +++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeHttpProxyAddress.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.rest.client.internal; +package org.eclipse.osee.rest.client; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeServerAddress.java index 7c3bfe1df26..e1f7512b809 100644 --- a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/OseeServerAddress.java +++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/OseeServerAddress.java @@ -8,7 +8,7 @@ * Contributors: * Boeing - initial API and implementation *******************************************************************************/ -package org.eclipse.osee.rest.client.internal; +package org.eclipse.osee.rest.client; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java deleted file mode 100644 index 787bbfb22a6..00000000000 --- a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneUriProviderImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * 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 java.net.URI; -import java.net.URISyntaxException; -import java.util.Map; -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 com.google.inject.Inject; - -/** - * @author Roberto E. Escobar - */ -public class StandadloneUriProviderImpl implements URIProvider { - - private final String serverAddress; - - @Inject - public StandadloneUriProviderImpl(@OseeServerAddress String serverAddress) { - this.serverAddress = serverAddress; - } - - public String getServerAddress() { - String value = serverAddress; - if (!value.endsWith("/")) { - value += '/'; - } - return value; - } - - @Override - public URI getApplicationServerURI() { - URI toReturn = null; - try { - toReturn = new URI(getServerAddress()); - } catch (URISyntaxException ex) { - throw new OseeCoreException(ex); - } - return toReturn; - } - - @Override - 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 builder.build(); - } - -}; diff --git a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java index 93994d177ff..8e32508fdba 100644 --- a/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java +++ b/plugins/org.eclipse.osee.rest.client/src/org/eclipse/osee/rest/client/internal/StandadloneWebClientProvider.java @@ -13,6 +13,7 @@ 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.OseeHttpProxyAddress; import org.eclipse.osee.rest.client.WebClientProvider; import com.google.inject.Inject; import com.sun.jersey.api.client.AsyncWebResource; 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 index 22668387865..c184a5b6515 100644 --- 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 @@ -10,8 +10,9 @@ *******************************************************************************/ 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.OseeHttpProxyAddress; +import org.eclipse.osee.rest.client.OseeServerAddress; import org.eclipse.osee.rest.client.WebClientProvider; import com.google.inject.AbstractModule; @@ -32,6 +33,5 @@ public class StandaloneModule extends AbstractModule { bindConstant().annotatedWith(OseeHttpProxyAddress.class).to(config.getProxyAddress()); bind(WebClientProvider.class).to(StandadloneWebClientProvider.class); - bind(URIProvider.class).to(StandadloneUriProviderImpl.class); } } |