org.lastbamboo.common.sip.stack.message
Class AbstractSipMessage

java.lang.Object
  extended by org.lastbamboo.common.sip.stack.message.AbstractSipMessage
All Implemented Interfaces:
org.lastbamboo.common.offer.answer.OfferAnswerMessage, SipMessage
Direct Known Subclasses:
Invite, Register, SipResponse, UnknownSipRequest

public abstract class AbstractSipMessage
extends Object
implements SipMessage

Abstracts out generalized functions common to all SIP messages.


Constructor Summary
AbstractSipMessage(int statusCode, String reasonPhrase, Map<String,SipHeader> headers)
           
AbstractSipMessage(int statusCode, String reasonPhrase, Map<String,SipHeader> headers, org.littleshoot.mina.common.ByteBuffer body)
           
AbstractSipMessage(SipMethod method, URI requestUri, Map<String,SipHeader> headers)
           
AbstractSipMessage(SipMethod method, URI requestUri, Map<String,SipHeader> headers, org.littleshoot.mina.common.ByteBuffer body)
           
AbstractSipMessage(String startLine, SipMethod method, Map<String,SipHeader> headers, org.littleshoot.mina.common.ByteBuffer body)
          Creates a new SIP message with the specified first line of the message, the specified headers, and the specified message body.
 
Method Summary
protected static String createRequestLine(String method, URI requestUri)
           
 org.littleshoot.mina.common.ByteBuffer getBody()
          Accessor for the message body.
 String getBranchId()
          Accessor for the branch ID for the topmost Via header of this message.
 SipHeader getHeader(String headerName)
          Accessor for the complete header with the specified name.
 Map<String,SipHeader> getHeaders()
          Accessor for all headers in the message.
 byte[] getKey()
           
 SipMethod getMethod()
          The method the SIP message, such as "INVITE" or "REGISTER".
 List<SipHeaderValue> getRouteSet()
          Accessor for the list of routes for this message.
 String getStartLine()
          Accessor the first line of the message.
 String getTransactionKey()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.lastbamboo.common.sip.stack.message.SipMessage
accept
 

Constructor Detail

AbstractSipMessage

public AbstractSipMessage(String startLine,
                          SipMethod method,
                          Map<String,SipHeader> headers,
                          org.littleshoot.mina.common.ByteBuffer body)
Creates a new SIP message with the specified first line of the message, the specified headers, and the specified message body.

Parameters:
startLine - The first line of the message.
headers - The message headers.
body - The message body.

AbstractSipMessage

public AbstractSipMessage(SipMethod method,
                          URI requestUri,
                          Map<String,SipHeader> headers)

AbstractSipMessage

public AbstractSipMessage(SipMethod method,
                          URI requestUri,
                          Map<String,SipHeader> headers,
                          org.littleshoot.mina.common.ByteBuffer body)

AbstractSipMessage

public AbstractSipMessage(int statusCode,
                          String reasonPhrase,
                          Map<String,SipHeader> headers,
                          org.littleshoot.mina.common.ByteBuffer body)

AbstractSipMessage

public AbstractSipMessage(int statusCode,
                          String reasonPhrase,
                          Map<String,SipHeader> headers)
Method Detail

createRequestLine

protected static String createRequestLine(String method,
                                          URI requestUri)

getHeader

public SipHeader getHeader(String headerName)
Description copied from interface: SipMessage
Accessor for the complete header with the specified name.

Specified by:
getHeader in interface SipMessage
Parameters:
headerName - The name of the header to access.
Returns:
The complete header instance.

getHeaders

public Map<String,SipHeader> getHeaders()
Description copied from interface: SipMessage
Accessor for all headers in the message.

Specified by:
getHeaders in interface SipMessage
Returns:
All headers in the message.

getBody

public org.littleshoot.mina.common.ByteBuffer getBody()
Description copied from interface: SipMessage
Accessor for the message body.

Specified by:
getBody in interface org.lastbamboo.common.offer.answer.OfferAnswerMessage
Specified by:
getBody in interface SipMessage
Returns:
The message body.

getBranchId

public final String getBranchId()
Description copied from interface: SipMessage
Accessor for the branch ID for the topmost Via header of this message.

Specified by:
getBranchId in interface SipMessage
Returns:
The branch ID for this message from the topmost Via header.

getMethod

public final SipMethod getMethod()
Description copied from interface: SipMessage
The method the SIP message, such as "INVITE" or "REGISTER".

Specified by:
getMethod in interface SipMessage
Returns:
The method of the message.

getRouteSet

public List<SipHeaderValue> getRouteSet()
Description copied from interface: SipMessage
Accessor for the list of routes for this message.

Specified by:
getRouteSet in interface SipMessage
Returns:
The list of routes for this message.

getStartLine

public String getStartLine()
Description copied from interface: SipMessage
Accessor the first line of the message. For requests, this is the request line containing the request URI. For responses, this is the status line.

Specified by:
getStartLine in interface SipMessage
Returns:
The first line of the message, as in the request line for requests and the status line for responses.

getTransactionKey

public String getTransactionKey()
Specified by:
getTransactionKey in interface org.lastbamboo.common.offer.answer.OfferAnswerMessage

toString

public String toString()
Overrides:
toString in class Object

getKey

public byte[] getKey()


Copyright © 2013 LittleShoot. All Rights Reserved.