if (name == null || name.length() == 0)
throw new IllegalArgumentException("type name is empty");
if (value == null || value.length() == 0)
throw new IllegalArgumentException("value is empty");
AttributeType type = getDictionary().getAttributeTypeByName(name);
if (type == null)
throw new IllegalArgumentException("unknown attribute type '"
+ name + "'");
if (type.getVendorId() == -1)
throw new IllegalArgumentException("attribute type '" + name
+ "' is not a Vendor-Specific sub-attribute");
if (type.getVendorId() != getChildVendorId())
throw new IllegalArgumentException("attribute type '" + name
+ "' does not belong to vendor ID " + getChildVendorId());
RadiusAttribute attribute = createRadiusAttribute(getDictionary(),
getChildVendorId(), type.getTypeCode());
attribute.setAttributeValue(value);
addSubAttribute(attribute);
}