001: /**
002: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
003: * Unpublished - rights reserved under the Copyright Laws of the United States.
004: * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
005: * Copyright © 2005 BEA Systems, Inc. All rights reserved.
006: *
007: * Use is subject to license terms.
008: *
009: * This distribution may include materials developed by third parties.
010: *
011: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
012: *
013: * Module Name : JSIP Specification
014: * File Name : ExpiresHeader.java
015: * Author : Phelim O'Doherty
016: *
017: * HISTORY
018: * Version Date Author Comments
019: * 1.1 08/10/2002 Phelim O'Doherty
020: *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
021: */package javax.sip.header;
022:
023: import javax.sip.InvalidArgumentException;
024:
025: /**
026:
027: * The Expires header field gives the relative time after which the message
028:
029: * (or content) expires. The precise meaning of this is method dependent.
030:
031: * The expiration time in an INVITE does not affect the duration of the
032:
033: * actual session that may result from the invitation. Session description
034:
035: * protocols may offer the ability to express time limits on the session
036:
037: * duration, however.
038:
039: * The value of this field is an integral number of seconds (in decimal)
040:
041: * between 0 and (2**32)-1, measured from the receipt of the request. Malformed
042:
043: * values SHOULD be treated as equivalent to 3600.
044:
045: * <p>
046:
047: * This interface represents the Expires entity-header. The ExpiresHeader is
048:
049: * optional in both REGISTER and INVITE Requests.
050:
051: * <ul>
052:
053: * <li>REGISTER - When a client sends a REGISTER request, it MAY suggest an
054:
055: * expiration interval that indicates how long the client would like the
056:
057: * registration to be valid. There are two ways in which a client can suggest
058:
059: * an expiration interval for a binding: through an Expires header field or an
060:
061: * "expires" Contact header parameter. The latter allows expiration intervals
062:
063: * to be suggested on a per-binding basis when more than one binding is given
064:
065: * in a single REGISTER request, whereas the former suggests an expiration
066:
067: * interval for all Contact header field values that do not contain the
068:
069: * "expires" parameter.
070:
071: * <li> INVITE - The UAC MAY add an Expires header field to limit the validity
072:
073: * of the invitation. If the time indicated in the Expires header field is
074:
075: * reached and no final answer for the INVITE has been received, the UAC core
076:
077: * SHOULD generate a CANCEL request for the INVITE.
078:
079: * </ul>
080:
081: * Example:<br>
082:
083: * <code>Expires: 5</code>
084:
085: *
086: * @author BEA Systems, NIST
087: * @version 1.2
088:
089: */
090:
091: public interface ExpiresHeader extends Header {
092:
093: /**
094: * Sets the relative expires value of the ExpiresHeader in units of seconds.
095: * The expires value MUST be between zero and (2**31)-1.
096: *
097: * @param expires - the new expires value of this ExpiresHeader
098: * @throws InvalidArgumentException if supplied value is less than zero.
099: */
100:
101: public void setExpires(int expires) throws InvalidArgumentException;
102:
103: /**
104: * Gets the expires value of the ExpiresHeader. This expires value is
105: * relative time.
106: *
107: * @return the expires value of the ExpiresHeader.
108: */
109:
110: public int getExpires();
111:
112: /**
113: * Name of ExpiresHeader
114: */
115: public final static String NAME = "Expires";
116:
117: }
|