package org.splat.service;
-import java.util.Date;
import java.util.List;
import org.splat.dal.bo.kernel.User;
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;
/**
* @param index
* the study id
*/
- public void removeStudy(final Long index);
+ void removeStudy(final Long index);
/**
* Create a new study.
*/
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;
}