Example #1
0
 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();
 }
Example #2
0
  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();
  }
Example #3
0
 public static String generateUUID() {
   return trackedVisitorResource.query(TrackedVisitor.class).post().getUuid_();
 }
Example #4
0
 public static TrackedVisitor getTrackedVisitorOrCreate(long memberId) {
   return trackedVisitorResource
       .query(TrackedVisitor.class)
       .queryParam("memberId", memberId)
       .post();
 }
Example #5
0
 public CreateQuery(
     RestResource<ElementT, ?> restResource, ElementT pojo, Class<ElementT> entityType) {
   this.pojo = pojo;
   this.entityType = entityType;
   this.uriBuilder = restResource.getResourceUrl();
 }