Class GenericRequest
java.lang.Object
org.tinyradius.core.packet.BaseRadiusPacket<RadiusRequest>
org.tinyradius.core.packet.request.GenericRequest
- All Implemented Interfaces:
AttributeHolder<RadiusRequest>
,NestedAttributeHolder<RadiusRequest>
,RadiusPacket<RadiusRequest>
,RadiusRequest
- Direct Known Subclasses:
AccessRequest
,AccountingRequest
-
Field Summary
Fields inherited from interface org.tinyradius.core.attribute.AttributeHolder
attrHolderLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH
-
Constructor Summary
ConstructorDescriptionGenericRequest
(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) -
Method Summary
Modifier and TypeMethodDescriptiondecodeRequest
(String sharedSecret) Decodes the request against the supplied shared secret.encodeRequest
(String sharedSecret) Encode request and generate authenticator.protected byte[]
protected RadiusRequest
with
(io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) Naive with(), does not recalculate packet lengths in header.Methods inherited from class org.tinyradius.core.packet.BaseRadiusPacket
equals, getAttributes, getAuthenticator, getChildVendorId, getDictionary, getHeader, getId, getType, hashCode, toString, verifyPacketAuth, withAttributes, withAuthAttributes
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, decodeAttributes, encodeAttributes, getAttribute, getAttribute, getAttributeByteBuf, getAttributes, getAttributes, getAttributes, getAttributes, getChildVendorId, getDictionary, removeAttributes, removeLastAttribute, withAttributes
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, getAttribute, getAttributes, getAttributes, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAuthenticator, getHeader, getId, getLength, getType, toByteBuf, toByteBuffer, toBytes
-
Constructor Details
-
GenericRequest
public GenericRequest(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) throws RadiusPacketException - Throws:
RadiusPacketException
-
-
Method Details
-
genAuth
- Parameters:
sharedSecret
- to generate authenticator- Returns:
- new authenticator, must be idempotent
-
encodeRequest
Description copied from interface:RadiusRequest
Encode request and generate authenticator.Must be idempotent.
- Specified by:
encodeRequest
in interfaceRadiusRequest
- Parameters:
sharedSecret
- shared secret that secures the communication with the other Radius server/client- Returns:
- RadiusRequest with new authenticator and/or encoded attributes
- Throws:
RadiusPacketException
- if invalid or missing attributes
-
decodeRequest
Description copied from interface:RadiusRequest
Decodes the request against the supplied shared secret.Must be idempotent.
- Specified by:
decodeRequest
in interfaceRadiusRequest
- Parameters:
sharedSecret
- shared secret- Returns:
- verified RadiusRequest with decoded attributes if appropriate
- Throws:
RadiusPacketException
- if authenticator check fails
-
with
protected RadiusRequest with(io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) throws RadiusPacketException Description copied from class:BaseRadiusPacket
Naive with(), does not recalculate packet lengths in header.- Specified by:
with
in classBaseRadiusPacket<RadiusRequest>
- Parameters:
header
- Radius packet headerattributes
- Radius packet attributes- Returns:
- RadiusPacket with the specified headers and attributes
- Throws:
RadiusPacketException
- packet validation exceptions
-