-
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
- Loading branch information
1 parent
c1dcf05
commit e498c16
Showing
18 changed files
with
363 additions
and
174 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...end/src/main/java/rocks/inspectit/gepard/agentmanager/application/config/EventConfig.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,20 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.application.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.event.ApplicationEventMulticaster; | ||
import org.springframework.context.event.SimpleApplicationEventMulticaster; | ||
import org.springframework.core.task.SimpleAsyncTaskExecutor; | ||
|
||
@Configuration | ||
public class EventConfig { | ||
|
||
@Bean | ||
public ApplicationEventMulticaster simpleApplicationEventMulticaster() { | ||
SimpleApplicationEventMulticaster eventMulticaster = new SimpleApplicationEventMulticaster(); | ||
|
||
eventMulticaster.setTaskExecutor(new SimpleAsyncTaskExecutor()); | ||
return eventMulticaster; | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
...a/rocks/inspectit/gepard/agentmanager/configuration/events/ConfigurationRequestEvent.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,19 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.configuration.events; | ||
|
||
import java.util.Map; | ||
import lombok.Getter; | ||
import org.springframework.context.ApplicationEvent; | ||
|
||
@Getter | ||
public class ConfigurationRequestEvent extends ApplicationEvent { | ||
|
||
private final String agentId; | ||
private final Map<String, String> headers; | ||
|
||
public ConfigurationRequestEvent(Object source, String agentId, Map<String, String> headers) { | ||
super(source); | ||
this.agentId = agentId; | ||
this.headers = headers; | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
...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,23 @@ | ||
/* (C) 2024 */ | ||
package rocks.inspectit.gepard.agentmanager.configuration.validation; | ||
|
||
import java.util.Map; | ||
import rocks.inspectit.gepard.agentmanager.exception.MissingHeaderException; | ||
|
||
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.