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


Field Summary
protected  UIDGenerator endToEndGen
           
protected  java.util.logging.Logger logger
           
 
Constructor Summary
MessageParser(org.jdiameter.api.MetaData metaData)
           
 
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
 org.jdiameter.client.impl.parser.AvpSetImpl decodeAvpSet(byte[] message)
           
 byte[] encodeAvp(org.jdiameter.client.impl.parser.AvpImpl avp)
           
 byte[] encodeAvpSet(org.jdiameter.api.AvpSet avps)
           
 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, 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

logger

protected java.util.logging.Logger logger

endToEndGen

protected UIDGenerator endToEndGen
Constructor Detail

MessageParser

public MessageParser(org.jdiameter.api.MetaData metaData)
Method Detail

createMessage

public IMessage createMessage(java.nio.ByteBuffer data)
                       throws org.jdiameter.api.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:
org.jdiameter.api.AvpDataException

decodeAvpSet

public org.jdiameter.client.impl.parser.AvpSetImpl decodeAvpSet(byte[] message)
                                                         throws java.io.IOException
Throws:
java.io.IOException

createMessage

public <T> T createMessage(java.lang.Class<?> iface,
                           java.nio.ByteBuffer data)
                throws org.jdiameter.api.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:
org.jdiameter.api.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 DecodeException
Description copied from interface: IMessageParser
Encode message to ByteBuffer

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

encodeAvpSet

public byte[] encodeAvpSet(org.jdiameter.api.AvpSet avps)

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

encodeAvp

public byte[] encodeAvp(org.jdiameter.client.impl.parser.AvpImpl avp)

getNextEndToEndId

public int getNextEndToEndId()


Copyright © 2008. All Rights Reserved.