public class PacketFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PacketFactory.PacketFactoryPool |
| Constructor and Description |
|---|
PacketFactory() |
| Modifier and Type | Method and Description |
|---|---|
static RadiusPacket |
copyPacket(RadiusPacket req,
boolean pool) |
static String |
getPoolStatus() |
static RadiusPacket |
newPacket(byte b) |
static RadiusPacket |
newPacket(byte b,
AttributeList list) |
static RadiusPacket |
newPacket(byte b,
int identifier) |
static RadiusPacket |
newPacket(byte b,
int identifier,
AttributeList list) |
static RadiusRequest |
newPacket(byte b,
RadiusClient client,
AttributeList list) |
static RadiusPacket |
newPacket(Integer code) |
static RadiusPacket |
newPacket(Integer code,
boolean pool) |
static RadiusPacket[] |
parse(ByteBuffer buffer,
int packetCount)
Parse multiple RadiusPackets from a data stream
|
static RadiusPacket |
parse(DatagramPacket dp,
boolean pool)
Parse a UDP RADIUS message
|
static RadiusPacket |
parsePacket(ByteBuffer buffer) |
static RadiusPacket |
parseUDP(ByteBuffer buffer,
boolean pool) |
static RadiusPacket |
parseUDP(int code,
int identifier,
int length,
ByteBuffer buffer,
boolean pool) |
static void |
poolStatus() |
static void |
recycle(RadiusPacket p) |
static void |
recycle(RadiusPacket[] rp) |
public static RadiusPacket newPacket(Integer code, boolean pool)
public static RadiusPacket newPacket(Integer code)
public static RadiusPacket newPacket(byte b)
public static RadiusPacket newPacket(byte b, int identifier)
public static RadiusPacket newPacket(byte b, int identifier, AttributeList list)
public static RadiusPacket newPacket(byte b, AttributeList list)
public static RadiusRequest newPacket(byte b, RadiusClient client, AttributeList list)
public static RadiusPacket copyPacket(RadiusPacket req, boolean pool)
public static RadiusPacket parse(DatagramPacket dp, boolean pool) throws RadiusException
dp - The Datagram to be parsedRadiusExceptionpublic static RadiusPacket parseUDP(ByteBuffer buffer, boolean pool) throws RadiusException, IOException
RadiusExceptionIOExceptionpublic static RadiusPacket parseUDP(int code, int identifier, int length, ByteBuffer buffer, boolean pool) throws RadiusException, IOException
RadiusExceptionIOExceptionpublic static RadiusPacket parsePacket(ByteBuffer buffer) throws RadiusException
RadiusExceptionpublic static RadiusPacket[] parse(ByteBuffer buffer, int packetCount)
in - The input data streampacketCount - Number of packets to expectRadiusException - public static RadiusPacket[] parse(InputStream in, int packetCount) throws RadiusException
{
RadiusPacket rp[] = new RadiusPacket[packetCount];
try
{
for (int i=0; i < packetCount; i++)
{
rp[i] = parsePacket(in);
}
}
catch (IOException e)
{
RadiusLog.error(e.getMessage(), e);
}
return rp;
}public static void poolStatus()
public static String getPoolStatus()
public static void recycle(RadiusPacket p)
public static void recycle(RadiusPacket[] rp)
Copyright © 2017. All rights reserved.