]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/service/StudyService.java
Salome HOME
Satisfy some PMD rules.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyService.java
index 9b7af704e7c2f0bf208f0b106695c84571455538..73d498da2e2bd6d533e8015b91e0ef70049cfcc3 100644 (file)
@@ -9,7 +9,6 @@
 
 package org.splat.service;
 
-import java.util.Date;
 import java.util.List;
 
 import org.splat.dal.bo.kernel.User;
@@ -28,6 +27,7 @@ import org.splat.kernel.MultiplyDefinedException;
 import org.splat.service.dto.DocToCompareDTO;
 import org.splat.service.dto.DocumentDTO;
 import org.splat.service.dto.StudyFacadeDTO;
+import org.splat.service.dto.UserDTO;
 import org.splat.service.dto.StudyFacadeDTO.ScenarioDTO;
 
 /**
@@ -62,7 +62,7 @@ public interface StudyService {
         * @param index
         *            the study id
         */
-       public void removeStudy(final long index);
+       void removeStudy(final Long index);
 
        /**
         * Create a new study.
@@ -185,7 +185,7 @@ public interface StudyService {
         * @see #isPublic()
         */
        boolean moveToPublic(Study aStudy);
-       
+
        /**
         * Moves this study from the Public to the Private area of the repository.
         * 
@@ -273,7 +273,7 @@ public interface StudyService {
         * @return the unmodifiable not null transient list of contributors of this study
         */
        List<User> getContributors(Study aStudy);
-       
+
        /**
         * Mark study as reference.
         * 
@@ -281,7 +281,7 @@ public interface StudyService {
         *            the Study
         */
        void markStudyAsReference(Study aStudy);
-       
+
        /**
         * Remove study as reference. This operation is inverse one to Mark as reference.
         * 
@@ -289,7 +289,7 @@ public interface StudyService {
         *            the Study
         */
        void removeStudyAsReference(Study aStudy);
-       
+
        /**
         * Get studies, scenarios and publications available for comparison.
         * <br><b> DocumentDto.id are actually filled in with Publication ids.</b>
@@ -311,7 +311,7 @@ public interface StudyService {
         *             if a study with such id does not exist in the database.
         */
        String getDescription(Long studyId) throws InvalidParameterException;
-       
+
        /**
         * Set the description attribute related to the study.
         * 
@@ -331,7 +331,7 @@ public interface StudyService {
         * @param studyId
         *            the study id
         * @throws InvalidParameterException
-        *              if no study with such Id has been found in the database.
+        *             if no study with such Id has been found in the database.
         * @return true if succeeded, false if study doesn't have a description.
         */
        boolean removeDescription(final Long studyId)
@@ -345,10 +345,36 @@ public interface StudyService {
         * @param userName
         *            the name of the user who compare the results.
         * @throws IncompatibleDataException
-        *         if data is incompatible for "Compare the studies" functionality.
+        *             if data is incompatible for "Compare the studies" functionality.
         * 
         * @return path to result file in the vault.
         */
        String compare(List<DocToCompareDTO> docsList, final String userName)
                        throws IncompatibleDataException;
+       
+       /**
+        * Get readers of a given study.
+        * @param studyId the study id.
+        * @return list of user DTO corresponding to the study readers.
+        * @throws InvalidParameterException if no study with such id has been found in the database.
+        */
+       List<UserDTO> getReaders(final long studyId) throws InvalidParameterException;
+       
+       /**
+        * Add reader to a given study.
+        * @param studyId the study id.
+        * @param userId the user id.
+        * @return true if the user has been added as a reader
+        * @throws InvalidParameterException if no study or user with such id has been found in the database.
+        */
+       boolean addReader(final long studyId, final long userId) throws InvalidParameterException;
+
+       /**
+        * Remove reader from a given study.
+        * @param studyId the study id.
+        * @param userId the user id.
+        * @return true if the relation has been found and removed
+        * @throws InvalidParameterException if no study or user with such id has been found in the database.
+        */
+       boolean removeReader(final long studyId, final long userId) throws InvalidParameterException;
 }