Class Attribute
- java.lang.Object
-
- org.forgerock.openam.radius.common.Attribute
-
- Direct Known Subclasses:
CallbackIdAttribute,CallbackNumberAttribute,CallerStationIdAttribute,CallingStationIdAttribute,CHAPChallengeAttribute,CHAPPasswordAttribute,FilterIdAttribute,FramedAppleTalkLinkAttribute,FramedAppleTalkNetworkAttribute,FramedAppleTalkZoneAttribute,FramedCompressionAttribute,FramedIPAddressAttribute,FramedIPNetmaskAttribute,FramedIPXNetworkAttribute,FramedMTUAttribute,FramedProtocolAttribute,FramedRouteAttribute,FramedRoutingAttribute,IdleTimeoutAttribute,LoginIPHostAttribute,LoginLATGroupAttribute,LoginLATNodeAttribute,LoginLATPortAttribute,LoginLATServiceAttribute,LoginServiceAttribute,LoginTCPPortAttribute,MessageAuthenticatorAttribute,NASClassAttribute,NASIdentifierAttribute,NASIPAddressAttribute,NASPortAttribute,NASPortTypeAttribute,PortLimitAttribute,ProxyStateAttribute,ReplyMessageAttribute,ServiceTypeAttribute,SessionTimeoutAttribute,StateAttribute,TerminationActionAttribute,UnknownAttribute,UserNameAttribute,UserPasswordAttribute,VendorSpecificAttribute
public abstract class Attribute extends Object
Legacy class from before enum types were supported and holder of constants of all defined radius attribute type codes outlined in RFC 2865. If support for new types is added we should just be able to add them to theAttributeTypeclass without adding them here.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_ATTRIBUTE_LENGTHThe maximum number of bytes in the on-the-wire format of an attribute since RFC 2865 gives the length field a single octet in the on-the-wire format.static intMAX_ATTRIBUTE_VALUE_LENGTHSince the on-the-wire format has a single type octet followed by a single length octet the maximum length of an attribute's value is 255 - 2 which is 253.
-
Constructor Summary
Constructors Constructor Description Attribute(byte[] octets)Constructor using the on-the-wire octets for the attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getOctets()Returns a byte array with on-the-wire attribute format including the two byte prefix consisting of the type octet and length octet defined in section 3 of RFC 2865.AttributeTypegetType()Returns the type code of the attribute.protected voidsetOctets(byte[] octets)Sets the array of octets representing the format of a given attribute on-the-wire including prefixed type and length octets as defined in section 3 of RFC 2865.StringtoString()Shows a String representation of the contents of a given field.StringtoStringImpl()Method expected to be overridden by subclasses to append detail beyond attribute type name.
-
-
-
Field Detail
-
MAX_ATTRIBUTE_LENGTH
public static final int MAX_ATTRIBUTE_LENGTH
The maximum number of bytes in the on-the-wire format of an attribute since RFC 2865 gives the length field a single octet in the on-the-wire format.- See Also:
- Constant Field Values
-
MAX_ATTRIBUTE_VALUE_LENGTH
public static final int MAX_ATTRIBUTE_VALUE_LENGTH
Since the on-the-wire format has a single type octet followed by a single length octet the maximum length of an attribute's value is 255 - 2 which is 253.- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public AttributeType getType()
Returns the type code of the attribute.- Returns:
- code indicative of the type of radius attribute.
-
setOctets
protected void setOctets(byte[] octets)
Sets the array of octets representing the format of a given attribute on-the-wire including prefixed type and length octets as defined in section 3 of RFC 2865. Subclasses should call this method in their constructors for injecting the proper set of octest to represent this attribute instance in the on-the-wire format.- Parameters:
octets- the octets
-
getOctets
public byte[] getOctets()
Returns a byte array with on-the-wire attribute format including the two byte prefix consisting of the type octet and length octet defined in section 3 of RFC 2865.- Returns:
- the on-the-wire byte representation of this attribute including preceding type and length octets.
-
toString
public String toString()
Shows a String representation of the contents of a given field. Used for logging packet traffic.
-
toStringImpl
public String toStringImpl()
Method expected to be overridden by subclasses to append detail beyond attribute type name. Used by logging to portray attribute field structure when logging packet traffic if special handling is required for a given field distinct from that provided by the super class.- Returns:
- the string representation of this attribute which is an empty string by default.
-
-