001: /*
002: * RepeatTime.java
003: *
004: * Created on December 20, 2001, 3:09 PM
005: */
006:
007: package javax.sdp;
008:
009: /** A RepeatTime represents a r= field contained within a TimeDescription.
010: *
011: * A RepeatTime specifies the repeat times for a SessionDescription.
012: *
013: * This consists of a "repeat interval", an "active duration", and a list of offsets relative to the t=
014: * start-time (see Time.getStart()).
015: *
016: * Quoting from RFC 2327:
017: *
018: * For example, if a session is active at 10am on Monday and 11am on Tuesday for
019: * one hour each week for three months, then the <start time> in the corresponding
020: * "t=" field would be the NTP representation of 10am on the first Monday, the
021: * <repeat interval> would be 1 week, the <active duration> would be 1 hour, and
022: * the offsets would be zero and 25 hours. The corresponding "t=" field stop time
023: * would be the NTP representation of the end of the last session three months later.
024: * By default all fields are in seconds, so the "r=" and "t=" fields might be:
025: *
026: * t=3034423619 3042462419
027: * r=604800 3600 0 90000
028: *
029: *
030: * Please refer to IETF RFC 2327 for a description of SDP.
031: *
032: * @author deruelle
033: * @version 1.0
034: */
035: public interface RepeatTime extends Field {
036:
037: /** Returns the "repeat interval" in seconds.
038: * @throws SdpParseException
039: * @return the "repeat interval" in seconds.
040: */
041: public int getRepeatInterval() throws SdpParseException;
042:
043: /** Set the "repeat interval" in seconds.
044: * @param repeatInterval the "repeat interval" in seconds.
045: * @throws SdpException if repeatInterval is <0
046: */
047: public void setRepeatInterval(int repeatInterval)
048: throws SdpException;
049:
050: /** Returns the "active duration" in seconds.
051: * @throws SdpParseException
052: * @return the "active duration" in seconds.
053: */
054: public int getActiveDuration() throws SdpParseException;
055:
056: /** Sets the "active duration" in seconds.
057: * @param activeDuration the "active duration" in seconds.
058: * @throws SdpException if the active duration is <0
059: */
060: public void setActiveDuration(int activeDuration)
061: throws SdpException;
062:
063: /** Returns the list of offsets. These are relative to the start-time given
064: * in the Time object (t=
065: * field) with which this RepeatTime is associated.
066: * @throws SdpParseException
067: * @return the list of offsets
068: */
069: public int[] getOffsetArray() throws SdpParseException;
070:
071: /** Set the list of offsets. These are relative to the start-time given in the
072: * Time object (t=
073: * field) with which this RepeatTime is associated.
074: * @param offsets array of repeat time offsets
075: * @throws SdpException
076: */
077: public void setOffsetArray(int[] offsets) throws SdpException;
078:
079: /** Returns whether the field will be output as a typed time or a integer value.
080: *
081: * Typed time is formatted as an integer followed by a unit character. The unit indicates an
082: * appropriate multiplier for the integer.
083: *
084: * The following unit types are allowed.
085: * d - days (86400 seconds)
086: * h - hours (3600 seconds)
087: * m - minutes (60 seconds)
088: * s - seconds ( 1 seconds)
089: * @throws SdpParseException
090: * @return true, if the field will be output as a typed time; false, if as an integer value.
091: */
092: public boolean getTypedTime() throws SdpParseException;
093:
094: /** Sets whether the field will be output as a typed time or a integer value.
095: *
096: * Typed time is formatted as an integer followed by a unit character. The unit indicates an
097: * appropriate multiplier for the integer.
098: *
099: * The following unit types are allowed.
100: * d - days (86400 seconds)
101: * h - hours (3600 seconds)
102: * m - minutes (60 seconds)
103: * s - seconds ( 1 seconds)
104: * @param typedTime typedTime - if set true, the start and stop times will be output in an optimal typed
105: * time format; if false, the times will be output as integers.
106: */
107: public void setTypedTime(boolean typedTime);
108: }
|