1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager;
18
19 /***
20 * An EventTimeoutException is thrown if a ManagerResponse or some
21 * ResponseEvents are not completely received within the expected time period.<br>
22 * This exception allows you to retrieve the partial result, that is the events
23 * that have been successfully received before the timeout occured.
24 *
25 * @author srt
26 * @version $Id: EventTimeoutException.java,v 1.3 2005/10/25 23:25:12 srt Exp $
27 * @since 0.2
28 */
29 public class EventTimeoutException extends TimeoutException
30 {
31 /***
32 * Serial version identifier.
33 */
34 private static final long serialVersionUID = 5461825583966922L;
35 private final ResponseEvents partialResult;
36
37 /***
38 * Creates a new EventTimeoutException with the given message and partial
39 * result.
40 *
41 * @param message message with details about the timeout.
42 * @param partialResult the ResponseEvents object filled with the parts that
43 * have been received before the timeout occured.
44 */
45 public EventTimeoutException(String message, ResponseEvents partialResult)
46 {
47 super(message);
48 this.partialResult = partialResult;
49 }
50
51 /***
52 * Returns the partial result that has been received before the timeout
53 * occured.<br>
54 * Note: Using the partial result in your application should be avoided
55 * wherever possible. This is only a hack to handle those versions of
56 * Asterisk that don't follow the Manager API conventions, for example by
57 * not sending the correct ActionCompleteEvent.
58 *
59 * @return the ResponseEvents object filled with the parts that have been
60 * received before the timeout occured. Note: The response attribute
61 * may be <code>null</code> when no response has been received.
62 */
63 public ResponseEvents getPartialResult()
64 {
65 return partialResult;
66 }
67 }