Package com.amazonaws.services.simpledb.model

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


  public static <T> DeletableItem createDeletableItemFromKey(Class<T> clazz, Object key) { 
    return new DeletableItem().withName(getItemNameFromKey(clazz, key));
  }
 
  public static GetAttributesRequest createGetRequest(String domain, Class<?> clazz, Object obj) {
    GetAttributesRequest req =
      new GetAttributesRequest().withDomainName(domain).withItemName(getItemName(clazz, obj));
   
    return req;
  }
View Full Code Here


   
    return req;
  }
 
  public static GetAttributesRequest createGetRequestFromKey(String domain, Class<?> clazz, Object key) {
    GetAttributesRequest req =
      new GetAttributesRequest().withDomainName(domain).withItemName(key.toString());
   
    return req;
  }
View Full Code Here

    ClassInfo info = ClassInfo.getClassInfo(obj.getClass());
   
    String domain = SdbMappingUtils.getDomainName(clazz, prefix);
    try {
      checkDomain(domain);
      GetAttributesRequest req = SdbMappingUtils.createGetRequest(domain, clazz, obj);
      // sets consistent read to true when reading one single object
      req.setConsistentRead(isReadConsistent());
      GetAttributesResult res = sdb.getAttributes(req);
      if(res.getAttributes().size() == 0){
        throw new SienaException(req.getItemName()+" not found in domain "+req.getDomainName());
      }
       
      SdbMappingUtils.fillModel(req.getItemName(), res, clazz, obj);
     
      // join management
      if(!info.joinFields.isEmpty()){
        mapJoins(obj);
      }
View Full Code Here

 
  public <T> T getByKey(Class<T> clazz, Object key) {
    String domain = SdbMappingUtils.getDomainName(clazz, prefix);
    try {
      checkDomain(domain);
      GetAttributesRequest req = SdbMappingUtils.createGetRequestFromKey(domain, clazz, key);
      // sets consistent read to true when reading one single object
      req.setConsistentRead(isReadConsistent());
      GetAttributesResult res = sdb.getAttributes(req);
      if(res.getAttributes().size() == 0){
        throw new SienaException(req.getItemName()+" not found in domain "+req.getDomainName());
      }
       
      T obj = Util.createObjectInstance(clazz);

      SdbMappingUtils.fillModel(req.getItemName(), res, clazz, obj);
     
      // join management
      if(!ClassInfo.getClassInfo(clazz).joinFields.isEmpty()){
        mapJoins(obj);
      }
View Full Code Here

    public GetAttributesCommand(AmazonSimpleDB sdbClient, SdbConfiguration configuration, Exchange exchange) {
        super(sdbClient, configuration, exchange);
    }

    public void execute() {
        GetAttributesRequest request = new GetAttributesRequest()
            .withDomainName(determineDomainName())
            .withItemName(determineItemName())
            .withConsistentRead(determineConsistentRead())
            .withAttributeNames(determineAttributeNames());
        log.trace("Sending request [{}] for exchange [{}]...", request, exchange);
View Full Code Here

  public JobDetail retrieveJob(SchedulingContext ctxt, String jobName,
      String groupName) {
    log.debug("Retrieving Job: " + groupName + "." + jobName);
    String key = JobWrapper.getJobNameKey(jobName, groupName);
    GetAttributesResult result = amazonSimpleDb
        .getAttributes(new GetAttributesRequest(jobDomain, key)
            .withConsistentRead(new Boolean(true)));
    JobDetail job = null;
    try {
      job = jobDetailFromAttributes(result.getAttributes());
    } catch (Exception e) {
View Full Code Here

  public Trigger retrieveTrigger(SchedulingContext ctxt, String triggerName,
      String groupName) {
    log.debug("Retrieving Trigger: " + triggerName + "." + groupName);
    String key = TriggerWrapper.getTriggerNameKey(triggerName, groupName);
    GetAttributesResult result = amazonSimpleDb
        .getAttributes(new GetAttributesRequest(triggerDomain, key)
            .withConsistentRead(new Boolean(true)));
    TriggerWrapper tw = null;
    try {
      tw = triggerFromAttributes(result.getAttributes());
      return tw.trigger;
View Full Code Here

    log.debug("Finding state of Trigger: " + triggerName + "." + groupName);
    String key = TriggerWrapper.getTriggerNameKey(triggerName, groupName);

    TriggerWrapper tw = null;
    GetAttributesResult result = amazonSimpleDb
        .getAttributes(new GetAttributesRequest(triggerDomain, key)
            .withConsistentRead(new Boolean(true)));
    try {
      tw = triggerFromAttributes(result.getAttributes());
    } catch (Exception e) {
      log.error("Error finding state of Trigger: " + triggerName + "."
View Full Code Here

  public void pauseTrigger(SchedulingContext ctxt, String triggerName,
      String groupName) {
    log.debug("Pausing Trigger: " + triggerName + "." + groupName);
    String key = TriggerWrapper.getTriggerNameKey(triggerName, groupName);
    GetAttributesResult result = amazonSimpleDb
        .getAttributes(new GetAttributesRequest(triggerDomain, key)
            .withConsistentRead(new Boolean(true)));
    TriggerWrapper tw = null;

    try {
      tw = triggerFromAttributes(result.getAttributes());
View Full Code Here

      String groupName) {
    log.debug("Resuming Trigger: " + triggerName + "." + groupName);
    String key = TriggerWrapper.getTriggerNameKey(triggerName, groupName);

    GetAttributesResult result = amazonSimpleDb
        .getAttributes(new GetAttributesRequest(triggerDomain, key)
            .withConsistentRead(new Boolean(true)));
    TriggerWrapper tw = null;

    try {
      tw = triggerFromAttributes(result.getAttributes());
View Full Code Here

TOP

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

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.