Class JKLogCrossCuttingService

java.lang.Object
com.jk.services.server.JKAbstractRestController
com.jk.services.crosscutting.logging.JKLogCrossCuttingService

@Path("/logging") @Singleton public class JKLogCrossCuttingService extends JKAbstractRestController
This class represents a REST web service end-point for logging in the cross-cutting application.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKLogCrossCuttingService

      public JKLogCrossCuttingService()
  • Method Details

    • add

      @POST public jakarta.ws.rs.core.Response add(JKLog model)
      This method is an end-point to add a log entry.
      Parameters:
      model - Specifies the JKLog model representing the log entry to be added.
      Returns:
      the response indicating the success of the log addition.
    • getLogsCount

      @GET @Path("/logs/count/{app-name}/{reset-counter}") public jakarta.ws.rs.core.Response getLogsCount(@PathParam("app-name") String appName, @PathParam("reset-counter") boolean resetCounter)
      This method is an end-point to retrieve the count of logs for a specific application.
      Parameters:
      appName - Specifies the name of the application for which logs are counted.
      resetCounter - Indicates whether to reset the log counter after retrieval or not.
      Returns:
      the response containing the count of logs for the specified application.
    • getLogs

      @GET @Path("/logs/{app-name}/{reset-counter}") public jakarta.ws.rs.core.Response getLogs(@PathParam("app-name") String appName, @PathParam("reset-counter") boolean resetCounter)
      This method is an end-point to retrieve logs for a specific application.
      Parameters:
      appName - Specifies the name of the application for which logs are counted.
      resetCounter - Indicates whether to reset the log counter after retrieval or not.
      Returns:
      the response containing the list of logs for the specified application.
    • cacheLog

      protected void cacheLog(String remoteAppName, JKLog model)
      This method caches logs for a specific remote application.
      Parameters:
      remoteAppName - Specifies the name of the remote application.
      model - Specifies the JKLog model representing the log entry to be cached.