From: Aron Roberts Date: Wed, 22 Apr 2009 03:05:28 +0000 (+0000) Subject: Added a trivial 'version' service, per Richard's suggestion, so that clients can... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e17221405280323a0cb80c063e3c60bef78c13a8;p=tmp%2Fjakarta-migration.git Added a trivial 'version' service, per Richard's suggestion, so that clients can 'ping' the service and retrieve a version identifier. This could be expanded upon in the future to provide more info about the installed service, runtime, et al. --- diff --git a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java index 6545a2ee4..c9dd1273c 100644 --- a/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java +++ b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/HelloworldNuxeoApplication.java @@ -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 index 000000000..c6fb56aad --- /dev/null +++ b/HelloWorld/HelloWorldNuxeoService/src/main/java/org/collectionspace/hello/services/VersionResource.java @@ -0,0 +1,44 @@ +package org.collectionspace.hello.services; + +/** + *

+ * Service that returns the overall version of CollectionSpace services. + * Can also be called as a "ping"-type service to test basic connectivity. + *

+ * + * @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; + } + +}