The Java database reader allows your Java application to use the on-premise IPQS IP reputation database and make informed decisions about IP addresses.
Install Manually
You can manually install the Java database reader from source available on the IPQS GitHub.
Install via Maven
Alternatively, you can use the IPQS Maven repository to install the Java database reader automatically.
- Add a dependency for the Java database reader to your pom.xml file. You will need to add a parent tag if none exists:
- Add the IPQS Maven repository to your pom.xml file. You will need to add a parent tag if none exists:
-
Update your dependencies by running:
mvn dependency:resolve
The following example shows how you can use the Java database reader in your application to determine if an IP address is a proxy:
Note: Each database only holds either IPv4 or IPv6 data. Therefore, you may need two instances of the reader available depending on your use case. |
Some of these methods may be unavailable depending on which database file you receive. If the method in question is unavailable in your database, the method will default to Java's default value for that type or false.
Method | Type | Description | ||||||||||||
record.isProxy() | bool | Is this IP address suspected to be a proxy? (SOCKS, Elite, Anonymous, VPN, Tor, etc.) | ||||||||||||
record.isVPN() | bool | Is this IP suspected of being a VPN connection? This can include data center ranges which can become active VPNs at any time. The "proxy" status will always be true when this value is true. | ||||||||||||
record.isTOR() | bool | Is this IP suspected of being a TOR connection? This can include previously active TOR nodes and exits which can become active TOR exits at any time. The "proxy" status will always be true when this value is true. | ||||||||||||
record.isCrawler() | bool | Is this IP associated with being a confirmed crawler from a mainstream search engine such as Googlebot, Bingbot, Yandex, etc. based on hostname or IP address verification. | ||||||||||||
record.isBot() | bool | Indicates if bots or non-human traffic has recently used this IP address to engage in automated fraudulent behavior. Provides stronger confidence that the IP address is suspicious. | ||||||||||||
record.hasRecentAbuse() | bool | This value will indicate if there has been any recently verified abuse across our network for this IP address. Abuse could be a confirmed chargeback, compromised device, fake app install, or similar malicious behavior within the past few days. | ||||||||||||
record.isBlacklisted() | bool | This value will indicate if the IP has been blocklisted by any 3rd party agency for spam, abuse or fraud. | ||||||||||||
record.isPrivate() | bool | This value will indicate if the IP is a private, non-routable IP address. | ||||||||||||
record.isMobile() | bool | This value will indicate if the IP is likely owned by a mobile carrier. | ||||||||||||
record.hasOpenPorts() | bool | This value will indicate if the IP has recently had open (listening) ports. | ||||||||||||
record.isHostingProvider() | bool | This value will indicate if the IP is likely owned by a hosting provider or is leased to a hosting company. | ||||||||||||
record.isActiveVPN() | bool | Identifies active VPN connections used by popular VPN services and private VPN servers. | ||||||||||||
record.isActiveTOR() | bool | Identifies active TOR exits on the TOR network. | ||||||||||||
record.isPublicAccessPoint() | bool | Indicates if this IP is likely to be a public access point such as a coffee shop, college or library. | ||||||||||||
record.getConnectionType().getRaw() | int |
A numerical representation for the suspected type of connection for this IP address. It is generally recommended you call the toString() function listed below instead of using this value, but it is available as an option.
|
||||||||||||
record.getConnectionType.toString() | int |
A string representation for the suspected type of connection for this IP address. (Residential, Mobile, Corporate, Data Center, Education or Unknown) |
||||||||||||
record.getAbuseVelocity().getRaw() | int |
How frequently the IP address is engaging in abuse across the IPQS threat network. Can be used in combination with the Fraud Score to identify bad behavior. It is generally recommended you call the toString() function listed below instead of using this value, but it is available as an option.
|
||||||||||||
record.getAbuseVelocity().toString() | int |
How frequently the IP address is engaging in abuse across the IPQS threat network. Values can be "high", "medium", "low", or "none". |
||||||||||||
record.getCountry() | string |
Two character country code of IP address or "N/A" if unknown. |
||||||||||||
record.getCountryName() | string |
A full text representation of the country name. NOTE: Calling this function requires network access or a valid countrylist.raw updated within the last week. See Country List API for details. |
||||||||||||
record.getCity() | string |
City of IP address if available or "N/A" if unknown. |
||||||||||||
record.getISP() | string |
ISP if one is known. Otherwise "N/A". |
||||||||||||
record.getOrganization() | string |
Organization if one is known. Can be parent company or sub company of the listed ISP. Otherwise "N/A". |
||||||||||||
record.getASN() | int |
Autonomous System Number if one is known. Zero if nonexistent. |
||||||||||||
record.getTimezone() | string |
Timezone of IP address if available or "N/A" if unknown. |
||||||||||||
record.getLatitude() | float32 |
Latitude of IP address if available or 0.00 if unknown. |
||||||||||||
record.getLongitude() | float32 |
Longitude of IP address if available or 0.00 if unknown. |
||||||||||||
record.getFraudScore().forStrictness(int) | int |
Returns a fraud score for this IP address based on a strictness level. This method requires an int for the "strictness level" of the query and can be 0, 1 or 2. Some databases may contain 1 entry, others all 3. It is recommended that you use the lowest strictness for Fraud Scoring. Increasing this value will expand the tests we perform. Levels 2+ have a higher risk of false-positives. |
If you already have the Java database reader installed, you can update it by running:
mvn dependency:resolve