|
||||||||||
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.
Field Summary | |
---|---|
protected static Set<String> |
headersToIncludeInResponse
|
protected RequestLine |
requestLine
|
Fields inherited from class gov.nist.javax.sip.message.SIPMessage |
---|
applicationData, callIdHeader, contentLengthHeader, cSeqHeader, forkId, fromHeader, headers, headerTable, maxForwardsHeader, messageContent, messageContentBytes, messageContentObject, nullRequest, size, toHeader, unrecognizedHeaders |
Fields inherited from class gov.nist.core.GenericObject |
---|
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation |
Fields inherited from interface javax.sip.message.Request |
---|
ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, PRACK, PUBLISH, REFER, REGISTER, SUBSCRIBE, UPDATE |
Constructor Summary | |
---|---|
SIPRequest()
Constructor. |
Method Summary | |
---|---|
void |
checkHeaders()
Check header for constraints. |
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. |
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. |
protected boolean |
mustCopyRR(int code)
|
protected void |
setDefaults()
Set the default values in the request URI if necessary. |
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. |
protected void |
setRequestLineDefaults()
Patch up the request line as necessary. |
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 |
---|
dbgPrint, debugDump, encode, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Field Detail |
---|
protected RequestLine requestLine
protected static final Set<String> headersToIncludeInResponse
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
ParseException
protected void setDefaults()
protected void setRequestLineDefaults()
public URI getRequestURI()
getRequestURI
in interface Request
public void setRequestURI(URI uri)
setRequestURI
in interface Request
uri
- the new Request URI of this request messagepublic void setMethod(String method)
setMethod
in interface Request
method
- is the method to set.
IllegalArgumentException
- if the method is nullpublic String getMethod()
getMethod
in interface Request
public String encode()
encode
in class SIPMessage
public StringBuilder encodeMessage(StringBuilder retval)
encodeMessage
in class SIPMessage
public String toString()
toString
in interface Message
toString
in class SIPMessage
public Object clone()
clone
in interface Message
clone
in class SIPMessage
public boolean equals(Object other)
equals
in interface Message
equals
in class SIPMessage
other
- object to compare ourselves with.
public LinkedList getMessageAsEncodedStrings()
getMessageAsEncodedStrings
in class SIPMessage
public boolean match(Object matchObj)
match
in class SIPMessage
matchObj
- object to match ourselves with (null matches wildcard)
public byte[] encodeAsBytes(String transport)
encodeAsBytes
in class SIPMessage
public 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.
protected final boolean mustCopyRR(int code)
public SIPRequest createCancelRequest() throws SipException
SipException
ParseException
public SIPRequest createAckRequest(To responseToHeader)
responseToHeader
- To header to use for this request.
public final SIPRequest createErrorAck(To responseToHeader) throws SipException, ParseException
SipException
NullPointerException
ParseException
public String getViaHost()
public int getViaPort()
public String getFirstLine()
getFirstLine
in interface MessageExt
getFirstLine
in class SIPMessage
public void setSIPVersion(String sipVersion) throws ParseException
setSIPVersion
in interface Message
setSIPVersion
in class SIPMessage
sipVersion
- 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 Message
getSIPVersion
in class SIPMessage
public 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |