org.jdiameter.client.impl.parser
Class MessageParser

java.lang.Object
  extended by org.jdiameter.client.impl.parser.ElementParser
      extended by org.jdiameter.client.impl.parser.MessageParser
All Implemented Interfaces:
IElementParser, IMessageParser

public class MessageParser
extends ElementParser
implements IMessageParser

Author:
erick.svenson@yahoo.com, Alexandre Mendonca , Bartosz Baranowski

Field Summary
protected  UIDGenerator endToEndGen
           
 
Constructor Summary
MessageParser()
           
 
Method Summary
<T> T
createEmptyMessage(java.lang.Class<?> iface, IMessage parentMessage)
          Created new message with copied of header of parent message
<T> T
createEmptyMessage(java.lang.Class<?> iface, int commandCode, long headerAppId)
          Created specified type of message
 IMessage createEmptyMessage(IMessage prnMessage)
          Created new message with copied of header of parent message
 IMessage createEmptyMessage(IMessage prnMessage, int commandCode)
          Created new message with copied of header of parent message
 IMessage createEmptyMessage(int commandCode, long headerAppId)
          Created empty message
 IMessage createMessage(java.nio.ByteBuffer data)
          Create message from bytebuffer
<T> T
createMessage(java.lang.Class<?> iface, java.nio.ByteBuffer data)
          Created specified type of message
 java.nio.ByteBuffer encodeMessage(IMessage message)
          Encode message to ByteBuffer
 int getNextEndToEndId()
           
 
Methods inherited from class org.jdiameter.client.impl.parser.ElementParser
addressToBytes, bytesToAddress, bytesToDate, bytesToDouble, bytesToFloat, bytesToInt, bytesToLong, bytesToObject, bytesToOctetString, bytesToUtf8String, dateToBytes, decodeAvpSet, decodeAvpSet, encodeAvp, encodeAvpSet, float32ToBytes, float64ToBytes, int32ToBytes, int64ToBytes, intU32ToBytes, objectToBytes, octetStringToBytes, prepareBuffer, utf8StringToBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endToEndGen

protected UIDGenerator endToEndGen
Constructor Detail

MessageParser

public MessageParser()
Method Detail

createMessage

public IMessage createMessage(java.nio.ByteBuffer data)
                       throws AvpDataException
Description copied from interface: IMessageParser
Create message from bytebuffer

Specified by:
createMessage in interface IMessageParser
Parameters:
data - message bytebuffer
Returns:
instance of message
Throws:
AvpDataException

createMessage

public <T> T createMessage(java.lang.Class<?> iface,
                           java.nio.ByteBuffer data)
                throws AvpDataException
Description copied from interface: IMessageParser
Created specified type of message

Specified by:
createMessage in interface IMessageParser
Parameters:
iface - type of message
data - message bytebuffer
Returns:
instance of message
Throws:
AvpDataException

createEmptyMessage

public <T> T createEmptyMessage(java.lang.Class<?> iface,
                                IMessage parentMessage)
Description copied from interface: IMessageParser
Created new message with copied of header of parent message

Specified by:
createEmptyMessage in interface IMessageParser
Parameters:
iface - type of message
parentMessage - parent message
Returns:
instance of message

createEmptyMessage

public IMessage createEmptyMessage(IMessage prnMessage)
Description copied from interface: IMessageParser
Created new message with copied of header of parent message

Specified by:
createEmptyMessage in interface IMessageParser
Parameters:
prnMessage - parent message
Returns:
instance of message

createEmptyMessage

public IMessage createEmptyMessage(IMessage prnMessage,
                                   int commandCode)
Description copied from interface: IMessageParser
Created new message with copied of header of parent message

Specified by:
createEmptyMessage in interface IMessageParser
Parameters:
prnMessage - parent message
commandCode - new command code value
Returns:
instance of message

encodeMessage

public java.nio.ByteBuffer encodeMessage(IMessage message)
                                  throws ParseException
Description copied from interface: IMessageParser
Encode message to ByteBuffer

Specified by:
encodeMessage in interface IMessageParser
Parameters:
message - diameter message
Returns:
instance of message
Throws:
ParseException

createEmptyMessage

public IMessage createEmptyMessage(int commandCode,
                                   long headerAppId)
Description copied from interface: IMessageParser
Created empty message

Specified by:
createEmptyMessage in interface IMessageParser
Parameters:
commandCode - message command code
headerAppId - header applicatio id
Returns:
instance of message

createEmptyMessage

public <T> T createEmptyMessage(java.lang.Class<?> iface,
                                int commandCode,
                                long headerAppId)
Description copied from interface: IMessageParser
Created specified type of message

Specified by:
createEmptyMessage in interface IMessageParser
Parameters:
iface - type of message
commandCode - message command code
headerAppId - header applicatio id
Returns:
instance of message

getNextEndToEndId

public int getNextEndToEndId()


Copyright © 2014. All Rights Reserved.