Package com.amazonaws.services.simpledb.model

Examples of com.amazonaws.services.simpledb.model.Item


      if(clazz == null){
        clazz = obj.getClass();
        info = ClassInfo.getClassInfo(clazz);       
      }
      String itemName = getItemName(clazz, obj);
      Item theItem = null;
      for(Item item:items){
        if(item.getName().equals(itemName)){
          theItem = item;
          items.remove(item);
          break;
View Full Code Here


  public static <T> void mapSelectResultToList(SelectResult res, List<T> resList, Class<T> clazz, int offset) {
    List<Item> items = res.getItems();
   
    ClassInfo info = ClassInfo.getClassInfo(clazz);
    for(int i=offset; i<items.size(); i++){
      Item item = items.get(i);
      T obj = Util.createObjectInstance(clazz);
      fillModel(item, clazz, info, obj);
      resList.add(obj);
    }   
  }
View Full Code Here

  public static <T> void mapSelectResultToListKeysOnly(SelectResult res, List<T> resList, Class<T> clazz, int offset) {
    List<Item> items = res.getItems();
   
    ClassInfo info = ClassInfo.getClassInfo(clazz);
    for(int i=offset; i<items.size(); i++){
      Item item = items.get(i);
      T obj = Util.createObjectInstance(clazz);
      fillModelKeysOnly(item, clazz, info, obj);
      resList.add(obj);
    }
  }
View Full Code Here

      }
    }
  }
 
  public static int mapSelectResultToCount(SelectResult res) {
    Item item = res.getItems().get(0);
    if(item != null){
      Attribute attr = item.getAttributes().get(0);
      if("Count".equals(attr.getName())){
        return Integer.parseInt(attr.getValue());
      }
    }
   
View Full Code Here

      }
      return true;
    }

    public T next() {
      Item item = it.next();
      idx++;
     
      // moves realoffset if not paginating
      //if(!pag.isPaginating()){
      //  sdbCtx.realOffset++;
View Full Code Here

    public SelectResult select(SelectRequest selectRequest) throws AmazonServiceException, AmazonClientException {
        this.selectRequest = selectRequest;
       
        SelectResult result = new SelectResult();
        result.setNextToken("TOKEN2");
        result.getItems().add(new Item("ITEM1", null));
        result.getItems().add(new Item("ITEM2", null));
        return result;
    }
View Full Code Here

    public SelectResult select(SelectRequest selectRequest) throws AmazonServiceException, AmazonClientException {
        this.selectRequest = selectRequest;
       
        SelectResult result = new SelectResult();
        result.setNextToken("TOKEN2");
        result.getItems().add(new Item("ITEM1", null));
        result.getItems().add(new Item("ITEM2", null));
        return result;
    }
View Full Code Here

    }

    @Test
    public void execute() {
        List<Item> deletableItems = new ArrayList<Item>();
        deletableItems.add(new Item());
        exchange.getIn().setHeader(SdbConstants.DELETABLE_ITEMS, deletableItems);
       
        command.execute();
       
        assertEquals("DOMAIN1", sdbClient.batchDeleteAttributesRequest.getDomainName());
View Full Code Here

    @Test
    public void determineDeletableItems() {
        assertNull(this.command.determineDeletableItems());
       
        List<Item> deletableItems = new ArrayList<Item>();
        deletableItems.add(new Item());
        exchange.getIn().setHeader(SdbConstants.DELETABLE_ITEMS, deletableItems);
       
        assertEquals(deletableItems, this.command.determineDeletableItems());
    }
View Full Code Here

  public int getNumberOfJobs(SchedulingContext ctxt) {
    log.debug("Finding number of jobs");
    try {
      SelectResult result = amazonSimpleDb.select(new SelectRequest(query
          .countJobs()));
      Item item = result.getItems().get(0);
      return Integer.parseInt(item.getAttributes().get(0).getValue());
    } catch (Exception e) {
      log.error("Could not find number of jobs", e);
      return -1;
    }
  }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpledb.model.Item

Copyright © 2018 www.massapicom. 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.