Guest User

Untitled

a guest
Aug 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. package org.junbc.surveyor.service;
  2.  
  3. import java.util.List;
  4.  
  5. import org.junbc.surveyor.model.Question;
  6. import org.junbc.surveyor.model.Survey;
  7. import org.junbc.surveyor.service.exception.ServiceException;
  8.  
  9. public interface SurveyService {
  10.  
  11. /**
  12. * <p>
  13. * Create survey without questions
  14. * @param userId
  15. * The id of the current {@link User}.
  16. * @return {@link Survey}
  17. * </p>
  18. * @throws ServiceException
  19. * If any errors are encountered in the repository layer
  20. * while saving data.
  21. **/
  22. Survey create (Survey survey) throws ServiceException;
  23.  
  24. /**
  25. * <p>
  26. * @return List of surveys without questions
  27. * </p>
  28. * @throws ServiceException
  29. * If any errors are encountered in the repository layer
  30. * while retrieving data.
  31. **/
  32. List<Survey> findAll() throws ServiceException;
  33.  
  34. /**
  35. * <p>
  36. * @param userId
  37. * The id of the current {@link User}.
  38. * @return List of surveys without questions
  39. * </p>
  40. * @throws ServiceException
  41. * If any errors are encountered in the repository layer
  42. * while retrieving data.
  43. **/
  44. List<Survey> findAllBy(String userId) throws ServiceException;
  45.  
  46. /**
  47. * <p>
  48. * @param survey
  49. * The {@link Survey}.
  50. * @return true (when survey with current name exist) / false (when survey with current name not exist)
  51. * </p>
  52. * @throws ServiceException
  53. * If any errors are encountered in the repository layer
  54. * while retrieving data.
  55. **/
  56. boolean exists(Survey survey) throws ServiceException;
  57.  
  58.  
  59. /**
  60. * <p>
  61. * This method save several questions
  62. * @param questions
  63. * The List of {@link Question}.
  64. * @return void
  65. * </p>
  66. * @throws ServiceException
  67. * If any errors are encountered in the repository layer
  68. * while saving data.
  69. **/
  70. List<Question> createAll(List<Question> questions) throws ServiceException;
  71.  
  72. void deleteBy(String surveyId) throws ServiceException;
  73. }
Add Comment
Please, Sign In to add comment