NIST SIP Parser and Stack (v1.2) API

javax.sip.message
Interface MessageFactory


public interface MessageFactory

This interface provides factory methods that allow an application to create Request and Response messages from a particular implementation of JAIN SIP. This class is a singleton and can be retrieved from the SipFactory.createMessageFactory().

Version:
1.1
Author:
Sun Microsystems

Method Summary
 Request createByeRequest(Request request, boolean isServer)
          Creates a new BYE Request message based on the dialog creating request specified by the request paramater (for example, INVITE).
 Request createCancelRequest(Request request)
          Creates a new CANCEL Request message based on the dialog creating request specified by the request paramater (for example, INVITE).
 Request createRequest(URI requestURI, String method, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards)
          Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message.
 Request createRequest(URI requestURI, String method, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, byte[] content)
          Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message with a body in the form of a byte array and body content type.
 Request createRequest(URI requestURI, String method, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content)
          Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message with a body in the form of a Java object and the body content type.
 Response createResponse(int statusCode, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards)
          Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message.
 Response createResponse(int statusCode, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, byte[] content)
          Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message with a body in the form of a byte array and the body content type.
 Response createResponse(int statusCode, CallIdHeader callId, CSeqHeader cSeq, FromHeader from, ToHeader to, List via, MaxForwardsHeader maxForwards, ContentTypeHeader contentType, Object content)
          Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message with a body in the form of a Java object and the body content type.
 Response createResponse(int statusCode, Request request)
          Creates a new Response message of type specified by the statusCode paramater, based on a specific Request message.
 Response createResponse(int statusCode, Request request, ContentTypeHeader contentType, byte[] content)
          Creates a new Response message of type specified by the statusCode paramater, based on a specific Request with a new body in the form of a byte array and the body content type.
 Response createResponse(int statusCode, Request request, ContentTypeHeader contentType, Object content)
          Creates a new Response message of type specified by the statusCode paramater, based on a specific Request with a new body in the form of a Java object and the body content type.
 

Method Detail

createRequest

public Request createRequest(URI requestURI,
                             String method,
                             CallIdHeader callId,
                             CSeqHeader cSeq,
                             FromHeader from,
                             ToHeader to,
                             List via,
                             MaxForwardsHeader maxForwards,
                             ContentTypeHeader contentType,
                             Object content)
                      throws ParseException
Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message with a body in the form of a Java object and the body content type.

Parameters:
requestURI - the new URI object of the requestURI value of this Message.
method - the new string of the method value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new Object of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method or the body.

createRequest

public Request createRequest(URI requestURI,
                             String method,
                             CallIdHeader callId,
                             CSeqHeader cSeq,
                             FromHeader from,
                             ToHeader to,
                             List via,
                             MaxForwardsHeader maxForwards,
                             ContentTypeHeader contentType,
                             byte[] content)
                      throws ParseException
Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message with a body in the form of a byte array and body content type.

Parameters:
requestURI - the new URI object of the requestURI value of this Message.
method - the new string of the method value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new byte array of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method or the body.

createRequest

public Request createRequest(URI requestURI,
                             String method,
                             CallIdHeader callId,
                             CSeqHeader cSeq,
                             FromHeader from,
                             ToHeader to,
                             List via,
                             MaxForwardsHeader maxForwards)
                      throws ParseException
Creates a new Request message of type specified by the method paramater, containing the URI of the Request, the mandatory headers of the message. This new Request does not contain a body.

Parameters:
requestURI - the new URI object of the requestURI value of this Message.
method - the new string of the method value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the method.

createByeRequest

public Request createByeRequest(Request request,
                                boolean isServer)
Creates a new BYE Request message based on the dialog creating request specified by the request paramater (for example, INVITE).

Parameters:
request - the dialog creating request, the dialog of which this BYE will terminate.
isServer - the boolean that determines if the dialog request was a client or server initiated request.

createCancelRequest

public Request createCancelRequest(Request request)
Creates a new CANCEL Request message based on the dialog creating request specified by the request paramater (for example, INVITE). The CANCEL request, is used to cancel a previous request sent by a client. Specifically, it asks the UAS to cease processing the request and to generate an error response to that request. A CANCEL request constitutes its own transaction, but also references the transaction to be cancelled. CANCEL has no effect on a request to which a UAS has already given a final response.

Note that both the transaction corresponding to the original request and the CANCEL transaction will complete independently. However, a UAC canceling a request cannot rely on receiving a 487 (Request Terminated) response for the original request, as an RFC 2543 compliant UAS will not generate such a response. Therefore if there is no final response for the original request the application will receieve a TimeoutEvent with Timeout.TRANSACTION and the client should then consider the original transaction cancelled.

Parameters:
request - the dialog creating request, the dialog of which this CANCEL will terminate.

createResponse

public Response createResponse(int statusCode,
                               CallIdHeader callId,
                               CSeqHeader cSeq,
                               FromHeader from,
                               ToHeader to,
                               List via,
                               MaxForwardsHeader maxForwards,
                               ContentTypeHeader contentType,
                               Object content)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message with a body in the form of a Java object and the body content type.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new Object of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode or the body.

createResponse

public Response createResponse(int statusCode,
                               CallIdHeader callId,
                               CSeqHeader cSeq,
                               FromHeader from,
                               ToHeader to,
                               List via,
                               MaxForwardsHeader maxForwards,
                               ContentTypeHeader contentType,
                               byte[] content)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message with a body in the form of a byte array and the body content type.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new byte array of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode or the body.

createResponse

public Response createResponse(int statusCode,
                               CallIdHeader callId,
                               CSeqHeader cSeq,
                               FromHeader from,
                               ToHeader to,
                               List via,
                               MaxForwardsHeader maxForwards)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message. This new Response does not contain a body.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
callId - the new CallIdHeader object of the callId value of this Message.
cSeq - the new CSeqHeader object of the cSeq value of this Message.
from - the new FromHeader object of the from value of this Message.
to - the new ToHeader object of the to value of this Message.
via - the new List object of the ViaHeaders of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode.

createResponse

public Response createResponse(int statusCode,
                               Request request,
                               ContentTypeHeader contentType,
                               Object content)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, based on a specific Request with a new body in the form of a Java object and the body content type.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
request - the received Reqest object upon which to base the Response.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new Object of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode or the body.

createResponse

public Response createResponse(int statusCode,
                               Request request,
                               ContentTypeHeader contentType,
                               byte[] content)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, based on a specific Request with a new body in the form of a byte array and the body content type.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
request - the received Reqest object upon which to base the Response.
contentType - the new ContentTypeHeader object of the content type value of this Message.
content - the new byte array of the body content value of this Message.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode or the body.

createResponse

public Response createResponse(int statusCode,
                               Request request)
                        throws ParseException
Creates a new Response message of type specified by the statusCode paramater, based on a specific Request message. This new Response does not contain a body.

Parameters:
statusCode - the new integer of the statusCode value of this Message.
request - the received Reqest object upon which to base the Response.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the statusCode.

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.