Package com.jk.services.server
Class JKServiceUtil
java.lang.Object
com.jk.services.server.JKServiceUtil
This class provides utility methods for working with service-related
information.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
JKServiceUtil
public JKServiceUtil()
-
-
Method Details
-
getRemoteIp
This method retrieves the remote IP address of the client making the service request.- Returns:
- the remote IP address as a string.
-
getRemoteUser
This method retrieves the remote user associated with the service request.- Returns:
- the remote user's name as a 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.
-