Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.junbc.surveyor.service;
- import java.util.List;
- import org.junbc.surveyor.model.Question;
- import org.junbc.surveyor.model.Survey;
- import org.junbc.surveyor.service.exception.ServiceException;
- public interface SurveyService {
- /**
- * <p>
- * Create survey without questions
- * @param userId
- * The id of the current {@link User}.
- * @return {@link Survey}
- * </p>
- * @throws ServiceException
- * If any errors are encountered in the repository layer
- * while saving data.
- **/
- Survey create (Survey survey) throws ServiceException;
- /**
- * <p>
- * @return List of surveys without questions
- * </p>
- * @throws ServiceException
- * If any errors are encountered in the repository layer
- * while retrieving data.
- **/
- List<Survey> findAll() throws ServiceException;
- /**
- * <p>
- * @param userId
- * The id of the current {@link User}.
- * @return List of surveys without questions
- * </p>
- * @throws ServiceException
- * If any errors are encountered in the repository layer
- * while retrieving data.
- **/
- List<Survey> findAllBy(String userId) throws ServiceException;
- /**
- * <p>
- * @param survey
- * The {@link Survey}.
- * @return true (when survey with current name exist) / false (when survey with current name not exist)
- * </p>
- * @throws ServiceException
- * If any errors are encountered in the repository layer
- * while retrieving data.
- **/
- boolean exists(Survey survey) throws ServiceException;
- /**
- * <p>
- * This method save several questions
- * @param questions
- * The List of {@link Question}.
- * @return void
- * </p>
- * @throws ServiceException
- * If any errors are encountered in the repository layer
- * while saving data.
- **/
- List<Question> createAll(List<Question> questions) throws ServiceException;
- void deleteBy(String surveyId) throws ServiceException;
- }
Add Comment
Please, Sign In to add comment