Examples of AttributeValueType


Examples of com.amazon.ec2.AttributeValueType

        EC2ModifyImageAttribute request = new EC2ModifyImageAttribute();

        ModifyImageAttributeType miat = modifyImageAttribute.getModifyImageAttribute();
        ModifyImageAttributeTypeChoice_type0 item = miat.getModifyImageAttributeTypeChoice_type0();

        AttributeValueType description = item.getDescription();

        LaunchPermissionOperationType launchPermOp = item.getLaunchPermission();

        if (null != description) {
            request.setImageId(miat.getImageId());
            request.setAttribute(ImageAttribute.description);
            request.setDescription(description.getValue());
            return toModifyImageAttributeResponse(engine.modifyImageAttribute(request));
        } else if (launchPermOp != null) {
            request.setImageId(miat.getImageId());
            request.setAttribute(ImageAttribute.launchPermission);
            if (launchPermOp.getAdd() != null) {
View Full Code Here

Examples of com.michelboudreau.alternator.enums.AttributeValueType

    // Make sure that item specifies hash key and range key (if in schema)
    KeySchemaElement hashKey = table.getKeySchema().getHashKeyElement();
    KeySchemaElement rangeKey = table.getKeySchema().getRangeKeyElement();
    AttributeValue hashItem = request.getItem().get(hashKey.getAttributeName());
    AttributeValueType hashItemType = getAttributeValueType(hashItem);
    if (hashItem == null || hashItemType != AttributeValueType.fromString(hashKey.getAttributeType())) {
      throw new InternalServerErrorException("Missing hash key (" + hashKey.getAttributeName() + ") from item: " + request.getItem());
    }
    if (rangeKey != null) {
      AttributeValue rangeItem = request.getItem().get(rangeKey.getAttributeName());
      AttributeValueType rangeItemType = getAttributeValueType(rangeItem);
      if (rangeItem == null || rangeItemType != AttributeValueType.fromString(rangeKey.getAttributeType())) {
        throw new InternalServerErrorException("Missing range key (" + rangeKey.getAttributeName() + ") from item: " + request.getItem());
      }
    }
View Full Code Here

Examples of com.michelboudreau.alternator.enums.AttributeValueType

      }
  }

    private boolean isComparableInScan(AttributeValue value, AttributeValue comp) {
        if (comp == null) return false;
        final AttributeValueType compType = getAttributeValueType(comp);
        final AttributeValueType valueType = getAttributeValueType(value);
        return (compType.equals(AttributeValueType.N) || compType.equals(AttributeValueType.S)) && compType.equals(valueType);
    }
View Full Code Here

Examples of com.michelboudreau.alternator.enums.AttributeValueType

        return (compType.equals(AttributeValueType.N) || compType.equals(AttributeValueType.S)) && compType.equals(valueType);
    }

    private int compareForScan(AttributeValue value, AttributeValue comp) {
        //Get type
        final AttributeValueType valueType = getAttributeValueType(value);
        if (valueType.equals(AttributeValueType.S)) return value.getS().compareTo(comp.getS());

        if (valueType.equals(AttributeValueType.N)) {
            try {
                return new Long(value.getN()).compareTo(new Long(comp.getN()));
            } catch (NumberFormatException e) {
                return new Double(value.getN()).compareTo(new Double(comp.getN()));
            }
View Full Code Here

Examples of com.michelboudreau.alternator.enums.AttributeValueType

        throw new IllegalArgumentException("Can only compare String and Number types, got " + valueType);
    }

    private String getAttributeValueAsString(AttributeValue value) {
        final AttributeValueType valueType = getAttributeValueType(value);
        if (valueType.equals(AttributeValueType.N)) return value.getN();
        if (valueType.equals(AttributeValueType.S)) return value.getS();
        throw new IllegalArgumentException("Can only return values for Number and String, got " + valueType);
    }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType);
      if (issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType);
      if (issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

            "urn:va:xacml:2.0:interop:rsa8:hl7:prd-006"};
     
      AttributeType multi = RequestAttributeFactory.createMultiValuedAttributeType(attributeId,
            issuer, dataType, values);
      assertNotNull("Attribute is not null", multi);
      AttributeValueType avt = multi.getAttributeValue().get(0);
      assertEquals(7 ,avt.getContent().size());
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

      if (issuer != null)
         attributeType.setIssuer(issuer);
     
      List<String> valueList = Arrays.asList(values);
     
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().addAll(valueList);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
View Full Code Here

Examples of org.jboss.security.xacml.core.model.context.AttributeValueType

      AttributeType attributeType = new AttributeType();
      attributeType.setAttributeId(attrID);
      attributeType.setDataType(dataType);
      if (issuer != null)
         attributeType.setIssuer(issuer);
      AttributeValueType avt = new AttributeValueType();
      avt.getContent().add(value);
      attributeType.getAttributeValue().add(avt);
      return attributeType;
   }
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.