-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: Refactor DTO handling and change response handling when regis…
…tering/connecting an agent and implement tests
- Loading branch information
1 parent
9a4a641
commit 1fb0262
Showing
12 changed files
with
282 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
...c/main/java/rocks/inspectit/gepard/agentmanager/connection/model/ConnectionDtoMapper.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
...src/main/java/rocks/inspectit/gepard/agentmanager/connection/model/dto/ConnectionDto.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 21 additions & 12 deletions
33
...va/rocks/inspectit/gepard/agentmanager/connection/model/dto/CreateConnectionResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.connection.model.dto; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
import lombok.Builder; | ||
import rocks.inspectit.gepard.agentmanager.connection.model.Connection; | ||
|
||
/** | ||
* Represents a successful connection response. | ||
* | ||
* @param id | ||
* @param serviceName | ||
* @param gepardVersion | ||
* @param otelVersion | ||
* @param pid | ||
* @param startTime | ||
* @param javaVersion | ||
*/ | ||
/** Represents a connection response. */ | ||
@Builder | ||
public record CreateConnectionResponse( | ||
UUID id, | ||
LocalDateTime registrationTime, | ||
String serviceName, | ||
String gepardVersion, | ||
String otelVersion, | ||
Long pid, | ||
Long startTime, | ||
String javaVersion) {} | ||
String javaVersion) { | ||
|
||
public static CreateConnectionResponse fromConnection(Connection connection) { | ||
return CreateConnectionResponse.builder() | ||
.id(connection.getId()) | ||
.registrationTime(connection.getRegistrationTime()) | ||
.serviceName(connection.getAgent().getServiceName()) | ||
.gepardVersion(connection.getAgent().getGepardVersion()) | ||
.otelVersion(connection.getAgent().getOtelVersion()) | ||
.pid(connection.getAgent().getPid()) | ||
.startTime(connection.getAgent().getStartTime().toEpochMilli()) | ||
.javaVersion(connection.getAgent().getJavaVersion()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.