Code example for LoadingCache

Methods: getUnchecked

0
    @Override 
    public String originOf(Request request) {
        final String forwardedFor = request.getValue("X-Forwarded-For");
         
        if (null != forwardedFor && !forwardedFor.isEmpty()) {
            return reverseLookup.getUnchecked(forwardedFor);
        } 
        return request.getClientAddress().getHostName(); 
    } 
 
    @Override 
    public Set<Sponsor> sponsorsOf(Request request, String operation) {
        return detective.search(originOf(request) + " " + operation);
    } 
     
    @Override 
    public Sponsor sponsorWith(String fingerprint) {
        return Iterables.find(detective.search(fingerprint), Predicates.alwaysTrue(), null);
    } 
}