Examples of CommonCriteria


Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

/**
* Sets criteria.
* @param criteria criteria
*/
public void setCriteria(CommonCriteria criteria) {
  this.criteria = criteria!=null? criteria: new CommonCriteria();
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

}

@Test
public void testNewQuery() {
      System.out.println("newQuery");
      CommonCriteria crt = new CommonCriteria();
      crt.setMaxRecords(5);
      Query query = instance.newQuery(crt);
      assertNotNull(query);
      Result result = query.execute();
      assertNotNull(result);
      Iterable<Resource> resources = result.getResources();
      assertNotNull(resources);
      int count = 0;
      for (Resource resource : resources) {
        count++;
      }
      assertTrue(count<=crt.getMaxRecords());
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

}

@Test
public void testNewQuery() {
    System.out.println("newQuery");
    CommonCriteria crt = new CommonCriteria();
    crt.setMaxRecords(5);
    Query query = instance.newQuery(crt);
    assertNotNull(query);
    Result result = query.execute();
    assertNotNull(result);
    Iterable<Resource> resources = result.getResources();
    assertNotNull(resources);
    int count = 0;
    for (Resource resource : resources) {
      count++;
    }
    assertTrue(count <= crt.getMaxRecords());
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

}

@Test
public void testNewQuery() {
      System.out.println("newQuery");
      CommonCriteria crt = new CommonCriteria();
      crt.setMaxRecords(5);
      Query query = instance.newQuery(crt);
      assertNotNull(query);
      Result result = query.execute();
      assertNotNull(result);
      Iterable<Resource> resources = result.getResources();
      assertNotNull(resources);
      int count = 0;
      for (Resource resource : resources) {
        count++;
      }
      assertTrue(count<=crt.getMaxRecords());
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

}

@Test
public void testNewQuery() {
      System.out.println("newQuery");
      CommonCriteria crt = new CommonCriteria();
      crt.setMaxRecords(5);
      Query query = instance.newQuery(crt);
      assertNotNull(query);
      Result result = query.execute();
      assertNotNull(result);
      Iterable<Resource> resources = result.getResources();
      assertNotNull(resources);
      int count = 0;
      for (Resource resource : resources) {
        count++;
      }
      assertTrue(count<=crt.getMaxRecords());
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

public Task(HrRecord resource, Criteria criteria) {
  if (resource==null) {
    throw new IllegalArgumentException("No resource provided.");
  }
  this.resource = resource;
  this.criteria = criteria!=null? criteria: new CommonCriteria();
}
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

        public void onIterationException(Exception ex) {
          LOGGER.log(Level.SEVERE, "Error iterating through AGS resources.", ex);
        }
      }, source);
     
      Query newQuery = qb.newQuery(new CommonCriteria());
      Result result = newQuery.execute();

      this.destination.getConnection().generateToken();
     
      Iterable<IServiceInfoProvider> records = new ServiceInfoProviderAdapter(new FlatResourcesAdapter(result.getResources()));
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

      throw new IllegalArgumentException("No resource to harvest provided.");
    // create instance of the task
    // add only if no similar task currently executing
    boolean submitted = false;
    if (ApprovalStatus.isPubliclyVisible(resource.getApprovalStatus().name()) && resource.getSynchronizable()) {
      CommonCriteria criteria = new CommonCriteria();
      criteria.setMaxRecords(maxRecs);
      if (fromDate != null) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(fromDate);
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        fromDate = cal.getTime();
      }
      criteria.setFromDate(fromDate);
      submitted = !isExecutingLocally(resource.getUuid()) && (taskQueue != null ? taskQueue.add(context, resource, criteria) : false);
      LOGGER.log(Level.FINER, "[SYNCHRONIZER] Submitted resource: {0} ({1})", new Object[]{resource.getUuid(), resource.getName()});
    }
    return submitted;
  }
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

      throw new IllegalArgumentException("No resource to harvest provided.");
    // create instance of the task
    // add only if no similar task currently executing
    boolean submitted = false;
    if (resource.getApprovalStatus() == ApprovalStatus.approved && resource.getSynchronizable()) {
      CommonCriteria criteria = new CommonCriteria();
      criteria.setMaxRecords(maxRecs);
      criteria.setFromDate(fromDate);
      submitted = pool != null && taskQueue != null ? !pool.isExecuting(resource.getUuid()) && taskQueue.register(context, resource, criteria) : false;
      if (submitted)
        pool.span(resource, criteria);
      LOGGER.log(Level.FINER, "[SYNCHRONIZER] Submitted resource: {0} ({1})", new Object[]{resource.getUuid(), resource.getName()});
    }
View Full Code Here

Examples of com.esri.gpt.control.webharvest.common.CommonCriteria

}

@Test
public void testNewQuery() {
      System.out.println("newQuery");
      CommonCriteria crt = new CommonCriteria();
      crt.setMaxRecords(5);
      Query query = instance.newQuery(crt);
      assertNotNull(query);
      Result result = query.execute();
      assertNotNull(result);
      Iterable<Resource> resources = result.getResources();
      assertNotNull(resources);
      int count = 0;
      for (Resource resource : resources) {
        count++;
      }
      assertTrue(count<=crt.getMaxRecords());
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.