-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/rocks/inspectit/gepard/agent/notify/http/NotificationCallback.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,26 @@ | ||
package rocks.inspectit.gepard.agent.notify.http; | ||
|
||
import org.apache.hc.client5.http.async.methods.SimpleHttpResponse; | ||
import org.apache.hc.core5.concurrent.FutureCallback; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** Callback for notifications to the configuration server. Currently, only used for logging. */ | ||
public class NotificationCallback implements FutureCallback<SimpleHttpResponse> { | ||
private static final Logger log = LoggerFactory.getLogger(NotificationCallback.class); | ||
|
||
@Override | ||
public void completed(SimpleHttpResponse result) { | ||
log.info("Notified configuration server and received status code {}", result.getCode()); | ||
} | ||
|
||
@Override | ||
public void failed(Exception ex) { | ||
log.error("Failed to notify configuration server", ex); | ||
} | ||
|
||
@Override | ||
public void cancelled() { | ||
log.info("Cancelled notification to configuration server"); | ||
} | ||
} |