-
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.
feat: Include notification into polling (#15)
* feat: include notification into polling * refactor: Kiss (my ass) - No Events * fix: adjust response handling according to agent * fix: adjustments according review --------- Co-authored-by: Benjamin Clauss <benjamin.clauss@novatec-gmbh.de>
- Loading branch information
1 parent
b094099
commit d46ab4d
Showing
16 changed files
with
316 additions
and
172 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
29 changes: 29 additions & 0 deletions
29
...tit/gepard/agentmanager/configuration/validation/ConfigurationRequestHeaderValidator.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.configuration.validation; | ||
|
||
import static rocks.inspectit.gepard.agentmanager.connection.service.ConnectionService.*; | ||
|
||
import java.util.Map; | ||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import rocks.inspectit.gepard.agentmanager.exception.MissingHeaderException; | ||
|
||
/** Validation class that helps checking that all mandatory headers are set. */ | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ConfigurationRequestHeaderValidator { | ||
public static void validateConfigurationRequestHeaders(Map<String, String> headers) { | ||
validateHeader(headers, X_GEPARD_SERVICE_NAME); | ||
validateHeader(headers, X_GEPARD_VM_ID); | ||
validateHeader(headers, X_GEPARD_GEPARD_VERSION); | ||
validateHeader(headers, X_GEPARD_OTEL_VERSION); | ||
validateHeader(headers, X_GEPARD_JAVA_VERSION); | ||
validateHeader(headers, X_GEPARD_START_TIME); | ||
} | ||
|
||
private static void validateHeader(Map<String, String> headers, String headerName) { | ||
String value = headers.get(headerName); | ||
if (value == null) { | ||
throw new MissingHeaderException(headerName + " header is required"); | ||
} | ||
} | ||
} |
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
36 changes: 0 additions & 36 deletions
36
...ava/rocks/inspectit/gepard/agentmanager/connection/model/dto/CreateConnectionRequest.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
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
8 changes: 8 additions & 0 deletions
8
...d/src/main/java/rocks/inspectit/gepard/agentmanager/exception/MissingHeaderException.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.exception; | ||
|
||
public class MissingHeaderException extends RuntimeException { | ||
public MissingHeaderException(String message) { | ||
super(message); | ||
} | ||
} |
Oops, something went wrong.