01: /*
02: * TimeDescription.java
03: *
04: * Created on January 9, 2002, 11:13 AM
05: */
06:
07: package javax.sdp;
08:
09: import java.io.*;
10: import java.util.*;
11:
12: /** A TimeDescription represents the fields present within a SDP time description.
13: *
14: * Quoting from RFC 2327:
15: *
16: * Multiple "t=" fields may be used if a session is active at multiple
17: * irregularly spaced times; each additional
18: * "t=" field specifies an additional period of time for which the session
19: * will be active. If the session is active at
20: * regular times, an "r=" field (see below) should be used in addition to and
21: * following a "t=" field - in which
22: * case the "t=" field specifies the start and stop times of the repeat sequence.
23: *
24: * Please refer to IETF RFC 2327 for a description of SDP.
25: *
26: * @author deruelle
27: * @version 1.0
28: */
29: public interface TimeDescription extends Serializable, Cloneable {
30:
31: /** Constant used to translate between NTP time used in SDP and "native" Java time.
32: * NTP time is defined as the
33: * number of seconds relative to midnight, January 1, 1900 and Java time is
34: * measured in number of milliseconds
35: * since midnight, January 1, 1970 UTC (see System#currentTimeMillis()}).
36: *
37: * The value of this constant is 2208988800L. It can be used to convert between
38: * NTP and Java time using the
39: * following formulas:
40: *
41: * ntpTime = javaTime/1000 * SdpConstants.NTP_CONST;
42: * javaTime = (ntpTime - SdpConstants.NTP_CONST) * 1000;
43: *
44: *
45: * The Network Time Protocol (NTP) is defined in RFC 1305.
46: */
47: public static final long NTP_CONST = 2208988800L;
48:
49: /** Returns the Time field.
50: * @return Time
51: */
52: public Time getTime() throws SdpParseException;
53:
54: /** Sets the Time field.
55: * @param t Time to set
56: * @throws SdpException if the time is null
57: */
58: public void setTime(Time t) throws SdpException;
59:
60: /** Returns the list of repeat times (r= fields) specified in the SessionDescription.
61: * @param create boolean to set
62: * @return Vector
63: */
64: public Vector getRepeatTimes(boolean create);
65:
66: /** Returns the list of repeat times (r= fields) specified in the SessionDescription.
67: * @param repeatTimes Vector to set
68: * @throws SdpException if the parameter is null
69: */
70: public void setRepeatTimes(Vector repeatTimes) throws SdpException;
71:
72: }
|