JSIP API v1.2
November 2006

javax.sip.header
Interface ReasonHeader

All Superinterfaces:
java.lang.Cloneable, Header, Parameters, java.io.Serializable

public interface ReasonHeader
extends Parameters, Header

This interface represents the Reason header, as defined by RFC3326, this header is not part of RFC3261.

The ReasonHeader provides information on why a SIP request was issued, often useful when creating services and also used to encapsulate a final status code in a provisional response, which is needed to resolve the "Heterogeneous Error Response Forking Problem".

The Reason header field appears to be most useful for BYE and CANCEL requests, but it can appear in any request within a dialog, in any CANCEL request and in 155 (Update Requested) responses. When used in requests, clients and servers are free to ignore this header field. It has no impact on protocol processing.

Examples of the ReasonHeader usage are:

A server must ignore Headers that it does not understand. A proxy must not remove or modify Headers that it does not understand.

Author:
BEA Systems, NIST

Field Summary
static java.lang.String NAME
          Name of ReasonHeader
 
Method Summary
 int getCause()
          Gets the cause value of the ReasonHeader
 java.lang.String getProtocol()
          Gets the protocol value of the ReasonHeader
 java.lang.String getText()
          Gets the text value of the ReasonHeader
 void setCause(int cause)
          Sets the cause value of the ReasonHeader.
 void setProtocol(java.lang.String protocol)
          Sets the protocol of the ReasonHeader, for example SIP or Q.850.
 void setText(java.lang.String text)
          Sets the text value of the ReasonHeader.
 
Methods inherited from interface javax.sip.header.Parameters
getParameter, getParameterNames, removeParameter, setParameter
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, hashCode, toString
 

Field Detail

NAME

static final java.lang.String NAME
Name of ReasonHeader

See Also:
Constant Field Values
Method Detail

getCause

int getCause()
Gets the cause value of the ReasonHeader

Returns:
the integer value of the cause of the ReasonHeader

setCause

void setCause(int cause)
              throws InvalidArgumentException
Sets the cause value of the ReasonHeader. Any SIP status code MAY appear in the Reason header field of a request, assuming the protocol field of the ReasonHeader is SIP.

Parameters:
cause - - the new integer value of the cause of the ReasonHeader
Throws:
InvalidArgumentException - if the cause value is less than zero.

setProtocol

void setProtocol(java.lang.String protocol)
                 throws java.text.ParseException
Sets the protocol of the ReasonHeader, for example SIP or Q.850.

Parameters:
protocol - - the new string value of the protocol of the ReasonHeader
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the protocol value.

getProtocol

java.lang.String getProtocol()
Gets the protocol value of the ReasonHeader

Returns:
the string value of the protocol of the ReasonHeader

setText

void setText(java.lang.String text)
             throws java.text.ParseException
Sets the text value of the ReasonHeader.

Parameters:
text - - the new string value of the text of the ReasonHeader
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the text value.

getText

java.lang.String getText()
Gets the text value of the ReasonHeader

Returns:
the string value of the text of the ReasonHeader

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems