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.action;
18  
19  import net.sf.asterisk.manager.event.QueueStatusCompleteEvent;
20  
21  /***
22   * The QueueStatusAction requests the state of all defined queues their members
23   * (agents) and entries (callers).<br>
24   * For each queue a QueueParamsEvent is generated, followed by a
25   * QueueMemberEvent for each member of that queue and a QueueEntryEvent for each
26   * entry in the queue.<br>
27   * Since Asterisk 1.2 a QueueStatusCompleteEvent is sent to denote the end of
28   * the generated dump.<br>
29   * This action is implemented in <code>apps/app_queue.c</code>
30   * 
31   * @see net.sf.asterisk.manager.event.QueueParamsEvent
32   * @see net.sf.asterisk.manager.event.QueueMemberEvent
33   * @see net.sf.asterisk.manager.event.QueueEntryEvent
34   * @see net.sf.asterisk.manager.event.QueueStatusCompleteEvent
35   * @author srt
36   * @version $Id: QueueStatusAction.java,v 1.7 2005/08/27 10:09:16 srt Exp $
37   */
38  public class QueueStatusAction extends AbstractManagerAction
39          implements
40              EventGeneratingAction
41  {
42      /***
43       * Serializable version identifier
44       */
45      private static final long serialVersionUID = -8599401015517232869L;
46  
47      private String queue;
48      private String member;
49  
50      /***
51       * Creates a new QueueStatusAction.
52       */
53      public QueueStatusAction()
54      {
55  
56      }
57  
58      /***
59       * Returns the name of this action, i.e. "QueueStatus".
60       */
61      public String getAction()
62      {
63          return "QueueStatus";
64      }
65  
66      /***
67       * Returns the queue filter.
68       * 
69       * @return the queue filter.
70       * @since 0.2
71       */
72      public String getQueue()
73      {
74          return queue;
75      }
76  
77      /***
78       * Sets the queue filter. If set QueueParamEvents are only generated for the
79       * given queue name.
80       * 
81       * @param queue the queue filter.
82       * @since 0.2
83       */
84      public void setQueue(String queue)
85      {
86          this.queue = queue;
87      }
88  
89      /***
90       * Returns the member filter.
91       * 
92       * @return the member filter.
93       * @since 0.2
94       */
95      public String getMember()
96      {
97          return member;
98      }
99  
100     /***
101      * Sets the member filter. If set QueueMemberEvents are only generated for the
102      * given member name.
103      * 
104      * @param member the member filter.
105      * @since 0.2
106      */
107     public void setMember(String member)
108     {
109         this.member = member;
110     }
111 
112     public Class getActionCompleteEventClass()
113     {
114         return QueueStatusCompleteEvent.class;
115     }
116 }