Package org.summerboot.jexpress.util
Class GeoIpUtil
java.lang.Object
org.summerboot.jexpress.util.GeoIpUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringSimple filter for caller addressstatic StringcallerAddressFilter(SocketAddress callerAddr, Set<String> whiteList, Set<String> blackList, String regexPrefix, GeoIpUtil.CallerAddressFilterOption option) Simple filter for caller addressstatic Stringstatic StringgetExternalIp(String url) static String[]getMyIP()static booleanstatic voidshowAddress(String host, int port) static StringshowAddress(InetSocketAddress address)
-
Field Details
-
CHECKIP_URL_AWS
- See Also:
-
REGEX_CACHE
-
-
Constructor Details
-
GeoIpUtil
public GeoIpUtil()
-
-
Method Details
-
getExternalIp
- Throws:
IOExceptionURISyntaxException
-
getExternalIp
- Throws:
IOExceptionURISyntaxException
-
getMyIP
-
showAddress
-
showAddress
-
callerAddressFilter
public static String callerAddressFilter(SocketAddress callerAddr, Set<String> whiteList, Set<String> blackList, String regexPrefix, GeoIpUtil.CallerAddressFilterOption option) Simple filter for caller address- Parameters:
callerAddr-whiteList-blackList-option-- Returns:
- null if OK, otherwise return the reason
-
callerAddressFilter
public static String callerAddressFilter(String host, Set<String> whiteList, Set<String> blackList, String regexPrefix) Simple filter for caller address- Parameters:
host-whiteList-blackList-- Returns:
- null if OK, otherwise return the reason
-
matches
-