Class AttributeSet


  • public class AttributeSet
    extends Object
    Holder of the attribute instances in an instance of the com.sun.identity.authentication.modules.radius.client.Packet type which is the superclass of all radius packet types. Maintains the order in which attributes are added.
    • Constructor Detail

      • AttributeSet

        public AttributeSet()
        Constructor.
    • Method Detail

      • addAttribute

        public void addAttribute​(Attribute attr)
        Adds an attribute instance to the container.
        Parameters:
        attr - an attribute instance to be appended to the set
      • size

        public int size()
        Indicates the number of attributes held in the container.
        Returns:
        the number of contained attribute instances
      • getAttributes

        public Enumeration getAttributes()
        Returns a legacy Enumeration for enumerating over the the contained attribute instances.
        Returns:
        an Enumeration object for enumerating over the set of attribute instances.
      • getAttributeByType

        public Attribute getAttributeByType​(AttributeType type)
        Returns the first occurrence of an attribute instance of the specified type code.
        Parameters:
        type - the attribute type code to be searched for in the set of attributes in order of injection
        Returns:
        the first attribute instance incurred having the given type code or null if none is found.
      • getAttributeAt

        public Attribute getAttributeAt​(int pos)
        Returns the attribute instance at the indicated index location.
        Parameters:
        pos - the position of the attribute instance to be retrieved.
        Returns:
        the instance of the attribute being retrieved
      • removeAttributesByType

        public int removeAttributesByType​(AttributeType type)
        Removes every attribute whose type matches the given type code. Useful when a packet is re-transmitted (for example during RADIUS failover) and an attribute that must appear at most once - such as RFC 3579 Message-Authenticator (one per packet) - has to be regenerated from scratch instead of being appended a second time.
        Parameters:
        type - the attribute type code whose instances should be evicted.
        Returns:
        the number of attribute instances that were removed.