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.orcs.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.orcs.rest.client')
2 files changed, 45 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java index 245802ce930..125c3a03bca 100644 --- a/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java +++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/OrcsClientModule.java @@ -10,6 +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 com.google.inject.AbstractModule; import com.google.inject.TypeLiteral; @@ -42,6 +43,7 @@ public class OrcsClientModule extends AbstractModule { } }; bindListener(subtypeOf(OseeClientImpl.class), listener); + bind(URIProvider.class).to(StandadloneUriProviderImpl.class); } private static Matcher<? super TypeLiteral<?>> subtypeOf(Class<?> superclass) { 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.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneUriProviderImpl.java new file mode 100644 index 00000000000..3aa48e1720c --- /dev/null +++ b/plugins/org.eclipse.osee.orcs.rest.client/src/org/eclipse/osee/orcs/rest/client/internal/StandadloneUriProviderImpl.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.orcs.rest.client.internal; + +import java.net.URI; +import java.net.URISyntaxException; +import org.eclipse.osee.framework.core.services.URIProvider; +import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.rest.client.OseeServerAddress; +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; + } + + @Override + public URI getApplicationServerURI() { + URI toReturn = null; + try { + toReturn = new URI(serverAddress); + } catch (URISyntaxException ex) { + throw new OseeCoreException(ex); + } + return toReturn; + } + +}; |