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 QueueParamsEvent is triggered in response to a QueueStatusAction and contains the parameters of
21   * a queue.<br>
22   * It is implemented in <code>apps/app_queue.c</code>
23   * 
24   * @see net.sf.asterisk.manager.action.QueueStatusAction
25   * 
26   * @author srt
27   * @version $Id: QueueParamsEvent.java,v 1.3 2005/07/15 11:44:23 srt Exp $
28   */
29  public class QueueParamsEvent extends ResponseEvent
30  {
31      /***
32       * Serializable version identifier
33       */
34      private static final long serialVersionUID = -170511596914604717L;
35      private String queue;
36      private Integer max;
37      private Integer calls;
38      private Integer holdtime;
39      private Integer completed;
40      private Integer abandoned;
41      private Integer serviceLevel;
42      private Double serviceLevelPerf;
43      private Integer weight;
44  
45      /***
46       * @param source
47       */
48      public QueueParamsEvent(Object source)
49      {
50          super(source);
51      }
52  
53      /***
54       * Returns the name of the queue.
55       */
56      public String getQueue()
57      {
58          return queue;
59      }
60  
61      /***
62       * Sets the name of the queue.
63       */
64      public void setQueue(String queue)
65      {
66          this.queue = queue;
67      }
68  
69      /***
70       * Returns the maximum number of people waiting in the queue or 0 for unlimited.<br>
71       * This corresponds to the <code>maxlen</code> setting in <code>queues.conf</code>.
72       */
73      public Integer getMax()
74      {
75          return max;
76      }
77  
78      /***
79       * Sets the maximum number of people waiting in the queue.
80       */
81      public void setMax(Integer max)
82      {
83          this.max = max;
84      }
85  
86      /***
87       * Returns the number of calls currently waiting in the queue.
88       */
89      public Integer getCalls()
90      {
91          return calls;
92      }
93  
94      /***
95       * Sets the number of calls currently waiting in the queue.
96       */
97      public void setCalls(Integer calls)
98      {
99          this.calls = calls;
100     }
101 
102     /***
103      * Returns the current average holdtime for this queue (in seconds).
104      */
105     public Integer getHoldtime()
106     {
107         return holdtime;
108     }
109 
110     /***
111      * Sets the current average holdtime for this queue.
112      */
113     public void setHoldtime(Integer holdtime)
114     {
115         this.holdtime = holdtime;
116     }
117 
118     /***
119      * Returns the number of completed calls.
120      */
121     public Integer getCompleted()
122     {
123         return completed;
124     }
125 
126     /***
127      * Sets the number of completed calls.
128      */
129     public void setCompleted(Integer complete)
130     {
131         this.completed = complete;
132     }
133 
134     /***
135      * Returns the number of abandoned calls.
136      */
137     public Integer getAbandoned()
138     {
139         return abandoned;
140     }
141 
142     /***
143      * Sets the number of abandoned calls.
144      */
145     public void setAbandoned(Integer abandoned)
146     {
147         this.abandoned = abandoned;
148     }
149 
150     /***
151      * Returns the service level (in seconds) as defined by the <code>servicelevel</code> setting
152      * in <code>queues.conf</code>.
153      */
154     public Integer getServiceLevel()
155     {
156         return serviceLevel;
157     }
158 
159     /***
160      * Sets the service level.
161      */
162     public void setServiceLevel(Integer serviceLevel)
163     {
164         this.serviceLevel = serviceLevel;
165     }
166 
167     /***
168      * Returns the ratio of calls answered within the specified service level per total completed
169      * calls (in percent).
170      */
171     public Double getServiceLevelPerf()
172     {
173         return serviceLevelPerf;
174     }
175 
176     /***
177      * Sets the ratio of calls answered within the specified service level per total completed
178      * calls.
179      */
180     public void setServiceLevelPerf(Double serviceLevelPerf)
181     {
182         this.serviceLevelPerf = serviceLevelPerf;
183     }
184 
185     /***
186      * Returns the weight of this queue.<br>
187      * A queues can be assigned a 'weight' to ensure calls waiting in a 
188      * higher priority queue will deliver its calls first. Only delays 
189      * the lower weight queue's call if the member is also in the 
190      * higher weight queue.<br>
191      * Available since Asterisk 1.2
192      * 
193      * @return the weight of this queue or <code>null</code> if not 
194      *         supported by your version of Asterisk
195      * @since 0.2
196      */
197     public Integer getWeight()
198     {
199         return weight;
200     }
201 
202     /***
203      * Sets the weight of this queue.
204      * 
205      * @param weight the weight of this queue
206      * @since 0.2
207      */
208     public void setWeight(Integer weight)
209     {
210         this.weight = weight;
211     }
212 }