Package com.amazonaws.services.simpledb.model

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


    }
   
    @Test
    public void batchPutAttributes() {
        final List<ReplaceableItem> replaceableItems = Arrays.asList(new ReplaceableItem[] {
            new ReplaceableItem("ITEM1")});
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.BatchPutAttributes);
                exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
View Full Code Here


    }
   
    @Test
    public void batchPutAttributes() {
        final List<ReplaceableItem> replaceableItems = Arrays.asList(new ReplaceableItem[] {
            new ReplaceableItem("ITEM1")});
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.BatchPutAttributes);
                exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
View Full Code Here

    }
   
    @Test
    public void batchPutAttributes() {
        final List<ReplaceableItem> replaceableItems = Arrays.asList(new ReplaceableItem[] {
            new ReplaceableItem("ITEM1")});
       
        template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.BatchPutAttributes);
                exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
View Full Code Here

    }
   
    @Test
    public void batchPutAttributes() {
        final List<ReplaceableItem> replaceableItems = Arrays.asList(new ReplaceableItem[] {
            new ReplaceableItem("ITEM1")});
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.BatchPutAttributes);
                exchange.getIn().setHeader(SdbConstants.REPLACEABLE_ITEMS, replaceableItems);
View Full Code Here

        List<ReplaceableItem>   items = new ArrayList<ReplaceableItem>();

        for (int i = offset; i < dataObjs.size() && items.size() < MAX_PUT_ITEMS; i++) {
            Object  dataObj = dataObjs.get(i);
            String  idValue = makeIdValue(modelName, dataObj);
            items.add(new ReplaceableItem(idValue, buildAttrs(dataObj, modelName)));
        }
        return items;
    }
View Full Code Here

  @Override
  public void storeJob(SchedulingContext ctxt, JobDetail newJob,
      boolean replaceExisting) throws ObjectAlreadyExistsException {

    logDebug("Storing Job: ", newJob.getFullName());
    ReplaceableItem item = null;
    try {
      List<ReplaceableAttribute> attributes = new ArrayList<ReplaceableAttribute>();
      attributes.add(new ReplaceableAttribute(JOB_NAME, newJob.getName(),
          true));
      attributes.add(new ReplaceableAttribute(JOB_GROUP, newJob
          .getGroup(), true));
      attributes.add(new ReplaceableAttribute(JOB_JOBCLASS, newJob
          .getJobClass().getName(), true));
      attributes.add(new ReplaceableAttribute(JOB_CLASS, newJob
          .getClass().getName(), true));
      if (newJob.getJobDataMap() != null) {
        attributes.add(new ReplaceableAttribute(JOB_DATA_MAP, mapper
            .writeValueAsString(newJob.getJobDataMap()), true));
      }
      item = new ReplaceableItem(JobWrapper.getJobNameKey(newJob),
          attributes);
      amazonSimpleDb.batchPutAttributes(new BatchPutAttributesRequest(
          jobDomain, Collections.singletonList(item)));
    } catch (Exception e) {
      log.error("Could not store Job: " + newJob.getFullName(), e);
View Full Code Here

  @Override
  public void storeTrigger(SchedulingContext ctxt, Trigger newTrigger,
      boolean replaceExisting) throws JobPersistenceException {

    logDebug("Storing Trigger: ", newTrigger.getFullName());
    ReplaceableItem item = null;
    try {

      List<ReplaceableAttribute> attributes = new ArrayList<ReplaceableAttribute>();
      attributes.add(new ReplaceableAttribute(TRIGGER_CLASS, newTrigger
          .getClass().getName(), true));
      attributes.add(new ReplaceableAttribute(TRIGGER_NAME, newTrigger
          .getName(), true));
      if (newTrigger.getCalendarName() != null) {
        attributes.add(new ReplaceableAttribute(TRIGGER_CALENDAR_NAME,
            newTrigger.getCalendarName(), true));
      }
      attributes.add(new ReplaceableAttribute(TRIGGER_GROUP, newTrigger
          .getGroup(), true));
      attributes.add(new ReplaceableAttribute(TRIGGER_JOB_GROUP,
          newTrigger.getJobGroup(), true));
      attributes.add(new ReplaceableAttribute(TRIGGER_JOB_NAME,
          newTrigger.getJobName(), true));
      attributes.add(new ReplaceableAttribute(TRIGGER_PRIORITY, String
          .valueOf(newTrigger.getPriority()), true));
      if (newTrigger.getEndTime() != null) {
        attributes.add(new ReplaceableAttribute(TRIGGER_END_TIME,
            dateFormat.format(newTrigger.getEndTime()), true));
      }
      if (newTrigger.getStartTime() != null) {
        attributes.add(new ReplaceableAttribute(TRIGGER_START_TIME,
            dateFormat.format(newTrigger.getStartTime()), true));
      }
      if (newTrigger.getNextFireTime() != null) {
        attributes.add(new ReplaceableAttribute(TRIGGER_NEXT_FIRE_TIME,
            dateFormat.format(newTrigger.getNextFireTime()), true));
      }
      item = new ReplaceableItem(
          TriggerWrapper.getTriggerNameKey(newTrigger), attributes);
      String json = mapper.writeValueAsString(newTrigger);
      attributes.add(new ReplaceableAttribute(TRIGGER_JSON_LENGTH, String
          .valueOf(json.length()), true));
View Full Code Here

   * @param id Id of item
   * @return ReplaceableItem
   */
  protected ReplaceableItem getReplaceableItem(List<ReplaceableAttribute> attributes,
      String id) {
    return new ReplaceableItem().withName(id).withAttributes(attributes);
  }
View Full Code Here

     * @return An array of sample item data.
     */
    private static List<ReplaceableItem> createSampleData() {
        List<ReplaceableItem> sampleData = new ArrayList<ReplaceableItem>();

        sampleData.add(new ReplaceableItem("Item_01").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory", "Sweater", true),
                new ReplaceableAttribute("Name", "Cathair Sweater", true),
                new ReplaceableAttribute("Color", "Siamese", true),
                new ReplaceableAttribute("Size", "Small", true),
                new ReplaceableAttribute("Size", "Medium", true),
                new ReplaceableAttribute("Size", "Large", true)));

        sampleData.add(new ReplaceableItem("Item_02").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory","Pants", true),
                new ReplaceableAttribute("Name", "Designer Jeans", true),
                new ReplaceableAttribute("Color", "Paisley Acid Wash", true),
                new ReplaceableAttribute("Size", "30x32", true),
                new ReplaceableAttribute("Size", "32x32", true),
                new ReplaceableAttribute("Size", "32x34", true)));

        sampleData.add(new ReplaceableItem("Item_03").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory", "Pants", true),
                new ReplaceableAttribute("Name", "Sweatpants", true),
                new ReplaceableAttribute("Color", "Blue", true),
                new ReplaceableAttribute("Color", "Yellow", true),
                new ReplaceableAttribute("Color", "Pink", true),
                new ReplaceableAttribute("Size", "Large", true),
                new ReplaceableAttribute("Year", "2006", true),
                new ReplaceableAttribute("Year", "2007", true)));

        sampleData.add(new ReplaceableItem("Item_04").withAttributes(
                new ReplaceableAttribute("Category", "Car Parts", true),
                new ReplaceableAttribute("Subcategory", "Engine", true),
                new ReplaceableAttribute("Name", "Turbos", true),
                new ReplaceableAttribute("Make", "Audi", true),
                new ReplaceableAttribute("Model", "S4", true),
                new ReplaceableAttribute("Year", "2000", true),
                new ReplaceableAttribute("Year", "2001", true),
                new ReplaceableAttribute("Year", "2002", true)));

        sampleData.add(new ReplaceableItem("Item_05").withAttributes(
                new ReplaceableAttribute("Category", "Car Parts", true),
                new ReplaceableAttribute("Subcategory", "Emissions", true),
                new ReplaceableAttribute("Name", "O2 Sensor", true),
                new ReplaceableAttribute("Make", "Audi", true),
                new ReplaceableAttribute("Model", "S4", true),
View Full Code Here

     * @return An array of sample item data.
     */
    private static List<ReplaceableItem> createSampleData() {
        List<ReplaceableItem> sampleData = new ArrayList<ReplaceableItem>();

        sampleData.add(new ReplaceableItem("Item_01").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory", "Sweater", true),
                new ReplaceableAttribute("Name", "Cathair Sweater", true),
                new ReplaceableAttribute("Color", "Siamese", true),
                new ReplaceableAttribute("Size", "Small", true),
                new ReplaceableAttribute("Size", "Medium", true),
                new ReplaceableAttribute("Size", "Large", true)));

        sampleData.add(new ReplaceableItem("Item_02").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory","Pants", true),
                new ReplaceableAttribute("Name", "Designer Jeans", true),
                new ReplaceableAttribute("Color", "Paisley Acid Wash", true),
                new ReplaceableAttribute("Size", "30x32", true),
                new ReplaceableAttribute("Size", "32x32", true),
                new ReplaceableAttribute("Size", "32x34", true)));

        sampleData.add(new ReplaceableItem("Item_03").withAttributes(
                new ReplaceableAttribute("Category", "Clothes", true),
                new ReplaceableAttribute("Subcategory", "Pants", true),
                new ReplaceableAttribute("Name", "Sweatpants", true),
                new ReplaceableAttribute("Color", "Blue", true),
                new ReplaceableAttribute("Color", "Yellow", true),
                new ReplaceableAttribute("Color", "Pink", true),
                new ReplaceableAttribute("Size", "Large", true),
                new ReplaceableAttribute("Year", "2006", true),
                new ReplaceableAttribute("Year", "2007", true)));

        sampleData.add(new ReplaceableItem("Item_04").withAttributes(
                new ReplaceableAttribute("Category", "Car Parts", true),
                new ReplaceableAttribute("Subcategory", "Engine", true),
                new ReplaceableAttribute("Name", "Turbos", true),
                new ReplaceableAttribute("Make", "Audi", true),
                new ReplaceableAttribute("Model", "S4", true),
                new ReplaceableAttribute("Year", "2000", true),
                new ReplaceableAttribute("Year", "2001", true),
                new ReplaceableAttribute("Year", "2002", true)));

        sampleData.add(new ReplaceableItem("Item_05").withAttributes(
                new ReplaceableAttribute("Category", "Car Parts", true),
                new ReplaceableAttribute("Subcategory", "Emissions", true),
                new ReplaceableAttribute("Name", "O2 Sensor", true),
                new ReplaceableAttribute("Make", "Audi", true),
                new ReplaceableAttribute("Model", "S4", true),
View Full Code Here

TOP

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

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.