diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityDependency.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityDependency.java index 36fafbdb..8f727e89 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityDependency.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/EntityDependency.java @@ -14,20 +14,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; @JsonIgnoreProperties(ignoreUnknown = true) public class EntityDependency implements Comparable { - @JsonProperty(value = "parent", required = true) + public static final String ATTR_PARENT = "parent"; + public static final String ATTR_SELF = "self"; + public static final String ATTR_NAME = "name"; + public static final String ATTR_DESCRIPTION = "description"; + + @JsonProperty(value = ATTR_PARENT, required = true) public final EntityKey parent; - @JsonProperty(value = "self", required = true) + @JsonProperty(value = ATTR_SELF, required = true) public final EntityKey self; - @JsonProperty(value = "name", required = true) + @JsonProperty(value = ATTR_NAME, required = true) public final String name; - @JsonProperty(value = "description", required = false) + @JsonProperty(ATTR_DESCRIPTION) public final String description; public EntityDependency( - @JsonProperty(value = "parent", required = true) final EntityKey parent, - @JsonProperty(value = "self", required = true) final EntityKey self, - @JsonProperty(value = "name", required = true) final String name, - @JsonProperty(value = "description", required = false) final String description) { + @JsonProperty(value = ATTR_PARENT, required = true) final EntityKey parent, + @JsonProperty(value = ATTR_SELF, required = true) final EntityKey self, + @JsonProperty(value = ATTR_NAME, required = true) final String name, + @JsonProperty(ATTR_DESCRIPTION) final String description) { this.parent = parent; this.self = self; 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 db47c235..cb3c0fef 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 @@ -24,14 +24,16 @@ import ch.ethz.seb.sebserver.gbl.api.EntityType; public class EntityKey implements ModelIdAware, Serializable, Comparable { private static final long serialVersionUID = -2368065921846821061L; + public static final String ATTR_MODEL_ID = "modelId"; + public static final String ATTR_ENTITY_TYPE = "entityType"; /** The model identifier of the entity */ - @JsonProperty(value = "modelId", required = true) + @JsonProperty(value = ATTR_MODEL_ID, required = true) @NotNull public final String modelId; /** The type of the entity */ - @JsonProperty(value = "entityType", required = true) + @JsonProperty(value = ATTR_ENTITY_TYPE, required = true) @NotNull public final EntityType entityType; @@ -40,8 +42,8 @@ public class EntityKey implements ModelIdAware, Serializable, Comparable source; /** A set of entity-keys for all entities that has been detected as dependency to one or more of the source entities * during the process */ - @JsonProperty(value = "results", required = true) + @JsonProperty(value = ATTR_RESULTS, required = true) public final Set results; /** A set of error entries that defines an error if happened. */ - @JsonProperty(value = "errors", required = true) + @JsonProperty(value = ATTR_ERRORS, required = true) public final Set errors; @JsonCreator public EntityProcessingReport( - @JsonProperty(value = "source", required = true) final Collection source, - @JsonProperty(value = "results", required = true) final Collection results, - @JsonProperty(value = "errors", required = true) final Collection errors) { + @JsonProperty(value = ATTR_SOURCE, required = true) final Collection source, + @JsonProperty(value = ATTR_RESULTS, required = true) final Collection results, + @JsonProperty(value = ATTR_ERRORS, required = true) final Collection errors) { this.source = Utils.immutableSetOf(source); this.results = Utils.immutableSetOf(results); diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientConnectionData.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientConnectionData.java index 981e6be1..8bf90701 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientConnectionData.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientConnectionData.java @@ -20,18 +20,22 @@ import ch.ethz.seb.sebserver.gbl.util.Utils; public class ClientConnectionData { - @JsonProperty("clientConnection") + public static final String ATTR_CLIENT_CONNECTION = "clientConnection"; + public static final String ATTR_INDICATOR_VALUE = "indicatorValues"; + public static final String ATTR_MISSING_PING = "missingPing"; + + @JsonProperty(ATTR_CLIENT_CONNECTION) public final ClientConnection clientConnection; - @JsonProperty("indicatorValues") + @JsonProperty(ATTR_INDICATOR_VALUE) public final List indicatorValues; public final Boolean missingPing; @JsonCreator public ClientConnectionData( - @JsonProperty("missingPing") final Boolean missingPing, - @JsonProperty("clientConnection") final ClientConnection clientConnection, - @JsonProperty("indicatorValues") final Collection indicatorValues) { + @JsonProperty(ATTR_MISSING_PING) final Boolean missingPing, + @JsonProperty(ATTR_CLIENT_CONNECTION) final ClientConnection clientConnection, + @JsonProperty(ATTR_INDICATOR_VALUE) final Collection indicatorValues) { this.missingPing = missingPing; this.clientConnection = clientConnection; @@ -47,7 +51,7 @@ public class ClientConnectionData { this.indicatorValues = Utils.immutableListOf(indicatorValues); } - @JsonProperty("missingPing") + @JsonProperty(ATTR_MISSING_PING) public Boolean getMissingPing() { return this.missingPing; } diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/RunningExamInfo.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/RunningExamInfo.java index ba3e034a..627029bd 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/RunningExamInfo.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/RunningExamInfo.java @@ -16,21 +16,26 @@ import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetup.LmsType; public final class RunningExamInfo { - @JsonProperty("examId") + public static final String ATTR_EXAM_ID = "examId"; + public static final String ATTR_NAME = "name"; + public static final String ATTR_URL = "url"; + public static final String ATTR_LMS_TYPE = "lmsType"; + + @JsonProperty(ATTR_EXAM_ID) public final String examId; - @JsonProperty("name") + @JsonProperty(ATTR_NAME) public final String name; - @JsonProperty("url") + @JsonProperty(ATTR_URL) public final String url; - @JsonProperty("lmsType") + @JsonProperty(ATTR_LMS_TYPE) public final String lmsType; @JsonCreator public RunningExamInfo( - @JsonProperty("examId") final String examId, - @JsonProperty("name") final String name, - @JsonProperty("url") final String url, - @JsonProperty("lmsType") final String lmsType) { + @JsonProperty(ATTR_EXAM_ID) final String examId, + @JsonProperty(ATTR_NAME) final String name, + @JsonProperty(ATTR_URL) final String url, + @JsonProperty(ATTR_LMS_TYPE) final String lmsType) { this.examId = examId; this.name = name; diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java index 4e4a1b0b..a7117e1c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPITemplate.java @@ -105,8 +105,7 @@ public interface LmsAPITemplate { Result getQuizFromCache(String id); - // TODO this can be used in a future release to resolve examinee's account detail information by an - // examinee identifier received by on SEB-Client connection. + // TODO //Result getExamineeAccountDetails(String examineeUserId); /** Used to get a list of chapters (display name and chapter-identifier) that can be used to