|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A SIP message is either a request from a client to a server, or a response from a server to a client. Both Request and Response messages use the basic format of RFC 2822, even though the syntax differs in character set and syntax specifics. (SIP allows header fields that would not be valid RFC 2822 header fields, for example.) Both types of messages consist of a method name, address and protocol version, one or more header fields which describe the routing of the message, and an optional message-body. The message-body contains a session description in a format such as Session Description Protocol see JSR 141.
This interface contains common elements of both Request and Response such as:
Request
,
Response
,
Header
Method Summary | |
void |
addHeader(Header header)
Adds the new Header to the existing list of Headers contained in this Message. |
Object |
clone()
Creates and returns a deep copy of the Message. |
boolean |
equals(Object object)
Compare this SIP Message for equality with another. |
Object |
getContent()
Gets the body content of the Message as an Object. |
ContentDispositionHeader |
getContentDisposition()
Gets the ContentDispositionHeader of this Message. |
ContentEncodingHeader |
getContentEncoding()
Gets the ContentEncodingHeader of this Message. |
ContentLanguageHeader |
getContentLanguage()
Gets the ContentLanguageHeader of this Message. |
ContentLengthHeader |
getContentLength()
Gets the ContentLengthHeader of the body content of this Message. |
ExpiresHeader |
getExpires()
Gets the ExpiresHeader of this Message. |
Header |
getHeader(String headerName)
Gets the Header of the specified name in this Message. |
ListIterator |
getHeaderNames()
Gets a ListIterator over all the header names in this Message. |
ListIterator |
getHeaders(String headerName)
Gets a ListIterator over all the Headers of the newly specified name in this Message. |
byte[] |
getRawContent()
Gets the body content of the Message as a byte array. |
String |
getSIPVersion()
Gets the protocol version of SIP being used by this Message. |
ListIterator |
getUnrecognizedHeaders()
Gets a ListIterator over all the UnrecognizedHeaders in this Message. |
void |
removeContent()
Removes the body content from this Message and all associated entity headers, if a body exists, this method returns sliently if no body exists. |
void |
removeHeader(String headerName)
Removes the Header of the supplied name from the list of headers in this Message. |
void |
setContent(Object content,
ContentTypeHeader contentTypeHeader)
Sets the body of this Message, with the ContentType defined by the new ContentTypeHeader object and the string value of the content. |
void |
setContentDisposition(ContentDispositionHeader contentDisposition)
Sets the ContentDispositionHeader of this Message. |
void |
setContentEncoding(ContentEncodingHeader contentEncoding)
Sets the ContentEncodingHeader of this Message. |
void |
setContentLanguage(ContentLanguageHeader contentLanguage)
Sets the ContentLanguageHeader of this Message. |
void |
setContentLength(ContentLengthHeader contentLength)
Set the ContentLengthHeader of this Message. |
void |
setExpires(ExpiresHeader expires)
Sets the ExpiresHeader of this Message. |
void |
setHeader(Header header)
Sets the new Header to replace existings Header of that type in the message. |
void |
setSIPVersion(String version)
Sets the protocol version of SIP being used by this Message. |
String |
toString()
Gets string representation of Message |
Method Detail |
public void addHeader(Header header)
Required Headers that are singletons should not be added to the message
as they already exist in the message and therefore should be changed using
the setHeader(Header)
method.
This method should be used to support the special case of adding required ViaHeaders to a message. When adding a ViaHeader using this method the implementation will add the ViaHeader to the top of the ViaHeader list, and not the end like all other Headers.
header
- the new Header to be added to the existing Headers List.public void removeHeader(String headerName)
setHeader(Header)
.
public ListIterator getHeaderNames()
public ListIterator getHeaders(String headerName)
headerName
- the new string name of Header types requested.
public Header getHeader(String headerName)
headerName
- the new string name of Header type requested.
public ListIterator getUnrecognizedHeaders()
public void setHeader(Header header)
header
- the new Header to replace any existing Headers of that
type.public void setContentLength(ContentLengthHeader contentLength)
contentLength
- the new ContentLengthHeader object containing the
content length value of this Message.public ContentLengthHeader getContentLength()
this.getHeader(Content-Length);
public void setContentLanguage(ContentLanguageHeader contentLanguage)
contentLanguage
- the new ContentLanguageHeader object containing the
content language value of this Message.public ContentLanguageHeader getContentLanguage()
this.getHeader(Content-Langauge);
public void setContentEncoding(ContentEncodingHeader contentEncoding)
contentEncoding
- the new ContentEncodingHeader object containing the
content encoding values of this Message.public ContentEncodingHeader getContentEncoding()
this.getHeader(Content-Encoding);
public void setContentDisposition(ContentDispositionHeader contentDisposition)
contentDisposition
- the new ContentDispositionHeader object
containing the content disposition value of this Message.public ContentDispositionHeader getContentDisposition()
this.getHeader(Content-Disposition);
public void setContent(Object content, ContentTypeHeader contentTypeHeader) throws ParseException
content
- the new Object value of the content of the Message.contentTypeHeader
- the new ContentTypeHeader object that defines
the content type value.
ParseException
- which signals that an error has been reached
unexpectedly while parsing the body.public byte[] getRawContent()
public Object getContent()
public void removeContent()
public void setExpires(ExpiresHeader expires)
expires
- the new ExpiresHeader object containing the expires
values of this Message.public ExpiresHeader getExpires()
this.getHeader(Expires);
public void setSIPVersion(String version) throws ParseException
version
- the new String object containing the version of the SIP
Protocol of this Message.
ParseException
- which signals that an error has been reached
unexpectedly while parsing the version argument.public String getSIPVersion()
public Object clone()
public String toString()
toString
in class Object
public boolean equals(Object object)
equals
in class Object
true
if obj
is an instance of this class
representing the same SIP Message as this, false
otherwise.
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |