Skip to content

Commit

Permalink
SEBSP-116 create new db model
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Oct 30, 2024
1 parent 99569a2 commit 071c52d
Show file tree
Hide file tree
Showing 107 changed files with 1,729 additions and 1,642 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import javax.annotation.Generated;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2024-09-03T11:17:26.971+02:00")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2024-10-30T11:40:34.601+01:00")
public enum EntityType {
CONFIGURATION_ATTRIBUTE,
CONFIGURATION_VALUE,
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/ch/ethz/seb/sebserver/gbl/model/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/** Defines the global names of the domain model and domain model fields.
* This shall be used as a static overall domain model names reference within SEB Server Web-Service as well as within the integrated GUI
* This file is generated by the org.eth.demo.sebserver.gen.DomainModelNameReferencePlugin and must not be edited manually.**/
@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2024-09-03T11:17:26.914+02:00")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator",comments="ch.ethz.seb.sebserver.gen.DomainModelNameReferencePlugin",date="2024-10-30T11:40:34.565+01:00")
public interface Domain {

interface CONFIGURATION_ATTRIBUTE {
Expand Down Expand Up @@ -169,6 +169,8 @@ interface SCREEN_PROCTORING_GROUP {
String ATTR_NAME = "name";
String ATTR_SIZE = "size";
String ATTR_DATA = "data";
String ATTR_COLLECTING_STRATEGY = "collectingStrategy";
String ATTR_SEB_GROUP_ID = "sebGroupId";
}

interface CLIENT_EVENT {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.util.Objects;

import ch.ethz.seb.sebserver.gbl.model.exam.CollectingStrategy;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -37,21 +38,31 @@ public class ScreenProctoringGroup {
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_DATA)
public final String additionalData;

@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_COLLECTING_STRATEGY)
public final CollectingStrategy collectingStrategy;

@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_SEB_GROUP_ID)
public final Long sebGroupId;

@JsonCreator
public ScreenProctoringGroup(
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_ID) final Long id,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_EXAM_ID) final Long examId,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_UUID) final String uuid,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_NAME) final String name,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_SIZE) final Integer size,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_DATA) final String additionalData) {
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_DATA) final String additionalData,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_COLLECTING_STRATEGY) final CollectingStrategy collectingStrategy,
@JsonProperty(Domain.SCREEN_PROCTORING_GROUP.ATTR_SEB_GROUP_ID) final Long sebGroupId) {

this.id = id;
this.examId = examId;
this.uuid = uuid;
this.name = name;
this.size = size;
this.additionalData = additionalData;
this.collectingStrategy = collectingStrategy;
this.sebGroupId = sebGroupId;
}

public Long getId() {
Expand All @@ -78,6 +89,14 @@ public String getAdditionalData() {
return this.additionalData;
}

public CollectingStrategy getCollectingStrategy() {
return collectingStrategy;
}

public Long getSebGroupId() {
return sebGroupId;
}

@Override
public int hashCode() {
return Objects.hash(this.id);
Expand All @@ -97,21 +116,15 @@ public boolean equals(final Object obj) {

@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append("ScreenProctoringGroup [id=");
builder.append(this.id);
builder.append(", examId=");
builder.append(this.examId);
builder.append(", uuid=");
builder.append(this.uuid);
builder.append(", name=");
builder.append(this.name);
builder.append(", size=");
builder.append(this.size);
builder.append(", additionalData=");
builder.append(this.additionalData);
builder.append("]");
return builder.toString();
return "ScreenProctoringGroup{" +
"id=" + id +
", examId=" + examId +
", uuid='" + uuid + '\'' +
", name='" + name + '\'' +
", size=" + size +
", additionalData='" + additionalData + '\'' +
", collectingStrategy=" + collectingStrategy +
", sebGroupId=" + sebGroupId +
'}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public boolean isInGroup(final ClientConnection clientConnection, final ClientGr
return false;
}

final String start = group.nameRangeStartLetter != null ? group.nameRangeStartLetter : "A";
final String end = group.nameRangeStartLetter != null ? group.nameRangeStartLetter : "Z";
final String name = clientConnection.userSessionId.substring(0, 1);
final String start = group.nameRangeStartLetter != null ? group.nameRangeStartLetter.substring(0, 1) : "A";
final String end = group.nameRangeStartLetter != null ? group.nameRangeEndLetter.substring(0, 1) : "Z";

return clientConnection.userSessionId.compareToIgnoreCase(start) >= 0 &&
clientConnection.userSessionId.compareToIgnoreCase(end) <= 0;
return name.compareToIgnoreCase(start) >= 0 &&
name.compareToIgnoreCase(end) <= 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ public int getNumberOfConnection(final ConnectionStatus status) {
@JsonIgnore
public int getNumberOfConnection(final Long clientGroupId) {
if (this.connectionsPerClientGroup == null || !this.connectionsPerClientGroup.containsKey(clientGroupId)) {
return -1;
return 0;
}
return this.connectionsPerClientGroup.get(clientGroupId);
}

@JsonIgnore
public int getNumberOfConnection(final ConnectionIssueStatus connectionIssueStatus) {
if (this.connectionPerIssue == null || this.connectionPerIssue.length <= connectionIssueStatus.code) {
return -1;
return 0;
}
return this.connectionPerIssue[connectionIssueStatus.code];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
import org.mybatis.dynamic.sql.SqlTable;

public final class AdditionalAttributeRecordDynamicSqlSupport {
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source Table: additional_attributes")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source Table: additional_attributes")
public static final AdditionalAttributeRecord additionalAttributeRecord = new AdditionalAttributeRecord();

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source field: additional_attributes.id")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source field: additional_attributes.id")
public static final SqlColumn<Long> id = additionalAttributeRecord.id;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source field: additional_attributes.entity_type")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source field: additional_attributes.entity_type")
public static final SqlColumn<String> entityType = additionalAttributeRecord.entityType;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source field: additional_attributes.entity_id")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source field: additional_attributes.entity_id")
public static final SqlColumn<Long> entityId = additionalAttributeRecord.entityId;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source field: additional_attributes.name")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source field: additional_attributes.name")
public static final SqlColumn<String> name = additionalAttributeRecord.name;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source field: additional_attributes.value")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source field: additional_attributes.value")
public static final SqlColumn<String> value = additionalAttributeRecord.value;

@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-09-03T11:17:27.029+02:00", comments="Source Table: additional_attributes")
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", date="2024-10-30T11:40:34.641+01:00", comments="Source Table: additional_attributes")
public static final class AdditionalAttributeRecord extends SqlTable {
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);

Expand Down
Loading

0 comments on commit 071c52d

Please sign in to comment.