August 2017
Beginner to intermediate
278 pages
6h 40m
English
The following classes will help us as a lookup service which will help us to identify if request is coming from a fraud IP. We have used interface before implementing the class so that we can add more NoSQL databases or any fast lookup service. You can implement this service and add a lookup service by using HBase or any other fast key lookup service. We are using in-memory lookup and just added the fraud IP range in the cache. Add the following code to your project:
public interface IIPScanner { boolean isFraudIP(String ipAddresses);}
CacheIPLookup is the implementation for the IIPSCanner interface which does in memory lookup:
import java.io.Serializable;import java.util.HashSet;import java.util.Set;public class CacheIPLookup ...
Read now
Unlock full access