|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents SIP request messages. When receiving an incoming SIP request
the container creates a SipServletRequest
and passes it to
the handling servlet. For outgoing, locally initiated requests,
applications call SipFactory.createRequest
to obtain a SipServletRequest
that can then be modified and
sent.
Method Summary | |
SipServletRequest |
createCancel()
Returns a CANCEL request object. |
SipServletResponse |
createResponse(int statuscode)
Creates a response for this request with the specifies status code. |
SipServletResponse |
createResponse(int statusCode,
java.lang.String reasonPhrase)
Creates a response for this request with the specifies status code and reason phrase. |
javax.servlet.ServletInputStream |
getInputStream()
Always returns null. |
int |
getMaxForwards()
Returns the value of the Max-Forwards header. |
Proxy |
getProxy()
Returns the Proxy object associated with this request. |
Proxy |
getProxy(boolean create)
Returns the Proxy object associated with this request. |
java.io.BufferedReader |
getReader()
Always returns null. |
URI |
getRequestURI()
Returns the request URI of this request. |
boolean |
isInitial()
Returns true if this is an initial request. |
void |
pushRoute(SipURI uri)
Adds a Route header field value to this request. |
void |
send()
Causes this request to be sent. |
void |
setMaxForwards(int n)
Sets the value of the Max-Forwards header. |
void |
setRequestURI(URI uri)
Sets the request URI of this request. |
Methods inherited from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
Method Detail |
public URI getRequestURI()
SipServletRequest
public void setRequestURI(URI uri)
send
.uri
- new request URI of this SipServletRequest
public void pushRoute(SipURI uri)
This method allows a UAC or a proxy to specify that the request should visit one or more proxies before being delivered to the destination.
uri
- the address that is added as a Route header valuepublic int getMaxForwards()
public void setMaxForwards(int n)
This method is equivalent to:
setHeader("Max-Forwards", String.valueOf(n));
n
- new value of the Max-Forwards headerjava.lang.IllegalArgumentException
- if the argument is not in the range
0 to 255public void send() throws java.io.IOException
Proxy.proxyTo(javax.servlet.sip.URI)
instead.send
in interface SipServletMessage
java.io.IOException
- if a transport error occurs when trying to
send this requestpublic boolean isInitial()
public javax.servlet.ServletInputStream getInputStream() throws java.io.IOException
Message content can be retrieved using SipServletMessage.getContent()
and SipServletMessage.getRawContent()
.
getInputStream
in interface javax.servlet.ServletRequest
public java.io.BufferedReader getReader() throws java.io.IOException
Message content can be retrieved using SipServletMessage.getContent()
and SipServletMessage.getRawContent()
.
getReader
in interface javax.servlet.ServletRequest
public Proxy getProxy() throws TooManyHopsException
Proxy
object associated with this request.
A Proxy
instance will be created if one doesn't already
exist. This method behaves the same as getProxy(true)
.
Note that the container must return the same
Proxy
instance whenever a servlet invokes
getProxy
on messages belonging to the same transaction.
In particular, a response to a proxied request is associated with
the same Proxy
object as is the original request.
This method throws an IllegalStateException
if the
Proxy
object didn't already exist and the transaction
underlying this SIP message is in a state which doesn't allow proxying,
for example if this is a SipServletRequest
for which a
final response has already been generated.
Proxy
object associated with this requestTooManyHopsException
- if this request has a Max-Forwards
header field value of 0.java.lang.IllegalStateException
- if the transaction underlying this
message isn't already associated with a Proxy
object and its state disallows proxying to be initiated,
for example, because a final response has already been generatedgetProxy(boolean)
public Proxy getProxy(boolean create) throws TooManyHopsException
Proxy
object associated with this request.
If no Proxy
object has yet been created for this request,
the create
argument specifies whether a Proxy
object is to be created or not.
Once a Proxy
object has been associated with a request
subsequent invocations of this method will yield the same
Proxy
object, as will the no-argument
getProxy()
method and SipServletResponse.getProxy()
for responses received to proxied requests.
create
- indicates whether the servlet engine should create
a new Proxy
object if one does not already existProxy
object associated with this requestTooManyHopsException
- if this request has a Max-Forwards
header field value of 0.java.lang.IllegalStateException
- if the transaction has already completedpublic SipServletResponse createResponse(int statuscode)
statuscode
- status code for the responsejava.lang.IllegalArgumentException
- if the statuscode is not a valid
SIP status codejava.lang.IllegalStateException
- if this request has already been
responded to with a final status codepublic SipServletResponse createResponse(int statusCode, java.lang.String reasonPhrase)
statusCode
- status code for the responsereasonPhrase
- reason phrase to appear in response linejava.lang.IllegalArgumentException
- if the statuscode is not a valid
SIP status codejava.lang.IllegalStateException
- if this request has already been
responded to with a final status codepublic SipServletRequest createCancel() throws java.lang.IllegalStateException
Proxy.cancel()
instead.java.lang.IllegalStateException
- if the transaction state is such that
it doesn't allow the specified request to be sent now
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |