public interface SipServletMessage extends Cloneable
| Modifier and Type | Interface and Description |
|---|---|
static class |
SipServletMessage.HeaderForm
Type header forms.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAcceptLanguage(Locale locale)
Adds an acceptable Locale of this user agent.
|
void |
addAddressHeader(String name,
Address addr,
boolean first)
Adds the specified Address as a new value of the named header field.
|
void |
addHeader(String name,
String value)
Adds a header with the given name and value.
|
void |
addParameterableHeader(String name,
Parameterable param,
boolean first)
Adds the specified Parameterable as a new value of the named header field.
|
Locale |
getAcceptLanguage()
Returns the preferred Locale that the UA originating this message will accept content in, based on the Accept-Language header.
|
Iterator<Locale> |
getAcceptLanguages()
Returns an Iterator over Locale objects indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the sending UA based on the Accept-Language header.
|
Address |
getAddressHeader(String name)
Returns the value of the specified header as a Address object.
|
ListIterator<Address> |
getAddressHeaders(String name)
Returns a ListIterator over all Address header field values for the specified header.
|
SipApplicationSession |
getApplicationSession()
Returns the application session to which this message belongs.
|
SipApplicationSession |
getApplicationSession(boolean create)
Returns the app session to which this message belongs.
|
Object |
getAttribute(String name)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
|
Enumeration<String> |
getAttributeNames()
Returns an Enumeration containing the names of the attributes available to this message object.
|
String |
getCallId()
Returns the value of the Call-ID header in this SipServletMessage.
|
String |
getCharacterEncoding()
Returns the name of the charset used for the MIME body sent in this message.
|
Object |
getContent()
Returns the content as a Java object.
|
Locale |
getContentLanguage()
Returns the locale of this message.
|
int |
getContentLength()
Returns the length in number of bytes of the content part of this message.
|
String |
getContentType()
Returns the value of the Content-Type header field.
|
int |
getExpires()
Returns the value of the Expires header.
|
Address |
getFrom()
Returns the value of the From header.
|
String |
getHeader(String name)
Returns the value of the specified header as a String.
|
SipServletMessage.HeaderForm |
getHeaderForm() |
Iterator<String> |
getHeaderNames()
Returns an Iterator over all the header names this message contains.
|
ListIterator<String> |
getHeaders(String name)
Returns all the values of the specified request header as a ListIterator over a number of String objects.
|
String |
getInitialRemoteAddr()
Returns the IP address of the upstream/downstream hop from which this message was initially received by the container.
|
int |
getInitialRemotePort()
Returns the port number of the upstream/downstream hop from which this message initially received by the container.
|
String |
getInitialTransport()
Returns the name of the protocol with which this message was initially received by the container, e.g.
|
String |
getLocalAddr()
Returns the IP address of the interface this message was received on.
|
int |
getLocalPort()
Returns the local port this message was received on.
|
String |
getMethod()
Returns the SIP method of this message.
|
Parameterable |
getParameterableHeader(String name)
Returns the value of the specified header field as a Parameterable object.
|
ListIterator<? extends Parameterable> |
getParameterableHeaders(String name)
Returns a ListIterator over all Parameterable header field values for the specified header name.
|
String |
getProtocol()
Returns the name and version of the protocol of this message.
|
byte[] |
getRawContent()
Returns message content as a byte array.
|
String |
getRemoteAddr()
Returns the IP address of the next upstream/downstream hop from which this message was received.
|
int |
getRemotePort()
Returns the port number of the next upstream/downstream hop from which this message was received.
|
String |
getRemoteUser()
Returns the login of the user sending this message, if the user has been authenticated, or null if the user has not been authenticated.
|
SipSession |
getSession()
Returns the SipSession to which this message belongs.
|
SipSession |
getSession(boolean create)
Returns the SipSession to which this message belongs.
|
Address |
getTo()
Returns the value of the To header.
|
String |
getTransport()
Returns the name of the protocol with which this message was received, e.g.
|
Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the name of the authenticated user agent sending this message.
|
boolean |
isCommitted()
Returns true if this message is committed, that is, if one of the following conditions is true: This message is an incoming request for which a final response has already been generated.
|
boolean |
isSecure()
Returns a boolean indicating whether this message was received over a secure channel, such as TLS.
|
boolean |
isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
|
void |
removeAttribute(String name)
Removes the named attribute from this message.
|
void |
removeHeader(String name)
Removes the specified header.
|
void |
send()
Sends this SipServletMessage.
|
void |
setAcceptLanguage(Locale locale)
Sets the preferred Locale that this user agent will accept content, reason phrases, warnings, etc.
|
void |
setAddressHeader(String name,
Address addr)
Sets the header with the specified name to have the value specified by the address argument.
|
void |
setAttribute(String name,
Object o)
Stores an attribute in this message.
|
void |
setCharacterEncoding(String enc)
Overrides the name of the character encoding that will be used to convert the body of this message from bytes to characters or vice versa.
|
void |
setContent(Object content,
String contentType)
Sets the content of this message to the specified Object.
|
void |
setContentLanguage(Locale locale)
Sets the locale of this message, setting the headers (Content-Language and the Content-Type's charset) as appropriate.
|
void |
setContentLength(int len)
Sets the value of the Content-Length header.
|
void |
setContentType(String type)
Sets the content type of the response being sent to the client.
|
void |
setExpires(int seconds)
Sets the value of the Expires header in this message.
|
void |
setHeader(String name,
String value)
Sets a header with the given name and value.
|
void |
setHeaderForm(SipServletMessage.HeaderForm form)
Indicates which of the compact or long form should the headers in this message have.
|
void |
setParameterableHeader(String name,
Parameterable param)
Sets the header with the specified name to have the value specified by the address argument.
|
void addAcceptLanguage(Locale locale)
void addAddressHeader(String name, Address addr, boolean first)
void addHeader(String name, String value)
void addParameterableHeader(String name, Parameterable param, boolean first)
Locale getAcceptLanguage()
Iterator<Locale> getAcceptLanguages()
Address getAddressHeader(String name) throws ServletParseException
ServletParseExceptionListIterator<Address> getAddressHeaders(String name) throws ServletParseException
ServletParseExceptionSipApplicationSession getApplicationSession()
SipApplicationSession getApplicationSession(boolean create)
Object getAttribute(String name)
Enumeration<String> getAttributeNames()
String getCallId()
String getCharacterEncoding()
Object getContent() throws IOException, UnsupportedEncodingException
Locale getContentLanguage()
int getContentLength()
String getContentType()
int getExpires()
Address getFrom()
String getHeader(String name)
SipServletMessage.HeaderForm getHeaderForm()
Iterator<String> getHeaderNames()
ListIterator<String> getHeaders(String name)
String getInitialRemoteAddr()
int getInitialRemotePort()
String getInitialTransport()
String getLocalAddr()
int getLocalPort()
String getMethod()
Parameterable getParameterableHeader(String name) throws ServletParseException
ServletParseExceptionListIterator<? extends Parameterable> getParameterableHeaders(String name) throws ServletParseException
ServletParseExceptionString getProtocol()
byte[] getRawContent()
throws IOException
IOExceptionString getRemoteAddr()
int getRemotePort()
String getRemoteUser()
SipSession getSession()
SipSession getSession(boolean create)
Address getTo()
String getTransport()
Principal getUserPrincipal()
boolean isCommitted()
boolean isSecure()
boolean isUserInRole(String role)
void removeAttribute(String name)
name - a String specifying the name of the attributeNullPointerException - if name is null.void removeHeader(String name)
void send()
throws IOException
IOExceptionvoid setAcceptLanguage(Locale locale)
void setAddressHeader(String name, Address addr)
If the message did not include any headers of the specified name,
this method returns an empty Iterator. If the message included headers of
the specified name with no values, this method returns an Iterator over empty Strings.
IllegalArgumentException - if the specified header isn't defined to hold address values or if the specified header field is a system headervoid setAttribute(String name, Object o)
void setCharacterEncoding(String enc) throws UnsupportedEncodingException
UnsupportedEncodingExceptionvoid setContent(Object content, String contentType) throws UnsupportedEncodingException
UnsupportedEncodingExceptionvoid setContentLanguage(Locale locale)
void setContentLength(int len)
void setContentType(String type)
void setExpires(int seconds)
void setHeader(String name, String value)
void setHeaderForm(SipServletMessage.HeaderForm form)
void setParameterableHeader(String name, Parameterable param)
If the message did not include any headers of the specified name,
this method returns an empty Iterator. If the message included headers of
the specified name with no values, this method returns an Iterator over empty Strings.
IllegalArgumentException - if the specified header isn't defined to hold address values or if the specified header field is a system headerCopyright © 2016. All rights reserved.