Class DiameterParser
- java.lang.Object
-
- io.snice.codecs.codec.diameter.impl.DiameterParser
-
public class DiameterParser extends Object
- Author:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description DiameterParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
canFrameMessage(io.snice.buffer.Buffer buffer)
For stream based protocols, we may not get all the data at the same time and as such, we need to wait for more to arrive.static boolean
couldBeDiameterMessage(io.snice.buffer.ReadableBuffer buffer)
Convenience method for checking if this could indeed by aDiameterMessage
.static DiameterMessage
frame(io.snice.buffer.Buffer buffer)
static AvpHeader
frameAvpHeader(io.snice.buffer.ReadableBuffer buffer)
static DiameterHeader
frameHeader(io.snice.buffer.ReadableBuffer buffer)
static FramedAvp
frameRawAvp(io.snice.buffer.ReadableBuffer buffer)
-
-
-
Method Detail
-
frame
public static DiameterMessage frame(io.snice.buffer.Buffer buffer) throws DiameterParseException
- Throws:
DiameterParseException
-
canFrameMessage
public static boolean canFrameMessage(io.snice.buffer.Buffer buffer)
For stream based protocols, we may not get all the data at the same time and as such, we need to wait for more to arrive. This method simply checks if we have enough data in the buffer to fully frame theDiameterMessage
.- Parameters:
buffer
-- Returns:
-
frameHeader
public static DiameterHeader frameHeader(io.snice.buffer.ReadableBuffer buffer) throws DiameterParseException
- Throws:
DiameterParseException
-
couldBeDiameterMessage
public static boolean couldBeDiameterMessage(io.snice.buffer.ReadableBuffer buffer) throws IOException
Convenience method for checking if this could indeed by aDiameterMessage
. Use this when you just want to check and not handle theDiameterParseException
that would be thrown as a result of this not being a diameter message.TODO: may actually need a more specific ensure exception because right now, you don't konw if it "blew" up because it is not a diameter message or because there is a "real" ensure exception.
- Parameters:
buffer
-- Returns:
- Throws:
IOException
-
frameRawAvp
public static FramedAvp frameRawAvp(io.snice.buffer.ReadableBuffer buffer) throws DiameterParseException
- Throws:
DiameterParseException
-
frameAvpHeader
public static AvpHeader frameAvpHeader(io.snice.buffer.ReadableBuffer buffer) throws DiameterParseException
- Throws:
DiameterParseException
-
-