jain.protocol.ip.sip.header
Class UserAgentHeader

java.lang.Object
  |
  +--jain.protocol.ip.sip.header.Header
        |
        +--jain.protocol.ip.sip.header.RequestHeader
              |
              +--jain.protocol.ip.sip.header.UserAgentHeader

public final class UserAgentHeader
extends RequestHeader

This class represents the User-Agent request-header. A UserAgentHeader contains information about the user agent originating the RequestMessage. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring ResponseMessages to avoid particular user agent limitations. User agents should include this header with RequestMessages. RequestMessages can contain multiple UserAgentHeaders identifying the agent and any subproducts which form a significant part of the user agent. By convention, the UserAgentHeaders are listed in order of their significance for identifying the application. Similar security considerations apply for in ServerHeaders.

Version:
0.6
See Also:
ServerHeader

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

UserAgentHeader

public UserAgentHeader(java.lang.String productName,
                       boolean isComment)
                throws java.lang.IllegalArgumentException
Creates a UserAgentHeader 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

UserAgentHeader

public UserAgentHeader(java.lang.String productName,
                       java.lang.String productVersion)
Creates a UserAgentHeader 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 UserAgentHeader has comment
Returns:
boolean value indicating if UserAgentHeader 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 indicating if UserAgentHeader has product version
Returns:
boolean value indicating if UserAgentHeader has product version

getProductName

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

getProductVersion

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

getComment

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

setProductName

public void setProductName(java.lang.String productName)
                    throws java.lang.IllegalArgumentException
Sets product name of UserAgentHeader
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 UserAgentHeader
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 UserAgentHeader

setComment

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

getValue

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

clone

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

equals

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


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


Copyright - 2000 Sun Microsystems