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

ExpiresHeader

public class ExpiresHeader extends ParameterLessHeader
Expires SIP Header.
version
JAIN-SIP-1.1 This code is in the public domain. IMPL_NOTE: think about removing the specific parser for ExpiresHeader.

Fields Summary
protected Integer
expires
Expires field.
public static final String
NAME
Expires header field label.
public static Class
clazz
Class handle.
Constructors Summary
public ExpiresHeader()
Default constructor.

    
    
     
        clazz = new ExpiresHeader().getClass();
    
        super(EXPIRES);
    
Methods Summary
public java.lang.StringencodeBody()
Returns canonical form.

return
String

        return expires.toString();
    
public intgetExpires()
Gets the expires value of the ExpiresHeader. This expires value is relative time.

return
the expires value of the ExpiresHeader.
since
JAIN SIP v1.1

        return expires.intValue();
    
public java.lang.ObjectgetValue()
Gets the value for the header as opaque object (returned value will depend upon the header. Note that this is not the same as the getHeaderValue above.

return
the expires header field value

        return expires;
    
public voidsetExpires(int expires)
Sets the relative expires value of the ExpiresHeader. The expires value MUST be greater than zero and MUST be less than 2**31.

param
expires - the new expires value of this ExpiresHeader
throws
InvalidArgumentException if supplied value is less than zero.
since
JAIN SIP v1.1

        if (expires < 0)
            throw new IllegalArgumentException("bad argument " + expires);
        this.expires = new Integer(expires);
    
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);
            setExpires(val);
        } catch (IllegalArgumentException iae) {
            throw iae;
        }