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 MessageWaitingEvent is triggered when someone leaves voicemail.<br>
21   * It is implemented in <code>apps/app_voicemail.c</code>
22   * 
23   * @author srt
24   * @version $Id: MessageWaitingEvent.java,v 1.3 2005/08/27 03:33:34 srt Exp $
25   */
26  public class MessageWaitingEvent extends ManagerEvent
27  {
28      /***
29       * Serializable version identifier
30       */
31      private static final long serialVersionUID = 7014587245968686266L;
32      private String mailbox;
33      private Integer waiting;
34      private Integer newMessages;
35      private Integer oldMessages;
36  
37      /***
38       * @param source
39       */
40      public MessageWaitingEvent(Object source)
41      {
42          super(source);
43      }
44  
45      /***
46       * Returns the name of the mailbox that has waiting messages.<br>
47       * The name of the mailbox is of the form numberOfMailbox@context, e.g.
48       * 1234@default.
49       * 
50       * @return the name of the mailbox that has waiting messages
51       */
52      public String getMailbox()
53      {
54          return mailbox;
55      }
56  
57      /***
58       * Sets the name of the mailbox that has waiting messages.
59       * 
60       * @param mailbox the name of the mailbox that has waiting messages
61       */
62      public void setMailbox(String mailbox)
63      {
64          this.mailbox = mailbox;
65      }
66  
67      /***
68       * Returns the number of new messages in the mailbox.
69       * 
70       * @return the number of new messages in the mailbox
71       */
72      public Integer getWaiting()
73      {
74          return waiting;
75      }
76  
77      /***
78       * Sets the number of new messages in the mailbox.
79       * 
80       * @param waiting the number of new messages in the mailbox
81       */
82      public void setWaiting(Integer waiting)
83      {
84          this.waiting = waiting;
85      }
86  
87      /***
88       * Returns the number of new messages in this mailbox.
89       * @return the number of new messages in this mailbox.
90       * @since 0.2
91       */
92      public Integer getNew()
93      {
94          return newMessages;
95      }
96  
97      /***
98       * Sets the number of new messages in this mailbox.
99       * @param newMessages the number of new messages in this mailbox.
100      * @since 0.2
101      */
102     public void setNew(Integer newMessages)
103     {
104         this.newMessages = newMessages;
105     }
106 
107     /***
108      * Returns the number of old messages in this mailbox.
109      * @return the number of old messages in this mailbox.
110      * @since 0.2
111      */
112     public Integer getOld()
113     {
114         return oldMessages;
115     }
116 
117     /***
118      * Sets the number of old messages in this mailbox.
119      * @param oldMessages the number of old messages in this mailbox.
120      * @since 0.2
121      */
122     public void setOld(Integer oldMessages)
123     {
124         this.oldMessages = oldMessages;
125     }
126 }