Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2014-10-08 00:12:02 +0000
committerWim Jongman2014-10-08 00:53:45 +0000
commitd42f18de0bd535101a7866edb94f58bba5a2819b (patch)
tree12c04116bc730957267339b36d3d8c330a2b7c28 /examples/bundles/com.mycorp.examples.githubservice
parenta7a1e0ebad03d775b7c0fe81f0e6c3bd3cabd550 (diff)
downloadorg.eclipse.ecf-d42f18de0bd535101a7866edb94f58bba5a2819b.tar.gz
org.eclipse.ecf-d42f18de0bd535101a7866edb94f58bba5a2819b.tar.xz
org.eclipse.ecf-d42f18de0bd535101a7866edb94f58bba5a2819b.zip
Bug 446237 - Remote Service Example - GitHub
Created two projects. One project with the GitHub service API [1] and a locally working implementation [2]. [1] examples/bundles/com.mycorp.examples.githubservice [2] examples/bundles/com.mycorp.examples.githubservice.impl The impl project [2] contains two service interface implementations with main methods. You will need to get an access token from github and insert this token in the main methods for them to function. Change-Id: I2bdb192d7e7653d4b12bd8d445025707ff980b64 Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
Diffstat (limited to 'examples/bundles/com.mycorp.examples.githubservice')
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/.classpath7
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/.gitignore1
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/.project34
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/META-INF/MANIFEST.MF9
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/about.html28
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/build.properties6
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubService.java43
-rw-r--r--examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubServiceAsync.java27
10 files changed, 165 insertions, 0 deletions
diff --git a/examples/bundles/com.mycorp.examples.githubservice/.classpath b/examples/bundles/com.mycorp.examples.githubservice/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/.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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/bundles/com.mycorp.examples.githubservice/.gitignore b/examples/bundles/com.mycorp.examples.githubservice/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/examples/bundles/com.mycorp.examples.githubservice/.project b/examples/bundles/com.mycorp.examples.githubservice/.project
new file mode 100644
index 000000000..b59d62424
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.mycorp.examples.githubservice</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.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.jdt.core.prefs b/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..af0f20f97
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.pde.core.prefs b/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/examples/bundles/com.mycorp.examples.githubservice/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.githubservice/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..15d1e0727
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ECF RS Example GitHub Service API
+Bundle-SymbolicName: com.mycorp.examples.githubservice
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse.org - ECF
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: com.mycorp.examples.githubservice;version="1.0.0"
diff --git a/examples/bundles/com.mycorp.examples.githubservice/about.html b/examples/bundles/com.mycorp.examples.githubservice/about.html
new file mode 100644
index 000000000..4c79781a5
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 25, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/examples/bundles/com.mycorp.examples.githubservice/build.properties b/examples/bundles/com.mycorp.examples.githubservice/build.properties
new file mode 100644
index 000000000..9cbab3c13
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
+src.includes = about.html
diff --git a/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubService.java b/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubService.java
new file mode 100644
index 000000000..e2e3f9f13
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubService.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Remain BV 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: Wim Jongman - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.githubservice;
+
+/**
+ * Example OSGi service for retrieving some data from GitHub.
+ *
+ * @since 1.0
+ */
+public interface IGitHubService {
+
+ /**
+ * Gets all repositories.
+ *
+ * @param pAccessToken
+ * see https://help.github.com/articles/creating-an-access-token-
+ * for-command-line-use/
+ * @return All this repositories for this access token
+ */
+ public String[] getRepositories(String pAccessToken);
+
+ /**
+ * Gets all issues from repository.
+ *
+ * @param pAccessToken
+ * see https://help.github.com/articles/creating-an-access-token-
+ * for-command-line-use/
+ * @param pOwner
+ * the owner of the repository
+ * @param pRepository
+ * the name of the repository to investigate
+ * @return All issues for the passed repository
+ */
+ public String[] getIssues(String pAccessToken, String Owner, String pRepository);
+
+}
diff --git a/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubServiceAsync.java b/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubServiceAsync.java
new file mode 100644
index 000000000..a402ab430
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.githubservice/src/com/mycorp/examples/githubservice/IGitHubServiceAsync.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Composent, Inc. 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: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.githubservice;
+
+import java.util.concurrent.Future;
+
+/**
+ * @since 1.0
+ */
+public interface IGitHubServiceAsync {
+
+ /**
+ * Gets all repositories.
+ *
+ * @param pAccessToken
+ * see https://help.github.com/articles/creating-an-access-token-
+ * for-command-line-use/
+ * @return All this repositories for this access token
+ */
+ public Future<String[]> getRepositoriesAsync(String pAccessToken);
+}

Back to the top