Class PacketFactory


  • public final class PacketFactory
    extends Object
    Provides unmarshalling from the on-the-wire radius byte stream to the corresponding java objects. The old byte array mechanism is supported that was in the original radius authentication module. Additionally, the newer nio ByteBuffer added for radius server support is also available.
    • Method Detail

      • toPacket

        public static Packet toPacket​(byte[] octets)
        Unmarshalls from an array the octet format of rfc 2865 and creates the corresponding package and instantiates its embedded authenticator and attributes.
        Parameters:
        octets - the array containing the on-the-wire bytes received for the packet.
        Returns:
        the packet type that represents the received bytes
      • toPacket

        public static Packet toPacket​(ByteBuffer data)
        Unmarshalls from an ByteBuffer the octet format of rfc 2865 and creates the corresponding package and instantiates its embedded authenticator and attributes.
        Parameters:
        data - ByteBuffer containing the octets for the packet in on-the-wire-format.
        Returns:
        the packet type representing the packet found in the buffer octets
      • nextAttribute

        public static Attribute nextAttribute​(ByteBuffer bfr)
        Reads the next attribute out of the buffer or null if there is no more content.
        Parameters:
        bfr - the buffer containing the remaining unconsumed octets for the packet
        Returns:
        an attribute instance representing the next attribute octet set pulled from the buffer