edu.columbia.cs.irt.rfidentify.presence
Class SipLayer

java.lang.Object
  extended by edu.columbia.cs.irt.rfidentify.presence.SipLayer
All Implemented Interfaces:
java.util.EventListener, javax.sip.SipListener

public class SipLayer
extends java.lang.Object
implements javax.sip.SipListener


Constructor Summary
SipLayer(java.lang.String ip, int port)
          initialize the SIP stack.
 
Method Summary
 java.lang.String getHost()
           
 int getPort()
           
 java.lang.String getUsername()
           
 void processDialogTerminated(javax.sip.DialogTerminatedEvent evt)
          This method is called by the SIP stack when a dialog (session) ends.
 void processIOException(javax.sip.IOExceptionEvent evt)
          This method is called by the SIP stack when there's an asynchronous message transmission error.
 void processRequest(javax.sip.RequestEvent evt)
          This method is called by the SIP stack when a new request arrives.
 void processResponse(javax.sip.ResponseEvent evt)
          This method is called by the SIP stack when a response arrives.
 void processTimeout(javax.sip.TimeoutEvent evt)
          This method is called by the SIP stack when there's no answer to a message.
 void processTransactionTerminated(javax.sip.TransactionTerminatedEvent evt)
          This method is called by the SIP stack when a transaction ends.
 void sendMessage(java.lang.String sender, java.lang.String to, java.lang.String message)
          This method uses the SIP stack to send a message.
 void setMainThread(java.lang.Thread thread)
           
 void setUsername(java.lang.String newUsername)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SipLayer

public SipLayer(java.lang.String ip,
                int port)
         throws javax.sip.PeerUnavailableException,
                javax.sip.TransportNotSupportedException,
                javax.sip.InvalidArgumentException,
                javax.sip.ObjectInUseException,
                java.util.TooManyListenersException
initialize the SIP stack.

Throws:
javax.sip.PeerUnavailableException
javax.sip.TransportNotSupportedException
javax.sip.InvalidArgumentException
javax.sip.ObjectInUseException
java.util.TooManyListenersException
Method Detail

sendMessage

public void sendMessage(java.lang.String sender,
                        java.lang.String to,
                        java.lang.String message)
                 throws java.text.ParseException,
                        javax.sip.InvalidArgumentException,
                        javax.sip.SipException
This method uses the SIP stack to send a message.

Throws:
java.text.ParseException
javax.sip.InvalidArgumentException
javax.sip.SipException

processResponse

public void processResponse(javax.sip.ResponseEvent evt)
This method is called by the SIP stack when a response arrives.

Specified by:
processResponse in interface javax.sip.SipListener

processRequest

public void processRequest(javax.sip.RequestEvent evt)
This method is called by the SIP stack when a new request arrives.

Specified by:
processRequest in interface javax.sip.SipListener

processTimeout

public void processTimeout(javax.sip.TimeoutEvent evt)
This method is called by the SIP stack when there's no answer to a message. Note that this is treated differently from an error message.

Specified by:
processTimeout in interface javax.sip.SipListener

processIOException

public void processIOException(javax.sip.IOExceptionEvent evt)
This method is called by the SIP stack when there's an asynchronous message transmission error.

Specified by:
processIOException in interface javax.sip.SipListener

processDialogTerminated

public void processDialogTerminated(javax.sip.DialogTerminatedEvent evt)
This method is called by the SIP stack when a dialog (session) ends.

Specified by:
processDialogTerminated in interface javax.sip.SipListener

processTransactionTerminated

public void processTransactionTerminated(javax.sip.TransactionTerminatedEvent evt)
This method is called by the SIP stack when a transaction ends.

Specified by:
processTransactionTerminated in interface javax.sip.SipListener

getHost

public java.lang.String getHost()

getPort

public int getPort()

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String newUsername)

setMainThread

public void setMainThread(java.lang.Thread thread)