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   * An AlarmEvent is triggered when a Zap channel enters or changes alarm state.<br>
21   * It is implemented in <code>channels/chan_zap.c</code>
22   * 
23   * @author srt
24   * @version $Id: AlarmEvent.java,v 1.2 2005/02/23 22:50:58 srt Exp $
25   */
26  public class AlarmEvent extends ManagerEvent
27  {
28      /***
29       * Serializable version identifier
30       */
31      private static final long serialVersionUID = 5235245336934457877L;
32      private String alarm;
33      private Integer channel;
34  
35      /***
36       * @param source
37       */
38      public AlarmEvent(Object source)
39      {
40          super(source);
41      }
42  
43      /***
44       * Returns the kind of alarm that happened.<br>
45       * This may be one of
46       * <ul>
47       * <li>Red Alarm</li>
48       * <li>Yellow Alarm</li>
49       * <li>Blue Alarm</li>
50       * <li>Recovering</li>
51       * <li>Loopback</li>
52       * <li>Not Open</li>
53       * </ul>
54       */
55      public String getAlarm()
56      {
57          return alarm;
58      }
59  
60      /***
61       * Sets the kind of alarm that happened.
62       */
63      public void setAlarm(String alarm)
64      {
65          this.alarm = alarm;
66      }
67  
68      /***
69       * Returns the number of the channel the alarm occured on.
70       */
71      public Integer getChannel()
72      {
73          return channel;
74      }
75  
76      /***
77       * Sets the number of the channel the alarm occured on.
78       */
79      public void setChannel(Integer channel)
80      {
81          this.channel = channel;
82      }
83  }