local.ua
Class MessageAgent

java.lang.Object
  |
  +--local.ua.MessageAgent
All Implemented Interfaces:
org.zoolu.sip.provider.SipInterfaceListener, org.zoolu.sip.transaction.TransactionClientListener

public class MessageAgent
extends java.lang.Object
implements org.zoolu.sip.provider.SipInterfaceListener, org.zoolu.sip.transaction.TransactionClientListener

Simple Message Agent (MA). It allows a user to send and receive short messages.


Field Summary
protected  MessageAgentListener listener
          Message listener
protected  org.zoolu.tools.Log log
          Event logger.
protected  org.zoolu.sip.provider.SipInterface sip_interface
          SipInterface to message MESSAGE.
protected  org.zoolu.sip.provider.SipProvider sip_provider
          SipProvider
protected  UserAgentProfile user_profile
          UserProfile
 
Constructor Summary
MessageAgent(org.zoolu.sip.provider.SipProvider sip_provider, UserAgentProfile user_profile, MessageAgentListener listener)
          Costructs a new MessageAgent.
 
Method Summary
 void halt()
          Stops receiving messages.
 void onReceivedMessage(org.zoolu.sip.provider.SipInterface sip, org.zoolu.sip.message.Message msg)
          When a new Message is received by the SipInterface.
 void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient tc, org.zoolu.sip.message.Message resp)
          When the TransactionClient goes into the "Completed" state receiving a 300-699 response
 void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient tc, org.zoolu.sip.message.Message resp)
          When the TransactionClient is (or goes) in "Proceeding" state and receives a new 1xx provisional response
 void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient tc, org.zoolu.sip.message.Message resp)
          When the TransactionClient goes into the "Completed" state receiving a 2xx response
 void onTransTimeout(org.zoolu.sip.transaction.TransactionClient tc)
          When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
 void receive()
          Waits for incoming message.
 void send(java.lang.String recipient, java.lang.String subject, java.lang.String content)
          Sends a new text message.
 void send(java.lang.String recipient, java.lang.String subject, java.lang.String content_type, java.lang.String content)
          Sends a new message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.zoolu.tools.Log log
Event logger.

user_profile

protected UserAgentProfile user_profile
UserProfile

sip_provider

protected org.zoolu.sip.provider.SipProvider sip_provider
SipProvider

sip_interface

protected org.zoolu.sip.provider.SipInterface sip_interface
SipInterface to message MESSAGE.

listener

protected MessageAgentListener listener
Message listener
Constructor Detail

MessageAgent

public MessageAgent(org.zoolu.sip.provider.SipProvider sip_provider,
                    UserAgentProfile user_profile,
                    MessageAgentListener listener)
Costructs a new MessageAgent.
Method Detail

send

public void send(java.lang.String recipient,
                 java.lang.String subject,
                 java.lang.String content)
Sends a new text message.

send

public void send(java.lang.String recipient,
                 java.lang.String subject,
                 java.lang.String content_type,
                 java.lang.String content)
Sends a new message.

receive

public void receive()
Waits for incoming message.

halt

public void halt()
Stops receiving messages.

onReceivedMessage

public void onReceivedMessage(org.zoolu.sip.provider.SipInterface sip,
                              org.zoolu.sip.message.Message msg)
When a new Message is received by the SipInterface.
Specified by:
onReceivedMessage in interface org.zoolu.sip.provider.SipInterfaceListener

onTransSuccessResponse

public void onTransSuccessResponse(org.zoolu.sip.transaction.TransactionClient tc,
                                   org.zoolu.sip.message.Message resp)
When the TransactionClient goes into the "Completed" state receiving a 2xx response
Specified by:
onTransSuccessResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransFailureResponse

public void onTransFailureResponse(org.zoolu.sip.transaction.TransactionClient tc,
                                   org.zoolu.sip.message.Message resp)
When the TransactionClient goes into the "Completed" state receiving a 300-699 response
Specified by:
onTransFailureResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransProvisionalResponse

public void onTransProvisionalResponse(org.zoolu.sip.transaction.TransactionClient tc,
                                       org.zoolu.sip.message.Message resp)
When the TransactionClient is (or goes) in "Proceeding" state and receives a new 1xx provisional response
Specified by:
onTransProvisionalResponse in interface org.zoolu.sip.transaction.TransactionClientListener

onTransTimeout

public void onTransTimeout(org.zoolu.sip.transaction.TransactionClient tc)
When the TransactionClient goes into the "Terminated" state, caused by transaction timeout
Specified by:
onTransTimeout in interface org.zoolu.sip.transaction.TransactionClientListener