]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
Added a trivial 'version' service, per Richard's suggestion, so that clients can...
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 22 Apr 2009 03:05:28 +0000 (03:05 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 22 Apr 2009 03:05:28 +0000 (03:05 +0000)
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java
HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/VersionResource.java [new file with mode: 0755]

index 6545a2ee45e35ea764f811e462db50707bfb4bfd..c9dd1273ce9bbcbefbc7c442c6b1202c78835b82 100644 (file)
@@ -12,6 +12,7 @@ public class HelloworldNuxeoApplication extends Application {
     public HelloworldNuxeoApplication() {
         singletons.add(new CollectionObjectResource());
         singletons.add(new DomainIdentifierResource());
+        singletons.add(new VersionResource());
     }
 
     @Override
diff --git a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/VersionResource.java b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/VersionResource.java
new file mode 100755 (executable)
index 0000000..c6fb56a
--- /dev/null
@@ -0,0 +1,44 @@
+package org.collectionspace.hello.services;
+
+/**
+ *     <p>
+ *  Service that returns the overall version of CollectionSpace services.
+ *  Can also be called as a "ping"-type service to test basic connectivity.
+ *  </p>
+ *
+ *     @author $Author: aron $
+ *     @version $Revision: 547 $
+ *  @version $Date: 2009-01-30 12:48:42 -0800 (Fri, 30 Jan 2009) $
+ *
+ */
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path("/version")
+@Produces("text/plain")
+public class VersionResource {
+
+  final static String CO_VERSION = "0.1";
+
+  /////////////////////////////////////////////////////////////////
+  /**
+   * Class constructor (no argument).
+   */
+  public VersionResource() {
+    // do nothing
+  }
+    
+  /////////////////////////////////////////////////////////////////
+       /**
+        * Returns the version of the CollectionSpace system.
+        *
+        * @return  The version of the CollectionSpace system.
+        */
+  @GET
+  public String getVersion() {
+    return CO_VERSION;
+  }
+
+}