Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
BBesrour committed Sep 7, 2024
2 parents fb6a128 + f70c95f commit 101e09e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```
22 changes: 11 additions & 11 deletions src/main/java/de/tum/cit/ase/artemistelemetry/domain/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

@Repository
public interface TelemetryRepository extends CrudRepository<Telemetry, Long> {
Telemetry findByUniversityName(String universityName);
Telemetry findByOperatorName(String operatorName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public List<Telemetry> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public record TelemetryDTO(Long id, String version, String serverUrl, String ope

public static TelemetryDTO from(Telemetry telemetry) {
List<String> 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) {
Expand All @@ -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());
Expand Down

0 comments on commit 101e09e

Please sign in to comment.