org.jdiameter.client.impl.annotation
Class Recoder

java.lang.Object
  extended by org.jdiameter.client.impl.annotation.Recoder
All Implemented Interfaces:
IRecoder

public class Recoder
extends java.lang.Object
implements IRecoder

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

Constructor Summary
Recoder(SessionFactory factory, MetaData metaData)
           
 
Method Summary
<T> T
decode(Message message, java.lang.Class<T> yourDomainMessageObject)
          Create specified domain object by message and class of object
 Message encode(java.lang.Object yourDomainMessageObject, Request request, long resultCode, Avp... addAvp)
           
 Message encodeToAnswer(java.lang.Object yourDomainMessageObject, Request request, long resultCode)
          Create Answer message from specified annotated domain object
 Message encodeToRequest(java.lang.Object yourDomainMessageObject, Avp... additionalAvp)
          Create Request message from specified annotated domain object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recoder

public Recoder(SessionFactory factory,
               MetaData metaData)
Method Detail

encodeToRequest

public Message encodeToRequest(java.lang.Object yourDomainMessageObject,
                               Avp... additionalAvp)
                        throws RecoderException
Description copied from interface: IRecoder
Create Request message from specified annotated domain object

Specified by:
encodeToRequest in interface IRecoder
Parameters:
yourDomainMessageObject - annotated domain object
additionalAvp - additional avp
Returns:
message instance
Throws:
RecoderException - throw if object can not be encoded to diameter message

encodeToAnswer

public Message encodeToAnswer(java.lang.Object yourDomainMessageObject,
                              Request request,
                              long resultCode)
                       throws RecoderException
Description copied from interface: IRecoder
Create Answer message from specified annotated domain object

Specified by:
encodeToAnswer in interface IRecoder
Parameters:
yourDomainMessageObject - annotated domain object
request - request message
resultCode - result code of answer
Returns:
message answer instance
Throws:
RecoderException - throw if object can not be encoded to diameter message

encode

public Message encode(java.lang.Object yourDomainMessageObject,
                      Request request,
                      long resultCode,
                      Avp... addAvp)
               throws RecoderException
Throws:
RecoderException

decode

public <T> T decode(Message message,
                    java.lang.Class<T> yourDomainMessageObject)
         throws RecoderException
Description copied from interface: IRecoder
Create specified domain object by message and class of object

Specified by:
decode in interface IRecoder
Parameters:
message - diameter message
yourDomainMessageObject - class of domain object
Returns:
instance of domain object
Throws:
RecoderException - throw if message can not be decoded to domain object


Copyright © 2014. All Rights Reserved.