|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.core.GenericObject
gov.nist.javax.sip.message.MessageObject
gov.nist.javax.sip.message.SIPMessage
gov.nist.javax.sip.message.SIPRequest
public class SIPRequest
The SIP Request structure.
| Constructor Summary | |
|---|---|
SIPRequest()
Constructor. |
|
| Method Summary | |
|---|---|
void |
checkHeaders()
Check header for constraints. (1) Invite options and bye requests can only have SIP URIs in the contact headers. (2) Request must have cseq, to and from and via headers. (3) Method in request URI must match that in CSEQ. |
void |
cleanUp()
|
Object |
clone()
Make a clone (deep copy) of this object. |
SIPRequest |
createAckRequest(To responseToHeader)
Creates a default ACK SIPRequest message for this original request. |
SIPRequest |
createCancelRequest()
Creates a default SIPResquest message that would cancel this request. |
SIPRequest |
createErrorAck(To responseToHeader)
Creates an ACK for non-2xx responses according to RFC3261 17.1.1.3 |
SIPResponse |
createResponse(int statusCode)
Creates a default SIPResponse message for this request. |
SIPResponse |
createResponse(int statusCode,
String reasonPhrase)
Creates a default SIPResponse message for this request. |
String |
debugDump()
Convert to a formatted string for pretty printing. |
String |
encode()
Encode the SIP Request as a string. |
byte[] |
encodeAsBytes(String transport)
Encode this into a byte array. |
StringBuilder |
encodeMessage(StringBuilder retval)
Encode only the headers and not the content. |
boolean |
equals(Object other)
Compare for equality. |
static String |
getCannonicalName(String method)
Set to standard constants to speed up processing. this makes equals comparisons run much faster in the stack because then it is just identity comparision. |
String |
getFirstLine()
Get the first line encoded. |
Object |
getInviteTransaction()
|
String |
getMergeId()
Generates an Id for checking potentially merged requests. |
LinkedList |
getMessageAsEncodedStrings()
Get the message as a linked list of strings. |
Object |
getMessageChannel()
Book keeping method to get the messasge channel for the request. |
String |
getMethod()
Get the method from the request line. |
RequestLine |
getRequestLine()
Get the Request Line of the SIPRequest. |
URI |
getRequestURI()
A conveniance function to access the Request URI. |
String |
getSIPVersion()
Get the SIP version. |
Object |
getTransaction()
Book keeping method to return the current tx for the request if one exists. |
String |
getViaHost()
Get the host from the topmost via header. |
int |
getViaPort()
Get the port from the topmost via header. |
static boolean |
isDialogCreating(String ucaseMethod)
|
static boolean |
isTargetRefresh(String ucaseMethod)
|
boolean |
match(Object matchObj)
Match with a template. |
void |
setInviteTransaction(Object inviteTransaction)
|
void |
setMessageChannel(Object messageChannel)
Set the message channel for the request ( bookkeeping field ). |
void |
setMethod(String method)
Set the method. |
void |
setRequestLine(RequestLine requestLine)
Set the request line of the SIP Request. |
void |
setRequestURI(URI uri)
Sets the RequestURI of Request. |
void |
setSIPVersion(String sipVersion)
Set the sip version. |
void |
setTransaction(Object transaction)
Book keeping field to set the current tx for the request. |
String |
toString()
ALias for encode above. |
| Methods inherited from class gov.nist.javax.sip.message.MessageObject |
|---|
dbgPrint, dbgPrint |
| Methods inherited from class gov.nist.core.GenericObject |
|---|
debugDump, encode, getClassFromName, getMatcher, isMySubclass, makeClone, setMatcher |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.sip.message.Message |
|---|
addFirst, addHeader, addLast, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, hashCode, removeContent, removeFirst, removeHeader, removeLast, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeader |
| Methods inherited from interface javax.sip.message.Message |
|---|
addFirst, addHeader, addLast, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, hashCode, removeContent, removeFirst, removeHeader, removeLast, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeader |
| Methods inherited from interface gov.nist.javax.sip.message.MessageExt |
|---|
getApplicationData, getCallIdHeader, getContentLengthHeader, getContentTypeHeader, getCSeqHeader, getFromHeader, getMultipartMimeContent, getToHeader, getTopmostViaHeader, setApplicationData |
| Methods inherited from interface javax.sip.message.Message |
|---|
addFirst, addHeader, addLast, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, hashCode, removeContent, removeFirst, removeHeader, removeLast, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeader |
| Constructor Detail |
|---|
public SIPRequest()
| Method Detail |
|---|
public static boolean isTargetRefresh(String ucaseMethod)
public static boolean isDialogCreating(String ucaseMethod)
public static String getCannonicalName(String method)
public RequestLine getRequestLine()
public void setRequestLine(RequestLine requestLine)
requestLine - is the request line to set in the SIP Request.public String debugDump()
debugDump in class SIPMessage
public void checkHeaders()
throws ParseException
ParseExceptionpublic URI getRequestURI()
getRequestURI in interface Requestpublic void setRequestURI(URI uri)
setRequestURI in interface Requesturi - the new Request URI of this request messagepublic void setMethod(String method)
setMethod in interface Requestmethod - is the method to set.
IllegalArgumentException - if the method is nullpublic String getMethod()
getMethod in interface Requestpublic String encode()
encode in class SIPMessagepublic StringBuilder encodeMessage(StringBuilder retval)
encodeMessage in class SIPMessagepublic String toString()
toString in interface MessagetoString in class SIPMessagepublic Object clone()
clone in interface Messageclone in class SIPMessagepublic boolean equals(Object other)
equals in interface Messageequals in class SIPMessageother - object to compare ourselves with.
public LinkedList getMessageAsEncodedStrings()
getMessageAsEncodedStrings in class SIPMessagepublic boolean match(Object matchObj)
match in class SIPMessagematchObj - object to match ourselves with (null matches wildcard)
public byte[] encodeAsBytes(String transport)
encodeAsBytes in class SIPMessagepublic SIPResponse createResponse(int statusCode)
statusCode - Status code for the response. Reason phrase is generated.
public SIPResponse createResponse(int statusCode,
String reasonPhrase)
statusCode - Status code for the response.reasonPhrase - Reason phrase for this response.
public SIPRequest createCancelRequest()
throws SipException
SipException
ParseExceptionpublic SIPRequest createAckRequest(To responseToHeader)
responseToHeader - To header to use for this request.
public final SIPRequest createErrorAck(To responseToHeader)
throws SipException,
ParseException
SipException
NullPointerException
ParseExceptionpublic String getViaHost()
public int getViaPort()
public String getFirstLine()
getFirstLine in interface MessageExtgetFirstLine in class SIPMessage
public void setSIPVersion(String sipVersion)
throws ParseException
setSIPVersion in interface MessagesetSIPVersion in class SIPMessagesipVersion - the sip version to set.
ParseException - which signals that an error has been reached
unexpectedly while parsing the version argument.public String getSIPVersion()
getSIPVersion in interface MessagegetSIPVersion in class SIPMessagepublic Object getTransaction()
public void setTransaction(Object transaction)
transaction - public Object getMessageChannel()
public void setMessageChannel(Object messageChannel)
messageChannel - public String getMergeId()
public void setInviteTransaction(Object inviteTransaction)
inviteTransaction - the inviteTransaction to setpublic Object getInviteTransaction()
public void cleanUp()
cleanUp in class SIPMessage
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||