View Javadoc

1   /*
2    * (c) 2004 Stefan Reuter
3    *
4    * Created on Apr 22, 2004
5    */
6   package net.sf.asterisk.manager.action;
7   
8   /***
9    * The MailboxCountAction queries the number of unread and read messages in a
10   * mailbox.<br>
11   * The MailboxCountAction returns a MailboxStatusResponse.
12   * 
13   * @see net.sf.asterisk.manager.response.MailboxCountResponse
14   * @author srt
15   * @version $Id: MailboxCountAction.java,v 1.4 2005/08/07 00:09:42 srt Exp $
16   */
17  public class MailboxCountAction extends AbstractManagerAction
18  {
19      /***
20       * Serializable version identifier
21       */
22      static final long serialVersionUID = -6900421919824575941L;
23  
24      private String mailbox;
25  
26      /***
27       * Creates a new empty MailboxCountAction.
28       */
29      public MailboxCountAction()
30      {
31  
32      }
33  
34      /***
35       * Creates a new MailboxCountAction that queries the number of unread and
36       * read messages in the given mailbox.
37       * 
38       * @param mailbox the name of the mailbox to query.<br>
39       *            This can either be only the number of the mailbox or a string
40       *            of the form mailboxnumber@context.If no context is specified
41       *            "default" is assumed.
42       * @since 0.2
43       */
44      public MailboxCountAction(String mailbox)
45      {
46          this.mailbox = mailbox;
47      }
48  
49      /***
50       * Returns the name of this action, i.e. "MailboxCount".
51       */
52      public String getAction()
53      {
54          return "MailboxCount";
55      }
56  
57      /***
58       * Returns the name of the mailbox to query.
59       */
60      public String getMailbox()
61      {
62          return mailbox;
63      }
64  
65      /***
66       * Sets the name of the mailbox to query.<br>
67       * This can either be only the number of the mailbox or a string of the form
68       * mailboxnumber@context.If no context is specified "default" is assumed.<br>
69       * This property is mandatory.
70       */
71      public void setMailbox(String mailbox)
72      {
73          this.mailbox = mailbox;
74      }
75  }