From e7ea1e80ccf943b6a25ec30ef23e482622c76009 Mon Sep 17 00:00:00 2001 From: Florian Glombik Date: Thu, 22 Aug 2024 15:19:10 +0200 Subject: [PATCH 1/3] Add development setup explanation to README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 5f6279d..942cac8 100644 --- a/README.md +++ b/README.md @@ -1 +1,26 @@ Use `docker compose up` for quick start. + +## Development + +### Running [Artemis](https://github.com/ls1intum/Artemis) in parallel (locally) +Adjust the port on which the telemetry service and its database are running (with the default configuration Artemis will be running on port 8080 and a mysql database on port 3306). + +Adjust the `docker-compose.yml` accordingly, e.g. the following adjustments will be needed to run the telemetry service on port `8081` and its database on port `3307`: +``` +services: +telemetry: + ports: + - '127.0.0.1:8081:8080' +mysql: + ports: + - "3307:3306" +``` + +For using the local telemetry service in a development setup you will need to adjust the `application-dev.yml` (within Artemis, not within the telemetry service) accordingly: +``` +artemis: + telemetry: + enabled: true + sendAdminDetails: true + destination: http://localhost:8081 +``` \ No newline at end of file From e6b0d2a34d01debcd769b7c0e6b0da736bcca6a9 Mon Sep 17 00:00:00 2001 From: Florian Glombik Date: Thu, 22 Aug 2024 15:25:09 +0200 Subject: [PATCH 2/3] Highlighting already used port numbers --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 942cac8..f0933e8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Use `docker compose up` for quick start. ## Development ### Running [Artemis](https://github.com/ls1intum/Artemis) in parallel (locally) -Adjust the port on which the telemetry service and its database are running (with the default configuration Artemis will be running on port 8080 and a mysql database on port 3306). +Adjust the port on which the telemetry service and its database are running (with the default configuration Artemis will be running on port `8080` and a mysql database on port `3306`). Adjust the `docker-compose.yml` accordingly, e.g. the following adjustments will be needed to run the telemetry service on port `8081` and its database on port `3307`: ``` From d893f4cf32b65c5b5c1e3f0c0d4d93b78f921747 Mon Sep 17 00:00:00 2001 From: Simon Entholzer Date: Thu, 22 Aug 2024 16:28:06 +0200 Subject: [PATCH 3/3] update to use operator instead of university --- .../artemistelemetry/domain/Telemetry.java | 22 +++++++++---------- .../repository/TelemetryRepository.java | 2 +- .../service/TelemetryService.java | 4 ++-- .../service/dto/TelemetryDTO.java | 6 ++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java b/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java index 2fb6daa..9fe174e 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java @@ -16,11 +16,11 @@ public class Telemetry extends DomainObject { @Column(name = "version") private String version; - @Column(name = "university_name") - private String universityName; + @Column(name = "operator_name") + private String operatorName; @Column(name = "admin_name") - private String mainAdminName; + private String adminName; @Column(name = "profiles") private String profiles; @@ -39,20 +39,20 @@ public void setProfiles(String profiles) { this.profiles = profiles; } - public String getMainAdminName() { - return mainAdminName; + public String getAdminName() { + return adminName; } - public void setMainAdminName(String mainAdminName) { - this.mainAdminName = mainAdminName; + public void setAdminName(String adminName) { + this.adminName = adminName; } - public String getUniversityName() { - return universityName; + public String getOperatorName() { + return operatorName; } - public void setUniversityName(String universityName) { - this.universityName = universityName; + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; } public String getVersion() { diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/repository/TelemetryRepository.java b/src/main/java/de/tum/cit/ase/artemistelemetry/repository/TelemetryRepository.java index f01deda..e00dd12 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/repository/TelemetryRepository.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/repository/TelemetryRepository.java @@ -6,5 +6,5 @@ @Repository public interface TelemetryRepository extends CrudRepository { - Telemetry findByUniversityName(String universityName); + Telemetry findByOperatorName(String operatorName); } diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/service/TelemetryService.java b/src/main/java/de/tum/cit/ase/artemistelemetry/service/TelemetryService.java index cca777e..08f05d1 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/service/TelemetryService.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/service/TelemetryService.java @@ -40,8 +40,8 @@ public List getAll() { .toList(); } - public Telemetry updateTelemetryByUniversityName(Telemetry newTelemetry) { - Telemetry telemetry = telemetryRepository.findByUniversityName(newTelemetry.getUniversityName()); + public Telemetry updateTelemetryByOperatorName(Telemetry newTelemetry) { + Telemetry telemetry = telemetryRepository.findByOperatorName(newTelemetry.getOperatorName()); if (telemetry == null) { return telemetryRepository.save(newTelemetry); } diff --git a/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java b/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java index f3769c0..e7ee7a8 100644 --- a/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java +++ b/src/main/java/de/tum/cit/ase/artemistelemetry/service/dto/TelemetryDTO.java @@ -11,7 +11,7 @@ public record TelemetryDTO(Long id, String version, String serverUrl, String ope public static TelemetryDTO from(Telemetry telemetry) { List profilesList = List.of(telemetry.getProfiles().split(",")); - return new TelemetryDTO(telemetry.getId(), telemetry.getVersion(), telemetry.getServerUrl(), telemetry.getUniversityName(), telemetry.getMainAdminName(), profilesList, telemetry.getContact(), telemetry.getTimestamp()); + return new TelemetryDTO(telemetry.getId(), telemetry.getVersion(), telemetry.getServerUrl(), telemetry.getOperatorName(), telemetry.getAdminName(), profilesList, telemetry.getContact(), telemetry.getTimestamp()); } public static Telemetry to(TelemetryDTO telemetryDTO) { @@ -20,8 +20,8 @@ public static Telemetry to(TelemetryDTO telemetryDTO) { telemetry.setId(telemetryDTO.id()); telemetry.setVersion(telemetryDTO.version()); telemetry.setServerUrl(telemetryDTO.serverUrl()); - telemetry.setUniversityName(telemetryDTO.operator()); - telemetry.setMainAdminName(telemetryDTO.adminName()); + telemetry.setOperatorName(telemetryDTO.operator()); + telemetry.setAdminName(telemetryDTO.adminName()); telemetry.setProfiles(profiles); telemetry.setTimestamp(telemetryDTO.timestamp()); telemetry.setContact(telemetryDTO.contact());