org.jdiameter.client.impl.controller
Class PeerImpl.ActionContext

java.lang.Object
  extended by org.jdiameter.client.impl.controller.PeerImpl.ActionContext
All Implemented Interfaces:
IContext
Direct Known Subclasses:
PeerImpl.LocalActionConext
Enclosing class:
PeerImpl

protected class PeerImpl.ActionContext
extends java.lang.Object
implements IContext


Constructor Summary
protected PeerImpl.ActionContext()
           
 
Method Summary
protected  void addAppId(org.jdiameter.api.ApplicationId appId, IMessage message)
           
 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 message)
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerImpl.ActionContext

protected PeerImpl.ActionContext()
Method Detail

connect

public void connect()
             throws org.jdiameter.api.InternalException,
                    java.io.IOException,
                    org.jdiameter.api.IllegalDiameterStateException
Description copied from interface: IContext
Start connection procedure to remote peer

Specified by:
connect in interface IContext
Throws:
org.jdiameter.api.InternalException
java.io.IOException
org.jdiameter.api.IllegalDiameterStateException

disconnect

public void disconnect()
                throws org.jdiameter.api.InternalException,
                       org.jdiameter.api.IllegalDiameterStateException
Description copied from interface: IContext
Start disconnect procedure from remote peer

Specified by:
disconnect in interface IContext
Throws:
org.jdiameter.api.InternalException
org.jdiameter.api.IllegalDiameterStateException

getPeerDescription

public java.lang.String getPeerDescription()
Description copied from interface: IContext
Return parent peer description

Specified by:
getPeerDescription in interface IContext
Returns:
parent peer description

isConnected

public boolean isConnected()
Description copied from interface: IContext
Reeturn true if connection already created and connected

Specified by:
isConnected in interface IContext
Returns:
true if connection already created and connected

sendMessage

public boolean sendMessage(IMessage message)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
Description copied from interface: IContext
This method allow sent message to remote peer

Specified by:
sendMessage in interface IContext
Parameters:
message - message which one should be sent to remote peer
Throws:
TransportException
org.jdiameter.api.OverloadException

sendCerMessage

public void sendCerMessage()
                    throws TransportException,
                           org.jdiameter.api.OverloadException
Description copied from interface: IContext
This method allow sent CER command to remote peer

Specified by:
sendCerMessage in interface IContext
Throws:
TransportException
org.jdiameter.api.OverloadException

sendCeaMessage

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

Specified by:
sendCeaMessage in interface IContext
Parameters:
resultCode - value for result-code Avp
errMessage - value for error-message Avp
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDwrMessage

public void sendDwrMessage()
                    throws TransportException,
                           org.jdiameter.api.OverloadException
Description copied from interface: IContext
This method allow sent DWR command to remote peer

Specified by:
sendDwrMessage in interface IContext
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDwaMessage

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

Specified by:
sendDwaMessage in interface IContext
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

isRestoreConnection

public boolean isRestoreConnection()
Description copied from interface: IContext
Return true if connection should be restored Look AttemptToConnect property of peer

Specified by:
isRestoreConnection in interface IContext
Returns:
true if connection should be restored

sendDprMessage

public void sendDprMessage(int disconnectCause)
                    throws TransportException,
                           org.jdiameter.api.OverloadException
Description copied from interface: IContext
This method allow sent DPR command to remote peer

Specified by:
sendDprMessage in interface IContext
Parameters:
disconnectCause - value for disconnect-cause avp
Throws:
TransportException
org.jdiameter.api.OverloadException

sendDpaMessage

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

Specified by:
sendDpaMessage in interface IContext
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

processCerMessage

public int processCerMessage(java.lang.String key,
                             IMessage message)
Description copied from interface: IContext
This method allow processed CER command from remote peer

Specified by:
processCerMessage in interface IContext
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

processCeaMessage

public boolean processCeaMessage(java.lang.String key,
                                 IMessage message)
Description copied from interface: IContext
This method allow sent CEA command to remote peer

Specified by:
processCeaMessage in interface IContext
Parameters:
key - connection key (host + ":" + port)
Returns:
true if the message is sent to remote peer

receiveMessage

public boolean receiveMessage(IMessage message)
Description copied from interface: IContext
This method allow processed message from to remote peer

Specified by:
receiveMessage in interface IContext
Parameters:
message - message from remote peer
Returns:
true if message correct processed

addAppId

protected void addAppId(org.jdiameter.api.ApplicationId appId,
                        IMessage message)


Copyright © 2008. All Rights Reserved.