@Singleton
public class Checker
extends java.lang.Object
| Constructor and Description |
|---|
Checker() |
| Modifier and Type | Method and Description |
|---|---|
<T extends ComponentResult> |
checkComponentResult(T componentResult,
User user,
boolean studyMustNotBeLocked)
Checks a ComponentResult whether the belonging Study and Component are fine (checkStandard).
|
void |
checkComponentResults(java.util.List<ComponentResult> componentResultList,
User user,
boolean studyMustNotBeLocked)
Checks a list of ComponentResult.
|
void |
checkDefaultBatch(Batch batch)
Throws an ForbiddenException if this batch is the default batch of it's study.
|
void |
checkStandardForBatch(Batch batch,
java.lang.Long batchId,
User user) |
void |
checkStandardForBatch(Batch batch,
Study study,
java.lang.Long batchId)
Checks the batch and throws an Exception in case of a problem.
|
void |
checkStandardForComponent(java.lang.Long componentId,
Component component,
User user) |
void |
checkStandardForComponent(java.lang.Long studyId,
java.lang.Long componentId,
Component component)
Checks the component of this study and throws an Exception in case of a problem.
|
void |
checkStandardForGroup(GroupResult groupResult,
java.lang.Long groupResultId,
User user) |
void |
checkStandardForGroup(GroupResult groupResult,
Study study,
java.lang.Long groupResultId)
Checks the group and throws an Exception in case of a problem.
|
void |
checkStandardForStudy(Study study,
java.lang.Long studyId,
User user)
Checks the study and throws an Exception in case of a problem.
|
void |
checkStudyLocked(Study study)
Throws an ForbiddenException if a study is locked.
|
void |
checkStudyResult(StudyResult studyResult,
User user,
boolean studyMustNotBeLocked)
Checks a StudyResult whether the belonging Study is fine, especially that the StudyResult belongs to this user.
|
void |
checkStudyResults(java.util.List<StudyResult> studyResultList,
User user,
boolean studyMustNotBeLocked)
Checks a list of StudyResult.
|
void |
checkWorker(Worker worker,
java.lang.Long workerId)
Throws a Exception in case the worker doesn't exist.
|
void |
isUserAllowedToAccessWorker(User user,
Worker worker) |
public void checkStandardForComponent(java.lang.Long studyId,
java.lang.Long componentId,
Component component)
throws NotFoundException,
ForbiddenException
NotFoundExceptionForbiddenExceptionpublic void checkStandardForComponent(java.lang.Long componentId,
Component component,
User user)
throws NotFoundException,
ForbiddenException
NotFoundExceptionForbiddenExceptionpublic void checkStandardForBatch(Batch batch, Study study, java.lang.Long batchId) throws ForbiddenException, NotFoundException
ForbiddenExceptionNotFoundExceptionpublic void checkStandardForBatch(Batch batch, java.lang.Long batchId, User user) throws NotFoundException, ForbiddenException
NotFoundExceptionForbiddenExceptionpublic void checkStandardForGroup(GroupResult groupResult, Study study, java.lang.Long groupResultId) throws ForbiddenException, NotFoundException
ForbiddenExceptionNotFoundExceptionpublic void checkStandardForGroup(GroupResult groupResult, java.lang.Long groupResultId, User user) throws ForbiddenException, NotFoundException
ForbiddenExceptionNotFoundExceptionpublic void checkDefaultBatch(Batch batch) throws ForbiddenException
ForbiddenExceptionpublic void checkStudyLocked(Study study) throws ForbiddenException
ForbiddenExceptionpublic void checkStandardForStudy(Study study, java.lang.Long studyId, User user) throws ForbiddenException, NotFoundException
ForbiddenExceptionNotFoundExceptionpublic void checkComponentResults(java.util.List<ComponentResult> componentResultList, User user, boolean studyMustNotBeLocked) throws ForbiddenException, NotFoundException
componentResultList - A list of ComponentResultsuser - The study that corresponds to the results must have this user otherwise
ForbiddenException will be thrown.studyMustNotBeLocked - If true the study that corresponds to the results must not be locked and it will
throw an ForbiddenException.ForbiddenExceptionNotFoundExceptionpublic <T extends ComponentResult> void checkComponentResult(T componentResult, User user, boolean studyMustNotBeLocked) throws ForbiddenException, NotFoundException
componentResult - A ComponentResultsuser - The study that corresponds to the results must have this user otherwise
ForbiddenException will be thrown.studyMustNotBeLocked - If true the study that corresponds to the results must not be locked and it will
throw an ForbiddenException.ForbiddenExceptionNotFoundExceptionpublic void checkStudyResult(StudyResult studyResult, User user, boolean studyMustNotBeLocked) throws ForbiddenException, NotFoundException
studyResult - A StudyResultsuser - The study that corresponds to the results must have this user otherwise
ForbiddenException will be thrown.studyMustNotBeLocked - If true the study that corresponds to the results must not be locked and it will
throw an ForbiddenException.ForbiddenExceptionNotFoundExceptionpublic void checkStudyResults(java.util.List<StudyResult> studyResultList, User user, boolean studyMustNotBeLocked) throws ForbiddenException, NotFoundException
studyResultList - A list of StudyResultsuser - The study that corresponds to the results must have this user otherwise
ForbiddenException will be thrown.studyMustNotBeLocked - If true the study that corresponds to the results must not be locked and it will
throw an ForbiddenException.ForbiddenExceptionNotFoundExceptionpublic void checkWorker(Worker worker, java.lang.Long workerId) throws BadRequestException
BadRequestExceptionpublic void isUserAllowedToAccessWorker(User user, Worker worker) throws ForbiddenException
ForbiddenException