FileDocCategorySizeDatePackage
RSeqHeader.javaAPI DocphoneME MR2 API (J2ME)3770Wed May 02 18:00:42 BST 2007gov.nist.siplite.header

RSeqHeader

public class RSeqHeader extends ParameterLessHeader
RSeq Header. The RSeq header is used in provisional responses in order to transmit them reliably. For details please see RFC 3262, section 7.1

Fields Summary
protected Integer
seqNum
Sequence number field.
public static final String
NAME
Sequence number header field label.
protected static Class
clazz
Handle for class.
Constructors Summary
public RSeqHeader()
Default constructor.

    
    
     
        clazz = new RSeqHeader().getClass();
    
        super(RSEQ);
        seqNum = new Integer(0);
    
public RSeqHeader(int num)
Constructor given a seq number.

param
num the initial sequence number

        super(RSEQ);
        seqNum = new Integer(num);
        headerValue = String.valueOf(num);
    
Methods Summary
public java.lang.Objectclone()
Copies the current instance.

return
copy of the current object

        RSeqHeader retval = new RSeqHeader();
        
        if (seqNum != null) {
            retval.seqNum =
                    new Integer(seqNum.intValue());
        }
        
        return retval;
    
public java.lang.StringencodeBody()
Encodes into a canonical string.

return
String

        if (seqNum == null)
            return "0";
        else
            return seqNum.toString();
    
public intgetRSeqNum()
Gets the sequence number header field.

return
the sequence number

        return seqNum.intValue();
    
public java.lang.ObjectgetValue()
Gets the sequence number header value.

return
the sequence number

        return this.seqNum;
    
public voidsetHeaderValue(java.lang.String value)
Sets the header value field.

param
value is the value field to set.
throws
IllegalArgumentException if the value is invalid.

        int val;
                
        try {
            val = Integer.parseInt(value);
            setRSeqNum(val);
        } catch (IllegalArgumentException iae) {
            throw iae;
        }
    
public voidsetRSeqNum(int num)
Sets the sequence number member.

param
num sequence number to be set

        if (num < 0)
            throw new IllegalArgumentException("parameter is <0");
        
        seqNum = new Integer(num);
        headerValue = String.valueOf(num);