gov.nist.javax.sip.message
クラス SIPRequest

java.lang.Object
  上位を拡張 gov.nist.core.GenericObject
      上位を拡張 gov.nist.javax.sip.message.MessageObject
          上位を拡張 gov.nist.javax.sip.message.SIPMessage
              上位を拡張 gov.nist.javax.sip.message.SIPRequest
すべての実装されたインタフェース:
java.io.Serializable, java.lang.Cloneable, javax.sip.message.Message, javax.sip.message.Request

public final class SIPRequest
extends SIPMessage
implements javax.sip.message.Request

The SIP Request structure.

バージョン:
JAIN-SIP-1.1 $Revision: 1.10 $ $Date: 2004/09/13 15:12:26 $
作成者:
M. Ranganathan
This code is in the public domain.
関連項目:
直列化された形式

フィールドの概要
 
インタフェース javax.sip.message.Request から継承されたフィールド
ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, PRACK, REFER, REGISTER, SUBSCRIBE, UPDATE
 
コンストラクタの概要
SIPRequest()
          Constructor.
 
メソッドの概要
 java.lang.Object clone()
          Make a clone (deep copy) of this object.
 SIPRequest createACKRequest()
          Create an ACK request from this request.
 SIPRequest createAckRequest(To responseToHeader)
          Creates a default ACK SIPRequest message for this original request.
 SIPRequest createBYERequest(boolean switchHeaders)
          Create a BYE request from this request.
 SIPRequest createCancelRequest()
          Creates a default SIPResquest message that would cancel this request.
 SIPResponse createResponse(int statusCode)
          Creates a default SIPResponse message for this request.
 SIPResponse createResponse(int statusCode, java.lang.String reasonPhrase)
          Creates a default SIPResponse message for this request.
 SIPRequest createSIPRequest(RequestLine requestLine, boolean switchHeaders)
          Create a new default SIPRequest from the original request.
 java.lang.String debugDump()
          Convert to a formatted string for pretty printing.
 java.lang.String encode()
          Encode the SIP Request as a string.
 byte[] encodeAsBytes()
          Encode this into a byte array.
 java.lang.String encodeMessage()
          Encode only the headers and not the content.
 boolean equals(java.lang.Object other)
          Compare for equality.
static java.lang.String getCannonicalName(java.lang.String method)
          Set to standard constants to speed up processing.
 java.lang.String getDialogId(boolean isServer)
          Get a dialog identifier.
 java.lang.String getDialogId(boolean isServer, java.lang.String toTag)
          Get a dialog id given the remote tag.
 java.lang.String getFirstLine()
          Get the first line encoded.
 java.util.LinkedList getMessageAsEncodedStrings()
          Get the message as a linked list of strings.
 java.lang.String getMethod()
          Get the method from the request line.
 RequestLine getRequestLine()
          Get the Request Line of the SIPRequest.
 javax.sip.address.URI getRequestURI()
          A conveniance function to access the Request URI.
 java.lang.String getSIPVersion()
          Get the SIP version.
 java.lang.Object getTransaction()
           
 java.lang.String getViaHost()
          Get the host from the topmost via header.
 int getViaPort()
          Get the port from the topmost via header.
 boolean match(java.lang.Object matchObj)
          Match with a template.
 void replace(java.lang.String ctext, GenericObject newObject, boolean matchSubstring)
          Replace a portion of this response with a new structure (given by newObj).
 void setMethod(java.lang.String method)
          Set the method.
 void setRequestLine(RequestLine requestLine)
          Set the request line of the SIP Request.
 void setRequestURI(javax.sip.address.URI uri)
          Sets the RequestURI of Request.
 void setSIPVersion(java.lang.String sipVersion)
          Set the sip version.
 void setTransaction(java.lang.Object transaction)
           
 java.lang.String toString()
          ALias for encode above.
 
クラス gov.nist.javax.sip.message.SIPMessage から継承されたメソッド
addHeader, addHeader, addUnparsed, attachHeader, attachHeader, getAuthorization, getCallId, getContactHeaders, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getContentTypeHeader, getCSeq, getErrorInfoHeaders, getExpires, getFrom, getFromTag, getHeader, getHeaderNames, getHeaders, getHeaders, getMaxForwards, getMessageContent, getRawContent, getRecordRouteHeaders, getRouteHeaders, getSize, getTo, getTopmostVia, getToTag, getTransactionId, getUnrecognizedHeaders, getUserObject, getViaHeaders, hasContent, hasFromTag, hasHeader, hasToTag, isRequestHeader, isResponseHeader, merge, removeContent, removeHeader, removeHeader, replace, setCallId, setCallId, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setCSeq, setExpires, setFrom, setFromTag, setHeader, setHeader, setHeaders, setMaxForwards, setMessageContent, setMessageContent, setMessageContent, setMessageContent, setSize, setTo, setToTag, setUserObject, setVia
 
クラス gov.nist.javax.sip.message.MessageObject から継承されたメソッド
dbgPrint, dbgPrint
 
クラス gov.nist.core.GenericObject から継承されたメソッド
debugDump, getClassFromName, getMatcher, isMySubclass, replace, replace, setMatcher
 
クラス java.lang.Object から継承されたメソッド
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース javax.sip.message.Message から継承されたメソッド
addHeader, getContent, getContentDisposition, getContentEncoding, getContentLanguage, getContentLength, getExpires, getHeader, getHeaderNames, getHeaders, getRawContent, getUnrecognizedHeaders, getUserObject, removeContent, removeHeader, setContent, setContentDisposition, setContentEncoding, setContentLanguage, setContentLength, setExpires, setHeader, setUserObject
 

コンストラクタの詳細

SIPRequest

public SIPRequest()
Constructor.

メソッドの詳細

getCannonicalName

public static java.lang.String getCannonicalName(java.lang.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. Character by char comparison is not required.


replace

public void replace(java.lang.String ctext,
                    GenericObject newObject,
                    boolean matchSubstring)
Replace a portion of this response with a new structure (given by newObj). This method finds a sub-structure that encodes to cText and has the same type as the second arguement and replaces this portion with the second argument.

オーバーライド:
クラス SIPMessage 内の replace
パラメータ:
ctext - is the text that we want to replace.
newObject - is the new object that we want to put in place of ctext.
matchSubstring -

getRequestLine

public RequestLine getRequestLine()
Get the Request Line of the SIPRequest.

戻り値:
the request line of the SIP Request.

setRequestLine

public void setRequestLine(RequestLine requestLine)
Set the request line of the SIP Request.

パラメータ:
requestLine - is the request line to set in the SIP Request.

debugDump

public java.lang.String debugDump()
Convert to a formatted string for pretty printing. Note that the encode method converts this into a sip message that is suitable for transmission. Note hack here if you want to convert the nice curly brackets into some grotesque XML tag.

オーバーライド:
クラス SIPMessage 内の debugDump
戻り値:
a string which can be used to examine the message contents.

getRequestURI

public javax.sip.address.URI getRequestURI()
A conveniance function to access the Request URI.

定義:
インタフェース javax.sip.message.Request 内の getRequestURI
戻り値:
the requestURI if it exists.

setRequestURI

public void setRequestURI(javax.sip.address.URI uri)
Sets the RequestURI of Request. The Request-URI is a SIP or SIPS URI or a general URI. It indicates the user or service to which this request is being addressed. SIP elements MAY support Request-URIs with schemes other than "sip" and "sips", for example the "tel" URI scheme. SIP elements MAY translate non-SIP URIs using any mechanism at their disposal, resulting in SIP URI, SIPS URI, or some other scheme.

定義:
インタフェース javax.sip.message.Request 内の setRequestURI
パラメータ:
uri - the new Request URI of this request message

setMethod

public void setMethod(java.lang.String method)
Set the method.

定義:
インタフェース javax.sip.message.Request 内の setMethod
パラメータ:
method - is the method to set.
例外:
java.lang.IllegalArgumentException - if the method is null

getMethod

public java.lang.String getMethod()
Get the method from the request line.

定義:
インタフェース javax.sip.message.Request 内の getMethod
戻り値:
the method from the request line if the method exits and null if the request line or the method does not exist.

encode

public java.lang.String encode()
Encode the SIP Request as a string.

オーバーライド:
クラス SIPMessage 内の encode
戻り値:
an encoded String containing the encoded SIP Message.

encodeMessage

public java.lang.String encodeMessage()
Encode only the headers and not the content.

定義:
クラス SIPMessage 内の encodeMessage

toString

public java.lang.String toString()
ALias for encode above.

定義:
インタフェース javax.sip.message.Message 内の toString
定義:
クラス SIPMessage 内の toString

clone

public java.lang.Object clone()
Make a clone (deep copy) of this object. You can use this if you want to modify a request while preserving the original

定義:
インタフェース javax.sip.message.Message 内の clone
オーバーライド:
クラス SIPMessage 内の clone
戻り値:
a deep copy of this object.

equals

public boolean equals(java.lang.Object other)
Compare for equality.

定義:
インタフェース javax.sip.message.Message 内の equals
オーバーライド:
クラス SIPMessage 内の equals
パラメータ:
other - object to compare ourselves with.
戻り値:
true if the objects are euqal and false otherwise

getMessageAsEncodedStrings

public java.util.LinkedList getMessageAsEncodedStrings()
Get the message as a linked list of strings. Use this if you want to iterate through the message.

オーバーライド:
クラス SIPMessage 内の getMessageAsEncodedStrings
戻り値:
a linked list containing the request line and headers encoded as strings.

match

public boolean match(java.lang.Object matchObj)
Match with a template. You can use this if you want to match incoming messages with a pattern and do something when you find a match. This is useful for building filters/pattern matching responders etc.

オーバーライド:
クラス SIPMessage 内の match
パラメータ:
matchObj - object to match ourselves with (null matches wildcard)
戻り値:
true if a match occured and false otherwise.

getDialogId

public java.lang.String getDialogId(boolean isServer)
Get a dialog identifier. Generates a string that can be used as a dialog identifier.

定義:
クラス SIPMessage 内の getDialogId
パラメータ:
isServer - is set to true if this is the UAS and set to false if this is the UAC

getDialogId

public java.lang.String getDialogId(boolean isServer,
                                    java.lang.String toTag)
Get a dialog id given the remote tag.


encodeAsBytes

public byte[] encodeAsBytes()
Encode this into a byte array. This is used when the body has been set as a binary array and you want to encode the body as a byte array for transmission.

オーバーライド:
クラス SIPMessage 内の encodeAsBytes
戻り値:
a byte array containing the SIPRequest encoded as a byte array.

createResponse

public SIPResponse createResponse(int statusCode)
Creates a default SIPResponse message for this request. Note You must add the necessary tags to outgoing responses if need be. For efficiency, this method does not clone the incoming request. If you want to modify the outgoing response, be sure to clone the incoming request as the headers are shared and any modification to the headers of the outgoing response will result in a modification of the incoming request. Tag fields are just copied from the incoming request. Contact headers are removed from the incoming request. Added by Jeff Keyser.

パラメータ:
statusCode - Status code for the response. Reason phrase is generated.
戻り値:
A SIPResponse with the status and reason supplied, and a copy of all the original headers from this request.

createResponse

public SIPResponse createResponse(int statusCode,
                                  java.lang.String reasonPhrase)
Creates a default SIPResponse message for this request. Note You must add the necessary tags to outgoing responses if need be. For efficiency, this method does not clone the incoming request. If you want to modify the outgoing response, be sure to clone the incoming request as the headers are shared and any modification to the headers of the outgoing response will result in a modification of the incoming request. Tag fields are just copied from the incoming request. Contact headers are removed from the incoming request. Added by Jeff Keyser. Route headers are not added to the response.

パラメータ:
statusCode - Status code for the response.
reasonPhrase - Reason phrase for this response.
戻り値:
A SIPResponse with the status and reason supplied, and a copy of all the original headers from this request.

createCancelRequest

public SIPRequest createCancelRequest()
Creates a default SIPResquest message that would cancel this request. Note that tag assignment and removal of is left to the caller (we use whatever tags are present in the original request). Acknowledgement: Added by Jeff Keyser. Incorporates a bug report from Andreas Bystr�m.

戻り値:
A CANCEL SIPRequest with a copy all the original headers from this request except for Require, ProxyRequire.

createAckRequest

public SIPRequest createAckRequest(To responseToHeader)
Creates a default ACK SIPRequest message for this original request. Note that the defaultACK SIPRequest does not include the content of the original SIPRequest. If responseToHeader is null then the toHeader of this request is used to construct the ACK. Note that tag fields are just copied from the original SIP Request. Added by Jeff Keyser.

パラメータ:
responseToHeader - To header to use for this request.
戻り値:
A SIPRequest with an ACK method.

createSIPRequest

public SIPRequest createSIPRequest(RequestLine requestLine,
                                   boolean switchHeaders)
Create a new default SIPRequest from the original request. Warning: the newly created SIPRequest, shares the headers of this request but we generate any new headers that we need to modify so the original request is umodified. However, if you modify the shared headers after this request is created, then the newly created request will also be modified. If you want to modify the original request without affecting the returned Request make sure you clone it before calling this method. Only required headers are copied.

パラメータ:
requestLine - is the new request line.
switchHeaders - is a boolean flag that causes to and from headers to switch (set this to true if you are the server of the transaction and are generating a BYE request). If the headers are switched, we generate new From and To headers otherwise we just use the incoming headers.
戻り値:
a new Default SIP Request which has the requestLine specified.

createBYERequest

public SIPRequest createBYERequest(boolean switchHeaders)
Create a BYE request from this request.

パラメータ:
switchHeaders - is a boolean flag that causes from and isServerTransaction to headers to be swapped. Set this to true if you are the server of the dialog and are generating a BYE request for the dialog.
戻り値:
a new default BYE request.

createACKRequest

public SIPRequest createACKRequest()
Create an ACK request from this request. This is suitable for generating an ACK for an INVITE client transaction.

戻り値:
an ACK request that is generated from this request.

getViaHost

public java.lang.String getViaHost()
Get the host from the topmost via header.

戻り値:
the string representation of the host from the topmost via header.

getViaPort

public int getViaPort()
Get the port from the topmost via header.

戻り値:
the port from the topmost via header (5060 if there is no port indicated).

getFirstLine

public java.lang.String getFirstLine()
Get the first line encoded.

定義:
クラス SIPMessage 内の getFirstLine
戻り値:
a string containing the encoded request line.

setSIPVersion

public void setSIPVersion(java.lang.String sipVersion)
                   throws java.text.ParseException
Set the sip version.

定義:
インタフェース javax.sip.message.Message 内の setSIPVersion
定義:
クラス SIPMessage 内の setSIPVersion
パラメータ:
sipVersion - the sip version to set.
例外:
java.text.ParseException

getSIPVersion

public java.lang.String getSIPVersion()
Get the SIP version.

定義:
インタフェース javax.sip.message.Message 内の getSIPVersion
定義:
クラス SIPMessage 内の getSIPVersion
戻り値:
the SIP version from the request line.

getTransaction

public java.lang.Object getTransaction()

setTransaction

public void setTransaction(java.lang.Object transaction)