Package com.jk.web.monitoring
Class JKMonitorService
java.lang.Object
com.jk.web.monitoring.JKMonitorService
- Direct Known Subclasses:
JKLogServicePublisher
,JKWebStackMonitor
This class is a service class for monitoring and logging exceptions in a web
application.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.keycloak.representations.IDToken
getIdToken
(jakarta.servlet.http.HttpServletRequest request) This method retrieves the ID Token associated with the authenticated user from the providedHttpServletRequest
object.static JKMonitorService
This method retrieves the single instance ofJKMonitorService
.getUserName
(jakarta.servlet.http.HttpServletRequest request) This method retrieves the user name of the authenticated user from the providedHttpServletRequest
object.void
This method logs an error or exception.static void
setInstance
(JKMonitorService instance) This method sets the instance ofJKMonitorService
to the provided one.
-
Constructor Details
-
JKMonitorService
public JKMonitorService()
-
-
Method Details
-
getUserName
This method retrieves the user name of the authenticated user from the providedHttpServletRequest
object.- Parameters:
request
- Specifies theHttpServletRequest
object representing the current HTTP request.- Returns:
- the user name of the authenticated user from the provided
HttpServletRequest
object.
-
getIdToken
public org.keycloak.representations.IDToken getIdToken(jakarta.servlet.http.HttpServletRequest request) This method retrieves the ID Token associated with the authenticated user from the providedHttpServletRequest
object.- Parameters:
request
- Specifies theHttpServletRequest
object representing the current HTTP request.- Returns:
- the ID Token of the authenticated user.
-
getInstance
This method retrieves the single instance ofJKMonitorService
.- Returns:
- the single instance of
JKMonitorService
.
-
setInstance
This method sets the instance ofJKMonitorService
to the provided one.- Parameters:
instance
- Specifies the new instance ofJKMonitorService
.
-
publish
This method logs an error or exception.- Parameters:
request
- Specifies theHttpServletRequest
object representing the current HTTP request.exception
- Specifies the Throwable exception that needs to be logged.
-