View Javadoc

1   /*
2    * Copyright  2004-2005 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 net.sf.asterisk.manager.event;
18  
19  /***
20   * A DNDStateEvent is triggered by the Zap channel driver when a channel enters
21   * or leaves DND (do not disturb) state.<br>
22   * It is implemented in <code>channels/chan_zap.c</code>.<br>
23   * Available since Asterisk 1.2
24   * 
25   * @author srt
26   * @version $Id: DNDStateEvent.java,v 1.3 2005/08/28 12:20:53 srt Exp $
27   * @since 0.2
28   */
29  public class DNDStateEvent extends ManagerEvent
30  {
31      /***
32       * Serializable version identifier
33       */
34      static final long serialVersionUID = 5906599407896179295L;
35  
36      /***
37       * The name of the channel.
38       */
39      private String channel;
40  
41      /***
42       * The DND state of the channel.
43       */
44      private String state;
45  
46      /***
47       * Creates a new DNDStateEvent.
48       * 
49       * @param source
50       */
51      public DNDStateEvent(Object source)
52      {
53          super(source);
54      }
55  
56      /***
57       * Returns the name of the channel. The channel name is of the form
58       * "Zap/&lt;channel number&gt;".
59       */
60      public String getChannel()
61      {
62          return channel;
63      }
64  
65      /***
66       * Sets the name of the channel.
67       */
68      public void setChannel(String channel)
69      {
70          this.channel = channel;
71      }
72  
73      /***
74       * Returns DND state of the channel.
75       * 
76       * @return "enabled" if do not disturb is on, "disabled" if it is off.
77       */
78      public String getState()
79      {
80          return state;
81      }
82  
83      /***
84       * Sets the DND state of the channel.
85       */
86      public void setState(String state)
87      {
88          this.state = state;
89      }
90  }