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, GeoIpUtil.CallerAddressFilterOption option) Simple filter for caller addressstatic StringgetAddress(SocketAddress callerAddr, GeoIpUtil.CallerAddressFilterOption option) static Stringstatic StringgetExternalIp(String url) static String[]getMyIP()static booleanstatic 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
- Throws:
UnknownHostException
-
showAddress
-
getAddress
public static String getAddress(SocketAddress callerAddr, GeoIpUtil.CallerAddressFilterOption option) -
callerAddressFilter
public static String callerAddressFilter(SocketAddress callerAddr, Set<String> whiteList, Set<String> blackList, GeoIpUtil.CallerAddressFilterOption option) Simple filter for caller address- Parameters:
callerAddr-whiteList-blackList-option-- Returns:
- null if OK, otherwise return the reason
-
callerAddressFilter
-
matches
-
matches
-