1/*
2 * This source code has been contributed to the public domain by Mobicents
3 *
4 * This software is provided by NIST as a service and is expressly
5 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
6 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
7 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
8 * AND DATA ACCURACY.  NIST does not warrant or make any representations
9 * regarding the use of the software or the results thereof, including but
10 * not limited to the correctness, accuracy, reliability or usefulness of
11 * the software.
12 *
13 * Permission to use this software is contingent upon your acceptance
14 * of the terms of this agreement.
15 */
16package gov.nist.javax.sip;
17
18import java.util.EventObject;
19
20import javax.sip.Dialog;
21
22/**
23 *
24 * DialogAckTimeoutEvent is delivered to the Listener when the
25 * dialog does not receive or send an ACK.
26 *
27 *
28 * @author jean deruelle
29 * @since v2.0
30 *
31 */
32public class DialogTimeoutEvent extends EventObject {
33	private static final long serialVersionUID = -2514000059989311925L;
34	public enum Reason {AckNotReceived, AckNotSent,ReInviteTimeout};
35	/**
36     * Constructs a DialogTerminatedEvent to indicate a dialog
37     * timeout.
38     *
39     * @param source - the source of TimeoutEvent.
40     * @param dialog - the dialog that timed out.
41     */
42     public DialogTimeoutEvent(Object source, Dialog dialog, Reason reason) {
43         super(source);
44         m_dialog = dialog;
45         m_reason = reason;
46
47    }
48
49    /**
50     * Gets the Dialog associated with the event. This
51     * enables application developers to access the dialog associated to this
52     * event.
53     *
54     * @return the dialog associated with the response event or null if there is no dialog.
55     * @since v1.2
56     */
57    public Dialog getDialog() {
58        return m_dialog;
59    }
60
61    /**
62     * The reason for the Dialog Timeout Event being delivered to the application.
63     *
64     * @return the reason for the timeout event.
65     */
66    public Reason getReason() {
67    	return m_reason;
68    }
69
70    // internal variables
71    private Dialog m_dialog = null;
72    private Reason m_reason = null;
73}
74
75