Package org.tinyradius.attribute

Examples of org.tinyradius.attribute.VendorSpecificAttribute


      throw new NullPointerException("attribute is null");
    attribute.setDictionary(getDictionary());
    if (attribute.getVendorId() == -1)
      this.attributes.add(attribute);
    else {
      VendorSpecificAttribute vsa = new VendorSpecificAttribute(attribute.getVendorId());
      vsa.addSubAttribute(attribute);
      this.attributes.add(vsa);
    }
  }
View Full Code Here


        throw new IllegalArgumentException("no such attribute");
    } else {
      // remove Vendor-Specific sub-attribute
      List vsas = getVendorAttributes(attribute.getVendorId());
      for (Iterator i = vsas.iterator(); i.hasNext();) {
        VendorSpecificAttribute vsa = (VendorSpecificAttribute)i.next();
        List sas = vsa.getSubAttributes();
        if (sas.contains(attribute)) {
          vsa.removeSubAttribute(attribute);
          if (sas.size() == 1)
            // removed the last sub-attribute
            // --> remove the whole Vendor-Specific attribute
            removeAttribute(vsa);
        }
View Full Code Here

      return;
    }
   
    List vsas = getVendorAttributes(vendorId);
    for (Iterator i = vsas.iterator(); i.hasNext();) {
      VendorSpecificAttribute vsa = (VendorSpecificAttribute)i.next();
     
      List sas = vsa.getSubAttributes();
      for (Iterator j = sas.iterator(); j.hasNext();) {
        RadiusAttribute attr = (RadiusAttribute)j.next();
        if (attr.getAttributeType() == typeCode &&
          attr.getVendorId() == vendorId)
          j.remove();
View Full Code Here

      return getAttributes(attributeType);
   
    LinkedList result = new LinkedList();
    List vsas = getVendorAttributes(vendorId);
    for (Iterator i = vsas.iterator(); i.hasNext();) {
      VendorSpecificAttribute vsa = (VendorSpecificAttribute)i.next();
      List sas = vsa.getSubAttributes();
      for (Iterator j = sas.iterator(); j.hasNext();) {
        RadiusAttribute attr = (RadiusAttribute)j.next();
        if (attr.getAttributeType() == attributeType &&
          attr.getVendorId() == vendorId)
          result.add(attr);
View Full Code Here

  public List getVendorAttributes(int vendorId) {
    LinkedList result = new LinkedList();
    for (Iterator i = attributes.iterator(); i.hasNext();) {
      RadiusAttribute a = (RadiusAttribute)i.next();
      if (a instanceof VendorSpecificAttribute) {
        VendorSpecificAttribute vsa = (VendorSpecificAttribute)a;
        if (vsa.getChildVendorId() == vendorId)
          result.add(vsa);
      }
    }
    return result;
  }
View Full Code Here

   * @deprecated use getVendorAttributes(int)
   * @see #getVendorAttributes(int)
   */
  public VendorSpecificAttribute getVendorAttribute(int vendorId) {
    for (Iterator i = getAttributes(VendorSpecificAttribute.VENDOR_SPECIFIC).iterator(); i.hasNext();) {
      VendorSpecificAttribute vsa = (VendorSpecificAttribute)i.next();
      if (vsa.getChildVendorId() == vendorId)
        return vsa;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.tinyradius.attribute.VendorSpecificAttribute

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.