From 558d6424f7521d641d8069da421692862c91dbe1 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 26 Jan 2023 12:57:21 +0100 Subject: [PATCH] SEBSERV-355 added iPadOS and iOS & IPadOS --- .../gbl/model/exam/ClientGroupData.java | 17 +++++++++++++---- .../gbl/monitoring/ClientOSGroupMatcher.java | 3 ++- src/main/resources/messages.properties | 2 ++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/ClientGroupData.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/ClientGroupData.java index ef6553d6..8b77b4af 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/ClientGroupData.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/exam/ClientGroupData.java @@ -29,12 +29,21 @@ public interface ClientGroupData extends Entity { NONE(null), WINDOWS("Windows"), MAC_OS("macOS"), - I_OS("iOS"); + I_OS("iOS"), + IPAD_OS("iPadOS"), + I_OS_OR_IPAD_OS("iOS", "iPadOS"); - public final String queryString; + public final String queryString1; + public final String queryString2; - private ClientOS(final String queryString) { - this.queryString = queryString; + private ClientOS(final String queryString1) { + this.queryString1 = queryString1; + this.queryString2 = null; + } + + private ClientOS(final String queryString1, final String queryString2) { + this.queryString1 = queryString1; + this.queryString2 = queryString2; } } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/monitoring/ClientOSGroupMatcher.java b/src/main/java/ch/ethz/seb/sebserver/gbl/monitoring/ClientOSGroupMatcher.java index ebbb7e8c..154460ae 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/monitoring/ClientOSGroupMatcher.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/monitoring/ClientOSGroupMatcher.java @@ -37,7 +37,8 @@ public class ClientOSGroupMatcher implements ClientGroupConnectionMatcher { try { final ClientOS osType = ClientOS.valueOf(group.getData()); - return clientConnection.info.contains(osType.queryString); + return clientConnection.info.contains(osType.queryString1) || + (osType.queryString2 != null && clientConnection.info.contains(osType.queryString2)); } catch (final Exception e) { return false; } diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 72d55400..71e3b187 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -84,6 +84,8 @@ sebserver.overall.seb.os.type.NONE=Undefined sebserver.overall.seb.os.type.WINDOWS=Windows sebserver.overall.seb.os.type.MAC_OS=MacOS sebserver.overall.seb.os.type.I_OS=iOS +sebserver.overall.seb.os.type.IPAD_OS=IPadOS +sebserver.overall.seb.os.type.I_OS_OR_IPAD_OS=iOS or IPadOS ################################ # Form validation and messages