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.IDTokengetIdToken(jakarta.servlet.http.HttpServletRequest request) This method retrieves the ID Token associated with the authenticated user from the providedHttpServletRequestobject.static JKMonitorServiceThis method retrieves the single instance ofJKMonitorService.getUserName(jakarta.servlet.http.HttpServletRequest request) This method retrieves the user name of the authenticated user from the providedHttpServletRequestobject.voidThis method logs an error or exception.static voidsetInstance(JKMonitorService instance) This method sets the instance ofJKMonitorServiceto the provided one. 
- 
Constructor Details
- 
JKMonitorService
public JKMonitorService() 
 - 
 - 
Method Details
- 
getUserName
This method retrieves the user name of the authenticated user from the providedHttpServletRequestobject.- Parameters:
 request- Specifies theHttpServletRequestobject representing the current HTTP request.- Returns:
 - the user name of the authenticated user from the provided
         
HttpServletRequestobject. 
 - 
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 providedHttpServletRequestobject.- Parameters:
 request- Specifies theHttpServletRequestobject 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 ofJKMonitorServiceto the provided one.- Parameters:
 instance- Specifies the new instance ofJKMonitorService.
 - 
publish
This method logs an error or exception.- Parameters:
 request- Specifies theHttpServletRequestobject representing the current HTTP request.exception- Specifies the Throwable exception that needs to be logged.
 
 -