diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java index 27ca018f..8d8dc998 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java @@ -18,6 +18,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Function; +import ch.ethz.seb.sebserver.gbl.FeatureService; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.text.StringEscapeUtils; import org.eclipse.swt.SWT; @@ -109,6 +110,7 @@ public class MonitoringRunningExam implements TemplateComposer { private final MonitoringExamSearchPopup monitoringExamSearchPopup; private final SEBSendLockPopup sebSendLockPopup; private final MonitoringProctoringService monitoringProctoringService; + private final FeatureService featureService; private final boolean distributedSetup; private final long pollInterval; @@ -121,6 +123,7 @@ public class MonitoringRunningExam implements TemplateComposer { final SEBSendLockPopup sebSendLockPopup, final MonitoringProctoringService monitoringProctoringService, final GuiServiceInfo guiServiceInfo, + final FeatureService featureService, @Value("${sebserver.gui.webservice.poll-interval:2000}") final long pollInterval) { this.serverPushService = serverPushService; @@ -134,6 +137,7 @@ public class MonitoringRunningExam implements TemplateComposer { this.distributedSetup = guiServiceInfo.isDistributedSetup(); this.monitoringExamSearchPopup = monitoringExamSearchPopup; this.sebSendLockPopup = sebSendLockPopup; + this.featureService = featureService; } @Override @@ -315,7 +319,9 @@ public class MonitoringRunningExam implements TemplateComposer { final PageActionBuilder actionBuilder = this.pageService .pageActionBuilder(pageContext.clearEntityKeys()); - final boolean proctoringEnabled = proctoringSettings != null && + final boolean spsFeatureEnabled = this.featureService.isEnabled(FeatureService.SCREEN_PROCTORING_FEATURE_NAME); + final boolean proctoringEnabled = spsFeatureEnabled && + proctoringSettings != null && BooleanUtils.toBoolean(proctoringSettings.enableProctoring); final boolean screenProctoringEnabled = screenProctoringSettings != null && BooleanUtils.toBoolean(screenProctoringSettings.enableScreenProctoring); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ClientEventDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ClientEventDAOImpl.java index fe3a5469..d7ef80b4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ClientEventDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ClientEventDAOImpl.java @@ -19,6 +19,7 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.*; import org.mybatis.dynamic.sql.SqlBuilder; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; @@ -45,11 +46,6 @@ import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ClientNotificatio import ch.ethz.seb.sebserver.webservice.datalayer.batis.mapper.ClientNotificationRecordMapper; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ClientEventRecord; import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.ClientNotificationRecord; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ClientEventDAO; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.DAOLoggingSupport; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.ResourceNotFoundException; -import ch.ethz.seb.sebserver.webservice.servicelayer.dao.TransactionHandler; @Lazy @Component @@ -255,8 +251,9 @@ public class ClientEventDAOImpl implements ClientEventDAO { records); } - if (records.isEmpty() || records.size() > 1) { - throw new IllegalStateException( + if (records.size() != 1) { + throw new NoResourceFoundException( + EntityType.CLIENT_NOTIFICATION, "Failed to find pending notification event for confirm:" + notificationValueId); } 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 edd0f8a7..4abf0951 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 @@ -243,12 +243,7 @@ public class ExamSessionServiceImpl implements ExamSessionService { flushCache(exam); } - if (log.isDebugEnabled()) { - log.info("Exam {} is not currently running", examId); - } - - throw new NoSuchElementException( - "No currently running exam found for id: " + examId); + throw new NoSuchElementException("No currently running exam found for id: " + examId); } }); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientInstructionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientInstructionServiceImpl.java index 46545bf8..97b70592 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientInstructionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientInstructionServiceImpl.java @@ -214,7 +214,7 @@ public class SEBClientInstructionServiceImpl implements SEBClientInstructionServ .append(Constants.CURLY_BRACE_CLOSE) .toString(); - if (log.isDebugEnabled()) { + if (log.isTraceEnabled()) { log.debug("Send SEB client instruction: {} to: {} ", instructionJSON, connectionToken); } @@ -358,7 +358,7 @@ public class SEBClientInstructionServiceImpl implements SEBClientInstructionServ return instruction; } - if (log.isDebugEnabled()) { + if (log.isTraceEnabled()) { log.debug("Put SEB instruction into instruction queue: {}", instruction); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientNotificationServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientNotificationServiceImpl.java index 777ddda3..2380660a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientNotificationServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientNotificationServiceImpl.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import ch.ethz.seb.sebserver.webservice.servicelayer.dao.NoResourceFoundException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; @@ -95,6 +96,13 @@ public class SEBClientNotificationServiceImpl implements SEBClientNotificationSe .map(this::removeFromCache) .getOrThrow(); + } catch (final NoResourceFoundException e) { + if (log.isDebugEnabled()) { + log.debug( + "Notification already confirmed or removed. connectionId: {}, confirmId: {}", + event.connectionId, + event.getValue()); + } } catch (final Exception e) { log.error( "Failed to confirm pending notification from SEB Client side. event: {}", event, e); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ScreenProctoringServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ScreenProctoringServiceImpl.java index 4573371d..a616f9c7 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ScreenProctoringServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ScreenProctoringServiceImpl.java @@ -213,10 +213,6 @@ public class ScreenProctoringServiceImpl implements ScreenProctoringService { return this.examDAO.byPK(examId) .map(exam -> { - if (log.isDebugEnabled()) { - log.debug("Update changed exam attributes for screen proctoring: {}", exam); - } - final String enabled = exam.additionalAttributes .get(ScreenProctoringSettings.ATTR_ENABLE_SCREEN_PROCTORING);