Package com.groiss.util
Class IPChecker
java.lang.Object
com.groiss.util.IPChecker
IPChecker allows to check IP Addresses with respect to the allow/deny patterns specified
in the configuration. Works with IPV4 and IPV6 adress formats.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accessAllowed
(String hostName, String proxyName) Checks if the host with the specified name /from the specified proxy has the permission to access.boolean
accessAllowed
(InetAddress inetAddress, InetAddress proxyAddress) Checks if the specified InetAdress has permission to access.boolean
accessAllowed
(Socket socket) Checks if a (connection from a) socket has permission to access.static IPChecker
getConfiguredIPChecker
(HttpServletRequest request) Returns an IPChecker which is initialized with the patterns from the configuration
-
Constructor Details
-
IPChecker
-
-
Method Details
-
getConfiguredIPChecker
Returns an IPChecker which is initialized with the patterns from the configuration- Returns:
- the IPChecker according to the configuration
-
accessAllowed
Checks if the host with the specified name /from the specified proxy has the permission to access.- Parameters:
hostName
- the name or string IP representation.proxyName
- the name or string IP representation.- Returns:
- true if the host name is known and is allowed to access.
-
accessAllowed
Checks if a (connection from a) socket has permission to access.- Parameters:
socket
- the Socket to check access for.- Returns:
- true if the connection from the socket is allowed to access.
-
accessAllowed
Checks if the specified InetAdress has permission to access.- Parameters:
inetAddress
- the InetAdress to check access for.proxyAddress
- the InetAdress to check access for (if a rule is defined as proxyRule)- Returns:
- true if the InetAdress is allowed to access.
-