summaryrefslogtreecommitdiffstats
path: root/proxy/code/src
diff options
context:
space:
mode:
authorjesus m. rodriguez <jesusr@redhat.com>2009-06-26 14:33:21 -0400
committerjesus m. rodriguez <jesusr@redhat.com>2009-06-26 14:33:21 -0400
commit2ab21a6332fa4c39fa543c970d90279d6b316be8 (patch)
tree683bb48e5e11f2f9d0dc9757bf11eaf2e6ecbd57 /proxy/code/src
parent6d46157fdf4cedeef9d0f0a8bca6634f97511357 (diff)
GET & POST methods work.
Use test-connection.py MSG to test the api interaction.
Diffstat (limited to 'proxy/code/src')
-rw-r--r--proxy/code/src/org/fedoraproject/candlepin/Hello.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/Hello.java b/proxy/code/src/org/fedoraproject/candlepin/Hello.java
index eabc043..c3ad2c7 100644
--- a/proxy/code/src/org/fedoraproject/candlepin/Hello.java
+++ b/proxy/code/src/org/fedoraproject/candlepin/Hello.java
@@ -1,6 +1,30 @@
package org.fedoraproject.candlepin;
+import com.sun.jersey.api.representation.Form;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Produces;
+import javax.ws.rs.Path;
+import javax.ws.rs.POST;
+
+@Path("/helloworld")
public class Hello {
+ private static String message = "Hello from Candlepin";
+
+ @GET
+ @Produces("text/plain")
+ public String getClinchedMessage() {
+ return message;
+ }
+
+ @POST
+ @Produces("text/plain")
+ public void setMessage(Form form) {
+ System.out.println(form.toString());
+ message = form.getFirst("message");
+
+ }
+
public static void main(String[] args) {
System.out.println("Hello from Candlepin");
}