From c7c704a4733053a5fe2c0e0fa93e11739dfdc23c Mon Sep 17 00:00:00 2001
From: cramakri <cramakri>
Date: Wed, 12 May 2010 16:58:39 +0000
Subject: [PATCH] LMS-1527 Made RawDataService extend IRpcService.

SVN: 15974
---
 .../server/api/v1/RawDataService.java         | 24 +++++++++++++------
 .../server/api/v1/RawDataServiceLogger.java   | 15 ++++++++----
 .../shared/api/v1/IRawDataService.java        | 11 +++++----
 3 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java
index 8025229d19b..474519b9b20 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataService.java
@@ -39,7 +39,7 @@ import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.dto.MsInjectionSample;
 
 /**
  * Imlementation of {@link IRawDataService}.
- *
+ * 
  * @author Franz-Josef Elmer
  */
 public class RawDataService extends AbstractServer<IRawDataService> implements IRawDataService
@@ -50,13 +50,13 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I
     {
     }
 
-    public RawDataService(final ISessionManager<Session> sessionManager, final IDAOFactory daoFactory,
-            IRawDataServiceInternal service)
+    public RawDataService(final ISessionManager<Session> sessionManager,
+            final IDAOFactory daoFactory, IRawDataServiceInternal service)
     {
         super(sessionManager, daoFactory);
         this.service = service;
     }
-    
+
     public IRawDataService createLogger(IInvocationLoggerContext context)
     {
         return new RawDataServiceLogger(getSessionManager(), context);
@@ -75,7 +75,7 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I
                 result.add(sample.getSample());
             }
             return result;
-            
+
         } finally
         {
             service.logout(session.getSessionToken());
@@ -116,7 +116,7 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I
             service.logout(session.getSessionToken());
         }
     }
-    
+
     private SessionContextDTO login(String userID)
     {
         SessionContextDTO session = service.tryToAuthenticate(userID, "dummy-password");
@@ -126,5 +126,15 @@ public class RawDataService extends AbstractServer<IRawDataService> implements I
         }
         return session;
     }
-    
+
+    public int getMajorVersion()
+    {
+        return 1;
+    }
+
+    public int getMinorVersion()
+    {
+        return 0;
+    }
+
 }
diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java
index 91498ac305f..6674e8ebf00 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/api/v1/RawDataServiceLogger.java
@@ -27,15 +27,12 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.Session;
 import ch.systemsx.cisd.openbis.plugin.phosphonetx.shared.api.v1.IRawDataService;
 
 /**
- * 
- *
  * @author Franz-Josef Elmer
  */
 class RawDataServiceLogger extends AbstractServerLogger implements IRawDataService
 {
 
-    RawDataServiceLogger(ISessionManager<Session> sessionManager,
-            IInvocationLoggerContext context)
+    RawDataServiceLogger(ISessionManager<Session> sessionManager, IInvocationLoggerContext context)
     {
         super(sessionManager, context);
     }
@@ -61,4 +58,14 @@ class RawDataServiceLogger extends AbstractServerLogger implements IRawDataServi
                 dataSetProcessingKey, numberOfDataSets);
     }
 
+    public int getMajorVersion()
+    {
+        return 1;
+    }
+
+    public int getMinorVersion()
+    {
+        return 0;
+    }
+
 }
diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java
index 6280517b657..62660fca22e 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/shared/api/v1/IRawDataService.java
@@ -20,6 +20,7 @@ import java.util.List;
 
 import org.springframework.transaction.annotation.Transactional;
 
+import ch.systemsx.cisd.common.api.IRpcService;
 import ch.systemsx.cisd.openbis.generic.shared.IServer;
 import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet;
 import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed;
@@ -28,10 +29,10 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample;
 
 /**
  * Service for querying raw data.
- *
+ * 
  * @author Franz-Josef Elmer
  */
-public interface IRawDataService extends IServer
+public interface IRawDataService extends IServer, IRpcService
 {
     /**
      * Returns all samples of type MS_INJECTION in space MS_DATA which have a parent sample which
@@ -47,11 +48,11 @@ public interface IRawDataService extends IServer
     @Transactional(readOnly = true)
     @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER)
     public List<DatastoreServiceDescription> listDataStoreServices(String sessionToken);
-    
+
     /**
      * Processes the data sets of specified samples by the DSS processing plug-in of specified key
-     * for the specified user. Implementations should check that the specified user is allowed
-     * to read specified samples.
+     * for the specified user. Implementations should check that the specified user is allowed to
+     * read specified samples.
      */
     @Transactional(readOnly = true)
     @RolesAllowed(RoleSet.INSTANCE_ADMIN_OBSERVER)
-- 
GitLab