org.jdiameter.client.api.fsm
Interface IContext

All Known Implementing Classes:
PeerImpl.ActionContext, PeerImpl.LocalActionConext

public interface IContext

This interface describe operations of FSM context object


Method Summary
 void connect()
          Start connection procedure to remote peer
 void disconnect()
          Start disconnect procedure from remote peer
 java.lang.String getPeerDescription()
          Return parent peer description
 boolean isConnected()
          Reeturn true if connection already created and connected
 boolean isRestoreConnection()
          Return true if connection should be restored Look AttemptToConnect property of peer
 boolean processCeaMessage(java.lang.String key, IMessage message)
          This method allow sent CEA command to remote peer
 int processCerMessage(java.lang.String key, IMessage message)
          This method allow processed CER command from remote peer
 boolean receiveMessage(IMessage iMessage)
          This method allow processed message from to remote peer
 void sendCeaMessage(int resultCode, org.jdiameter.api.Message cer, java.lang.String errMessage)
          This method allow sent CEA command to remote peer
 void sendCerMessage()
          This method allow sent CER command to remote peer
 void sendDpaMessage(IMessage dpr, int resultCode, java.lang.String errorMessage)
          This method allow sent DPA command to remote peer
 void sendDprMessage(int disconnectCause)
          This method allow sent DPR command to remote peer
 void sendDwaMessage(IMessage dwr, int resultCode, java.lang.String errorMessage)
          This method allow sent DWA command to remote peer
 void sendDwrMessage()
          This method allow sent DWR command to remote peer
 boolean sendMessage(IMessage message)
          This method allow sent message to remote peer
 

Method Detail

connect

void connect()
             throws org.jdiameter.api.InternalException,
                    java.io.IOException,
                    org.jdiameter.api.IllegalDiameterStateException
Start connection procedure to remote peer

Throws:
org.jdiameter.api.InternalException
java.io.IOException
org.jdiameter.api.IllegalDiameterStateException

disconnect

void disconnect()
                throws org.jdiameter.api.InternalException,
                       org.jdiameter.api.IllegalDiameterStateException
Start disconnect procedure from remote peer

Throws:
org.jdiameter.api.InternalException
org.jdiameter.api.IllegalDiameterStateException

sendMessage

boolean sendMessage(IMessage message)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent message to remote peer

Parameters:
message - message which one should be sent to remote peer
Throws:
TransportException
org.jdiameter.api.OverloadException

sendCerMessage

void sendCerMessage()
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent CER command to remote peer

Throws:
TransportException
org.jdiameter.api.OverloadException

sendCeaMessage

void sendCeaMessage(int resultCode,
                    org.jdiameter.api.Message cer,
                    java.lang.String errMessage)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent CEA command to remote peer

Parameters:
resultCode - value for result-code Avp
errMessage - value for error-message Avp
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDwrMessage

void sendDwrMessage()
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent DWR command to remote peer

Throws:
TransportException
org.jdiameter.api.OverloadException

sendDwaMessage

void sendDwaMessage(IMessage dwr,
                    int resultCode,
                    java.lang.String errorMessage)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent DWA command to remote peer

Parameters:
dwr - parent DWR command receved from remote peer
resultCode - value for result-code avp
errorMessage - value for error-message avp
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDprMessage

void sendDprMessage(int disconnectCause)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent DPR command to remote peer

Parameters:
disconnectCause - value for disconnect-cause avp
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDpaMessage

void sendDpaMessage(IMessage dpr,
                    int resultCode,
                    java.lang.String errorMessage)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
This method allow sent DPA command to remote peer

Parameters:
dpr - parent DPR command receved from remote peer
resultCode - value for result-code avp
errorMessage - value for error-message avp
Throws:
TransportException
org.jdiameter.api.OverloadException

receiveMessage

boolean receiveMessage(IMessage iMessage)
This method allow processed message from to remote peer

Parameters:
iMessage - message from remote peer
Returns:
true if message correct processed

processCeaMessage

boolean processCeaMessage(java.lang.String key,
                          IMessage message)
This method allow sent CEA command to remote peer

Parameters:
key - connection key (host + ":" + port)
message -
Returns:
true if the message is sent to remote peer

processCerMessage

int processCerMessage(java.lang.String key,
                      IMessage message)
This method allow processed CER command from remote peer

Parameters:
key - connection key (host + ":" + port)
message - received from remote host
Returns:
result-code for CEA message or -1 if message can not be processed

isRestoreConnection

boolean isRestoreConnection()
Return true if connection should be restored Look AttemptToConnect property of peer

Returns:
true if connection should be restored

isConnected

boolean isConnected()
Reeturn true if connection already created and connected

Returns:
true if connection already created and connected

getPeerDescription

java.lang.String getPeerDescription()
Return parent peer description

Returns:
parent peer description


Copyright © 2008. All Rights Reserved.