Class JKServiceUtil

java.lang.Object
com.jk.services.server.JKServiceUtil

public class JKServiceUtil extends Object
This class provides utility methods for working with service-related information.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    This method checks if the remote host making the service request is authorized based on its IP address and throws an exception if not authorized.
    static String
    This method retrieves the remote IP address of the client making the service request.
    static String
    This method retrieves the remote role associated with the service request.
    static String
    This method retrieves the remote user associated with the service request.
    static boolean
    This method checks if the remote host making the service request is authorized based on its IP address.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JKServiceUtil

      public JKServiceUtil()
  • Method Details

    • getRemoteIp

      public static String getRemoteIp()
      This method retrieves the remote IP address of the client making the service request.
      Returns:
      the remote IP address as a string.
    • getRemoteUser

      public static String getRemoteUser()
      This method retrieves the remote user associated with the service request.
      Returns:
      the remote user's name as a string.
    • getRemoteRole

      public static String getRemoteRole()
      This method retrieves the remote role associated with the service request.
      Returns:
      the remote role as a string.
    • isAuthorizedHost

      public static boolean isAuthorizedHost()
      This method checks if the remote host making the service request is authorized based on its IP address.
      Returns:
      true, if the host is authorized, false otherwise.
    • checkAuthorizedHost

      public static void checkAuthorizedHost()
      This method checks if the remote host making the service request is authorized based on its IP address and throws an exception if not authorized.