diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java index ad785589..cc8a5cac 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityKey.java @@ -18,15 +18,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import ch.ethz.seb.sebserver.gbl.api.EntityType; -/** A EntityKey uniquely identifies a domain entity within the SEB Server's domain model. - * A EntityKey consists of the model identifier of a domain entity and the type of the entity. - * JSON: - *
- *
- *
- * 
- * - * */ +/** An EntityKey uniquely identifies a domain entity within the SEB Server's domain model. + * An EntityKey consists of the model identifier of a domain entity and the type of the entity. */ @JsonIgnoreProperties(ignoreUnknown = true) public class EntityKey implements ModelIdAware, Serializable { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java index deed1392..2e5cbb4e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java @@ -114,7 +114,7 @@ public interface ExamDAO extends ActivatableEntityDAO, BulkActionSup * @return Result refer to the lock-check-result or to an error if happened */ Result isLocked(Long examId); - /** Use this to check of the exam with the specified identifier is up to date + /** Use this to check if the exam with the specified identifier is up to date * * @param examId the exam identifier * @param updateId the update identifier of the exam diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java index 758ab9b7..66babe9c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java @@ -199,6 +199,7 @@ public class ExamSessionServiceImpl implements ExamSessionService { log.trace("Running exam request for exam {}", examId); } + updateExamCache(examId); final Exam exam = this.examSessionCacheService.getRunningExam(examId); if (this.examSessionCacheService.isRunning(exam)) { @@ -327,6 +328,10 @@ public class ExamSessionServiceImpl implements ExamSessionService { @Override public Result updateExamCache(final Long examId) { final Exam exam = this.examSessionCacheService.getRunningExam(examId); + if (exam == null) { + return Result.ofEmpty(); + } + final Boolean isUpToDate = this.examDAO.upToDate(examId, exam.lastUpdate) .onError(t -> log.error("Failed to verify if cached exam is up to date: {}", exam, t)) .getOr(false); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java index f79e715b..6a8380a7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ConfigurationNodeController.java @@ -270,7 +270,7 @@ public class ConfigurationNodeController extends EntityController doImport = doImport(password, request, followup); if (doImport.hasError()) { - // rollback if the new configuration + // rollback of the new configuration this.configurationNodeDAO.delete(new HashSet<>(Arrays.asList(new EntityKey( followup.configurationNodeId, EntityType.CONFIGURATION_NODE)))); @@ -510,6 +510,7 @@ public class ConfigurationNodeController extends EntityController