Class AttributeSet
- java.lang.Object
-
- org.forgerock.openam.radius.common.AttributeSet
-
public class AttributeSet extends Object
Holder of the attribute instances in an instance of thecom.sun.identity.authentication.modules.radius.client.Packettype which is the superclass of all radius packet types. Maintains the order in which attributes are added.
-
-
Constructor Summary
Constructors Constructor Description AttributeSet()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(Attribute attr)Adds an attribute instance to the container.AttributegetAttributeAt(int pos)Returns the attribute instance at the indicated index location.AttributegetAttributeByType(AttributeType type)Returns the first occurrence of an attribute instance of the specified type code.EnumerationgetAttributes()Returns a legacyEnumerationfor enumerating over the the contained attribute instances.intremoveAttributesByType(AttributeType type)Removes every attribute whose type matches the given type code.intsize()Indicates the number of attributes held in the container.
-
-
-
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 legacyEnumerationfor enumerating over the the contained attribute instances.- Returns:
- an
Enumerationobject 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.
-
-