jain.protocol.ip.sip.header
Class ServerHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.ResponseHeader
              |
              +--jain.protocol.ip.sip.header.ServerHeader

public final class ServerHeader
extends ResponseHeader

This class represents the Server response-header. A ServerHeader contains information about the software used by the server to handle the request. A ResponseMessage can contain multiple ServerHeaders identifying the server and any significant subproducts. The ServerHeaders are listed in order of their significance for identifying the application.

If the ResponseMessage is being forwarded through a proxy, the proxy application must not modify the ServerHeaders. Instead, it should include a ViaHeader

Note: Revealing the specific software version of the server may allow the server machine to become more vulnerable to attacks against software that is known to contain security holes. Server implementers are encouraged to make this field a configurable option.

Version:
0.6
See Also:
ViaHeader

Field Summary
static java.lang.String token
          Token of ServerHeader
 
Fields inherited from class jain.protocol.ip.sip.header.Header
ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
 
Constructor Summary
ServerHeader(java.lang.String productName, boolean isComment)
          Creates a ServerHeader based on given product name and boolean value indicating if the product name is a comment
ServerHeader(java.lang.String productName, java.lang.String productVersion)
          Creates a ServerHeader based on given product name and product version
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of ServerHeader
 boolean equals(ServerHeader serverHeader)
          Indicates whether some other ServerHeader is "equal to" this one
 java.lang.String getComment()
          Gets comment of ServerHeader
 java.lang.String getProductName()
          Gets product name of ServerHeader
 java.lang.String getProductVersion()
          Gets product version of ServerHeader
 java.lang.String getValue()
          Gets value of ServerHeader
 boolean hasComment()
          Returns boolean value indicating if ServerHeader has comment
 boolean hasProductName()
          Returns boolean value to indicating if ServerHeader has product name
 boolean hasProductVersion()
          Returns boolean value to indicating if ServerHeader has product version
 void removeProductVersion()
          Removes product version from ServerHeader
 void setComment(java.lang.String comment)
          Sets comment of ServerHeader
 void setProductName(java.lang.String productName)
          Sets product name of ServerHeader
 void setProductVersion(java.lang.String productVersion)
          Sets product version of ServerHeader
 
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 ServerHeader
Constructor Detail

ServerHeader

public ServerHeader(java.lang.String productName,
                    boolean isComment)
             throws java.lang.IllegalArgumentException
Creates a ServerHeader based on given product name and boolean value indicating if the product name is a comment
Parameters:
productName - product name
isComment - boolean value indicating if the product name is a comment
Throws:
java.lang.IllegalArgumentException - if productName is null or zero-length

ServerHeader

public ServerHeader(java.lang.String productName,
                    java.lang.String productVersion)
Creates a ServerHeader based on given product name and product version
Parameters:
productName - product name
productVersion - product version
Throws:
java.lang.IllegalArgumentException - if productName or productVersion are null or zero-length
Method Detail

hasComment

public boolean hasComment()
Returns boolean value indicating if ServerHeader has comment
Returns:
boolean value indicating if ServerHeader has comment

hasProductName

public boolean hasProductName()
Returns boolean value to indicating if ServerHeader has product name
Returns:
boolean value to indicating if ServerHeader has product name

hasProductVersion

public boolean hasProductVersion()
Returns boolean value to indicating if ServerHeader has product version
Returns:
boolean value to indicating if ServerHeader has product version

getProductName

public java.lang.String getProductName()
                                throws ParameterNotSetException
Gets product name of ServerHeader
Returns:
product name of ServerHeader
Throws:
ParameterNotSetException - if product name does not exist

getProductVersion

public java.lang.String getProductVersion()
                                   throws ParameterNotSetException
Gets product version of ServerHeader
Returns:
product version of ServerHeader
Throws:
ParameterNotSetException - if product version does not exist

getComment

public java.lang.String getComment()
                            throws ParameterNotSetException
Gets comment of ServerHeader
Returns:
comment of ServerHeader
Throws:
ParameterNotSetException - if comment does not exist

setProductName

public void setProductName(java.lang.String productName)
                    throws java.lang.IllegalArgumentException
Sets product name of ServerHeader
Parameters:
productName - product name
Throws:
java.lang.IllegalArgumentException - if productName is null or zero-length

setProductVersion

public void setProductVersion(java.lang.String productVersion)
                       throws java.lang.IllegalArgumentException,
                              SipException
Sets product version of ServerHeader
Parameters:
productVersion - product version
Throws:
SipException - if product name does not exist
java.lang.IllegalArgumentException - if productVersion is null or zero-length

removeProductVersion

public void removeProductVersion()
Removes product version from ServerHeader

setComment

public void setComment(java.lang.String comment)
Sets comment of ServerHeader
Parameters:
comment - comment
Throws:
java.lang.IllegalArgumentException - if comment is null or zero-length

getValue

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

clone

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

equals

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


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


Copyright - 2000 Sun Microsystems