org.mitre.jsip
Class SipRequestMessage

java.lang.Object
  |
  +--org.mitre.jsip.SipMessage
        |
        +--org.mitre.jsip.SipRequestMessage
Direct Known Subclasses:
AckMessage, ByeMessage, CancelMessage, InviteMessage, MessageMessage, NotifyMessage, OptionsMessage, RegisterMessage, SubscribeMessage, UnsupportedMessage

public abstract class SipRequestMessage
extends SipMessage


Fields inherited from class org.mitre.jsip.SipMessage
BadType, Request, Response
 
Method Summary
 void cancel()
          cancel this message
static java.lang.String createCallId()
          Static method to create a new SIP Call ID.
static SipRequestMessage createRequestMessage(int mtype)
          Main method for getting an instance of a Request Message
static SipRequestMessage createRequestMessage(java.lang.String inputMessage)
           
 int getMethod()
          Returns the method of this SIP request.
 SipUri getRequestUri()
          Returns the request URI for this message.
 java.util.Date getTimestamp()
          Returns the timestamp of the last transmission.
abstract  void handleCallRequest(SipClient client)
          message specific logic for a request cooresponding to a call.
abstract  boolean handleNewRequest(SipClient client)
          message specific logic for a new request message.
 void incrSendCount()
          Increments the retransmission counter.
 int lastTimeTick()
          Returns the last time tick.
 int sendCount()
          Returns the current value of the retransmission counter for this message.
 void setRequestUri(SipUri newrequri)
          Returns the type of this SIP request
 void setTimestamp()
          Recalculates the timestamp on the message.
 void setTimeTick(int newtt)
          Sets the current time tick.
 
Methods inherited from class org.mitre.jsip.SipMessage
addContact, createMessage, getContactList, getContentLength, getCSeqMethod, getHeaderData, getRecordRoute, getSendToAddress, getType, getViaList, hasHeader, hasSendToAddress, haveBody, insertHeader, message, messageBody, setBody, setContactList, setRecordRoute, setSendToAddress, setViaList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCallId

public static java.lang.String createCallId()
Static method to create a new SIP Call ID.
Returns:
String

createRequestMessage

public static SipRequestMessage createRequestMessage(java.lang.String inputMessage)

createRequestMessage

public static SipRequestMessage createRequestMessage(int mtype)
Main method for getting an instance of a Request Message
Parameters:
type - The type of message to create
Returns:
An instance of the message type

getMethod

public int getMethod()
Returns the method of this SIP request.
Returns:
method id as defined in org.mitre.jsip.Sip

setRequestUri

public void setRequestUri(SipUri newrequri)
Returns the type of this SIP request
Parameters:
newrequri -  
Returns:
message type id /** Sets the request URI for the message. This will also set the destination host and port for the message.

getRequestUri

public SipUri getRequestUri()
Returns the request URI for this message.
Returns:
SipUri

getTimestamp

public java.util.Date getTimestamp()
Returns the timestamp of the last transmission.
Returns:
timeval *

setTimestamp

public void setTimestamp()
Recalculates the timestamp on the message.

lastTimeTick

public int lastTimeTick()
Returns the last time tick.
Returns:
int

setTimeTick

public void setTimeTick(int newtt)
Sets the current time tick.
Parameters:
newtt -  

sendCount

public int sendCount()
Returns the current value of the retransmission counter for this message.
Returns:
int

incrSendCount

public void incrSendCount()
Increments the retransmission counter.

cancel

public void cancel()
cancel this message

handleNewRequest

public abstract boolean handleNewRequest(SipClient client)
message specific logic for a new request message. The boolean return will designate whether the message has been completely handled (true or not (false)

handleCallRequest

public abstract void handleCallRequest(SipClient client)
message specific logic for a request cooresponding to a call.