public static Location getLocationForIp(String ipAddress) { return locationResource .list() .queryParam("ipAddress", ipAddress) .withCache( CacheKeys.withClass(Location.class).withParameter("ipAddress", ipAddress).asList(), CacheRetention.RUNTIME) .executeWithResult() .getOneIfExists(); }
public static TrackedVisit addTrackedVisit( String uuid, String url, String ip, String browser, String referer, String headers) { TrackedVisit trackedVisit = new TrackedVisit(); trackedVisit.setUuid_(uuid); trackedVisit.setUrl(url); trackedVisit.setIp(ip); trackedVisit.setBrowser(browser); trackedVisit.setReferer(referer); trackedVisit.setHeaders(headers); return trackedVisitResource.create(trackedVisit).execute(); }
public static String generateUUID() { return trackedVisitorResource.query(TrackedVisitor.class).post().getUuid_(); }
public static TrackedVisitor getTrackedVisitorOrCreate(long memberId) { return trackedVisitorResource .query(TrackedVisitor.class) .queryParam("memberId", memberId) .post(); }
public CreateQuery( RestResource<ElementT, ?> restResource, ElementT pojo, Class<ElementT> entityType) { this.pojo = pojo; this.entityType = entityType; this.uriBuilder = restResource.getResourceUrl(); }