jain.protocol.ip.sip.header
Class WarningHeader

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

public final class WarningHeader
extends ResponseHeader

This class represents the Warning response-header. WarningHeader is used to carry additional information about the status of a ResponseMessage. WarningHeaders are sent with ResponseMessages and a ResponseMessage may carry more than one WarningHeader.

The text should be in a natural language that is most likely to be intelligible to the human user receiving the ResponseMessage. This decision can be based on any available knowledge, such as the location of the cache or user, the AcceptLanguageHeader in a RequestMessage, or the ContentLanguageHeader in a ResponseMessage.

Any server may add WarningHeaders to a ResponseMessage. Proxy servers must place additional WarningHeaders before any AuthorizationHeaders. Within that constraint, WarningHeaders must be added after any existing WarningHeaders not covered by a signature. A proxy server must not delete any WarningHeader that it received with a ResponseMessage.

When multiple WarningHeaders are attached to a ResponseMessage, the user agent should display as many of them as possible, in the order that they appear in the ResponseMessage. If it is not possible to display all of the warnings, the user agent first displays warnings that appear early in the ResponseMessage.

The warning code consists of three digits. A first digit of "3" indicates warnings specific to SIP (1xx and 2xx have been taken by HTTP/1.1). This is a list of the currently-defined "warn-code"s, each with a recommended warning text in English, and a description of its meaning. Note that these warnings describe failures induced by the session description.

Warning codes 300 through 329 are reserved for indicating problems with keywords in the session description, 330 through 339 are warnings related to basic network services requested in the session description, 370 through 379 are warnings related to quantitative QoS parameters requested in the session description, and 390 through 399 are miscellaneous warnings that do not fall into one of the above categories.

  • 300 Incompatible network protocol: One or more network protocols contained in the session description are not available.
  • 301 Incompatible network address formats: One or more network address formats contained in the session description are not available.
  • 302 Incompatible transport protocol: One or more transport protocols described in the session description are not available.
  • 303 Incompatible bandwidth units: One or more bandwidth measurement units contained in the session description were not understood.
  • 304 Media type not available: One or more media types contained in the session description are not available.
  • 305 Incompatible media format: One or more media formats contained in the session description are not available.
  • 306 Attribute not understood: One or more of the media attributes in the session description are not supported.
  • 307 Session description parameter not understood: A parameter other than those listed above was not understood.
  • 330 Multicast not available: The site where the user is located does not support multicast.
  • 331 Unicast not available: The site where the user is located does not support unicast communication (usually due to the presence of a firewall).
  • 370 Insufficient bandwidth: The bandwidth specified in the session description or defined by the media exceeds that known to be available.
  • 399 Miscellaneous warning: The warning text can include arbitrary information to be presented to a human user, or logged. A system receiving this warning MUST NOT take any automated action.
  • Version:
    0.6

    Field Summary
    static java.lang.String token
              Token of WarningHeader
     
    Fields inherited from class jain.protocol.ip.sip.header.Header
    ENTITY_HEADER, GENERAL_HEADER, REQUEST_HEADER, RESPONSE_HEADER
     
    Constructor Summary
    WarningHeader(int code, java.net.InetAddress agentHost, java.lang.String text)
              Creates a WarningHeader based on given code, agent host and text
    WarningHeader(int code, java.lang.String agentPseudonym, java.lang.String text)
              Creates a WarningHeader based on given code, agent pseudonym and text
     
    Method Summary
     java.lang.Object clone()
              Creates and returns a copy of WarningHeader
     boolean equals(WarningHeader warningHeader)
              Indicates whether some other WarningHeader is "equal to" this one
     java.net.InetAddress getAgentHost()
              Gets agent host of WarningHeader
     int getAgentPort()
              Gets agent port of WarningHeader
     java.lang.String getAgentPseudonym()
              Gets agent pseudonym of WarningHeader
     int getCode()
              Gets code of WarningHeader
     java.lang.String getText()
              Gets text of WarningHeader
     java.lang.String getValue()
              Gets value of WarningHeader
     boolean hasAgentHost()
              Returns boolean value indicating if WarningHeader has agent host
     boolean hasAgentPort()
              Returns boolean value indicating if WarningHeader has agent port
     boolean hasAgentPseudonym()
              Returns boolean value indicating if WarningHeader has agent pseudonym
     void removeAgentPort()
              Removes agent port from WarningHeader
     void setAgentHost(java.net.InetAddress agentHost)
              Sets agent host of WarningHeader
     void setAgentPort(int agentPort)
              Sets agent port of WarningHeader
     void setAgentPseudonym(java.lang.String agentPseudonym)
              Sets agent pseudonym of WarningHeader
     void setCode(int code)
              Sets code of WarningHeader
     void setText(java.lang.String text)
              Sets text of WarningHeader
     
    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 java.lang.String token
    Token of WarningHeader
    Constructor Detail

    WarningHeader

    public WarningHeader(int code,
                         java.net.InetAddress agentHost,
                         java.lang.String text)
    Creates a WarningHeader based on given code, agent host and text
    Parameters:
    code - code
    agentHost - agent host
    text - text
    Throws:
    java.lang.IllegalArgumentException - if code is not a 3-digit number, or if agentHost is null, or if text is null or zero-length

    WarningHeader

    public WarningHeader(int code,
                         java.lang.String agentPseudonym,
                         java.lang.String text)
    Creates a WarningHeader based on given code, agent pseudonym and text
    Parameters:
    code - code
    agentPseudonym - agent pseudonym
    text - text
    Throws:
    java.lang.IllegalArgumentException - if code is not a 3-digit number, or if agentPseudonym or text are null or zero-length
    Method Detail

    getCode

    public int getCode()
    Gets code of WarningHeader
    Returns:
    code of WarningHeader

    getAgentHost

    public java.net.InetAddress getAgentHost()
                                      throws ParameterNotSetException
    Gets agent host of WarningHeader
    Returns:
    agent host of WarningHeader
    Throws:
    ParameterNotSetException - if agent host does not exist

    hasAgentHost

    public boolean hasAgentHost()
    Returns boolean value indicating if WarningHeader has agent host
    Returns:
    boolean value indicating if WarningHeader has agent host

    getAgentPort

    public int getAgentPort()
                     throws ParameterNotSetException
    Gets agent port of WarningHeader
    Returns:
    agent port of WarningHeader
    Throws:
    ParameterNotSetException - if agent port does not exist

    hasAgentPort

    public boolean hasAgentPort()
    Returns boolean value indicating if WarningHeader has agent port
    Returns:
    boolean value indicating if WarningHeader has agent port

    removeAgentPort

    public void removeAgentPort()
    Removes agent port from WarningHeader

    getAgentPseudonym

    public java.lang.String getAgentPseudonym()
                                       throws ParameterNotSetException
    Gets agent pseudonym of WarningHeader
    Returns:
    agent pseudonym of WarningHeader
    Throws:
    ParameterNotSetException - if agent pseudonym does not exist

    hasAgentPseudonym

    public boolean hasAgentPseudonym()
    Returns boolean value indicating if WarningHeader has agent pseudonym
    Returns:
    boolean value indicating if WarningHeader has agent pseudonym

    getText

    public java.lang.String getText()
    Gets text of WarningHeader
    Returns:
    text of WarningHeadert

    setCode

    public void setCode(int code)
                 throws java.lang.IllegalArgumentException
    Sets code of WarningHeader
    Parameters:
    code - code
    Throws:
    java.lang.IllegalArgumentException - if code is not 3-digit number

    setAgentHost

    public void setAgentHost(java.net.InetAddress agentHost)
                      throws java.lang.IllegalArgumentException
    Sets agent host of WarningHeader
    Parameters:
    agentHost - agent host
    Throws:
    java.lang.IllegalArgumentException - if agentHost is null

    setAgentPort

    public void setAgentPort(int agentPort)
                      throws java.lang.IllegalArgumentException,
                             SipException
    Sets agent port of WarningHeader
    Parameters:
    agentPort - agent port
    Throws:
    SipException - if agent host does not exist
    java.lang.IllegalArgumentException - if agentPort is negative

    setAgentPseudonym

    public void setAgentPseudonym(java.lang.String agentPseudonym)
                           throws java.lang.IllegalArgumentException
    Sets agent pseudonym of WarningHeader
    Parameters:
    agentPseudonym - agent pseudonym
    Throws:
    java.lang.IllegalArgumentException - if agentPseudonym is null or zero-length

    setText

    public void setText(java.lang.String text)
                 throws java.lang.IllegalArgumentException
    Sets text of WarningHeader
    Parameters:
    text - text
    Throws:
    java.lang.IllegalArgumentException - if text is null or zero-length

    getValue

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

    clone

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

    equals

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


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


    Copyright - 2000 Sun Microsystems