jain.protocol.ip.sip.header
Class ContentLengthHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.EntityHeader
              |
              +--jain.protocol.ip.sip.header.ContentLengthHeader

public final class ContentLengthHeader
extends EntityHeader

This class represents the Content-Length entity-header. ContentLengthHeader indicates the size of the message-body, in decimal number of octets, sent to the recipient.

Applications should use this field to indicate the size of the message-body to be transferred, regardless of the media type of the entity. Any Content-Length greater than or equal to zero is a valid value. If no body is present in a message, then the Content-Length header field must be set to zero.

Version:
0.6

Field Summary
static java.lang.String token
          Token of ContentLengthHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
ContentLengthHeader(int contentLength)
          Creates a ContentLengthHeader based on given content-length
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of ContentLengthHeader
 boolean equals(ContentLengthHeader contentLengthHeader)
          Indicates whether some other ContentLengthHeader is "equal to" this one
 int getContentLength()
          Gets content-length of ContentLengthHeader
 java.lang.String getValue()
          Gets value of ContentLengthHeader
 void setContentLength(int contentLength)
          Set content-length of ContentLengthHeader
 
Methods inherited from class jain.protocol.ip.sip.header.Header
equals, getHeaderType, getToken, setValue, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

token

public static final java.lang.String token
Token of ContentLengthHeader
Constructor Detail

ContentLengthHeader

public ContentLengthHeader(int contentLength)
                    throws java.lang.IllegalArgumentException
Creates a ContentLengthHeader based on given content-length
Parameters:
contentLength - content-length
Throws:
java.lang.IllegalArgumentException - if contentLength is negative
Method Detail

setContentLength

public void setContentLength(int contentLength)
                      throws java.lang.IllegalArgumentException
Set content-length of ContentLengthHeader
Parameters:
contentLength - content-length
Throws:
java.lang.IllegalArgumentException - if contentLength is negative

getContentLength

public int getContentLength()
Gets content-length of ContentLengthHeader
Returns:
content-length of ContentLengthHeader

getValue

public java.lang.String getValue()
Gets value of ContentLengthHeader
Overrides:
getValue in class Header
Returns:
value of ContentLengthHeader

clone

public java.lang.Object clone()
Creates and returns a copy of ContentLengthHeader
Overrides:
clone in class Header

equals

public boolean equals(ContentLengthHeader contentLengthHeader)
Indicates whether some other ContentLengthHeader is "equal to" this one
Parameters:
contentLengthHeader - the ContentLengthHeader with which to compare


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems