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  /***
20   * With the EventsAction you can specify what kind of events should be sent to
21   * this manager connection.
22   * 
23   * @author srt
24   * @version $Id: EventsAction.java,v 1.4 2005/08/07 00:09:42 srt Exp $
25   */
26  public class EventsAction extends AbstractManagerAction
27  {
28      /***
29       * Serializable version identifier
30       */
31      static final long serialVersionUID = -8042435402644984875L;
32  
33      private String eventMask;
34  
35      /***
36       * Creates a new empty EventsAction.
37       */
38      public EventsAction()
39      {
40  
41      }
42  
43      /***
44       * Creates a new EventsAction that applies the given event mask to the
45       * current manager connection.
46       * 
47       * @param eventMask the event mask. Set to "on" if all events should be
48       *            send, "off" if not events should be sent or a combination of
49       *            "system", "call" and "log" (separated by ',') to specify what
50       *            kind of events should be sent.
51       * @since 0.2
52       */
53      public EventsAction(String eventMask)
54      {
55          this.eventMask = eventMask;
56      }
57  
58      /***
59       * Returns the name of this action, i.e. "Events".
60       */
61      public String getAction()
62      {
63          return "Events";
64      }
65  
66      /***
67       * Returns the event mask.
68       */
69      public String getEventMask()
70      {
71          return eventMask;
72      }
73  
74      /***
75       * Sets the event mask.<br>
76       * Set to "on" if all events should be send, "off" if not events should be
77       * sent or a combination of "system", "call" and "log" (separated by ',') to
78       * specify what kind of events should be sent.
79       */
80      public void setEventMask(String eventMask)
81      {
82          this.eventMask = eventMask;
83      }
84  }