Package com.amazonaws.services.simpledb.model

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


    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here


    }
   
    @Test
    public void putAttributesItemNameIsRequired() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        Exchange exchange = template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    }
   
    @Test
    public void putAttributesItemNameIsRequired() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        Exchange exchange = template.send("direct:start", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    log.debug("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(
View Full Code Here

    log.debug("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));

      // Store the JSON representation in multiple attributes since max
      // length is 1024
      for (int i = 0; json.length() > i * MAX_ATTR_LENGTH; i++) {
        int end = Math.min((i + 1) * MAX_ATTR_LENGTH, json.length());
        attributes.add(new ReplaceableAttribute(TRIGGER_JSON
            + String.valueOf(i), json.substring(
            i * MAX_ATTR_LENGTH, end), true));
      }
      amazonSimpleDb.batchPutAttributes(new BatchPutAttributesRequest(
          triggerDomain, Collections.singletonList(item)));
View Full Code Here

  }

  private void updateState(TriggerWrapper tw) {
    log.debug("Updating state of Trigger: " + tw.trigger.getFullName());
    String key = TriggerWrapper.getTriggerNameKey(tw.trigger);
    ReplaceableAttribute attr = new ReplaceableAttribute(TRIGGER_STATE,
        String.valueOf(tw.state), true);
    amazonSimpleDb.putAttributes(new PutAttributesRequest(triggerDomain,
        key, Collections.singletonList(attr)));
  }
View Full Code Here

    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    }
   
    @Test
    public void putAttributesItemNameIsRequired() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        Exchange exchange = template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

    }
   
    @Test
    public void putAttributes() {
        final List<ReplaceableAttribute> replaceableAttributes = Arrays.asList(new ReplaceableAttribute[] {
            new ReplaceableAttribute("NAME1", "VALUE1", true)});
        final UpdateCondition updateCondition = new UpdateCondition("NAME1", "VALUE1", true);
       
        template.send("direct:start-sdb", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(SdbConstants.OPERATION, SdbOperations.PutAttributes);
View Full Code Here

TOP

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

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.