org.jdiameter.client.api.annotation
Interface IRecoder

All Known Implementing Classes:
Recoder

public interface IRecoder

This interface provide methods for create diameter messages from your annotated domain object and create domain object from diameter message.

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

Method Summary
<T> T
decode(Message message, java.lang.Class<T> yourDomainMessageObject)
          Create specified domain object by message and class of object
 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
 

Method Detail

encodeToRequest

Message encodeToRequest(java.lang.Object yourDomainMessageObject,
                        Avp... additionalAvp)
                        throws RecoderException
Create Request message from specified annotated domain object

Parameters:
yourDomainMessageObject - annotated domain object
additionalAvp - additional avp
Returns:
message instance
Throws:
RecoderException - throw if object can not be encoded to diameter message

encodeToAnswer

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

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

decode

<T> T decode(Message message,
             java.lang.Class<T> yourDomainMessageObject)
         throws RecoderException
Create specified domain object by message and class of object

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.