View Javadoc

1   /*
2    *  Copyright 2004-2006 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package org.asteriskjava.manager.event;
18  
19  /***
20   * A HangupEvent is triggered when a channel is hung up.<p>
21   * It is implemented in <code>channel.c</code>
22   * 
23   * @author srt
24   * @version $Id: HangupEvent.java 476 2006-07-14 11:45:58Z srt $
25   */
26  public class HangupEvent extends AbstractChannelStateEvent
27  {
28      /***
29       * Serializable version identifier
30       */
31      static final long serialVersionUID = 650153034857116588L;
32  
33      private Integer cause;
34      private String causeTxt;
35  
36      /***
37       * @param source
38       */
39      public HangupEvent(Object source)
40      {
41          super(source);
42      }
43  
44      /***
45       * Returns the cause of the hangup.
46       * @see org.asteriskjava.live.HangupCause
47       */
48      public Integer getCause()
49      {
50          return cause;
51      }
52  
53      /***
54       * Sets the cause of the hangup.
55       */
56      public void setCause(Integer cause)
57      {
58          this.cause = cause;
59      }
60  
61      /***
62       * Returns the textual representation of the hangup cause.
63       * 
64       * @return the textual representation of the hangup cause.
65       * @since 0.2
66       */
67      public String getCauseTxt()
68      {
69          return causeTxt;
70      }
71  
72      /***
73       * Sets the textual representation of the hangup cause.
74       * 
75       * @param causeTxt the textual representation of the hangup cause.
76       * @since 0.2
77       */
78      public void setCauseTxt(String causeTxt)
79      {
80          this.causeTxt = causeTxt;
81      }
82  }