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   * Adds or updates an entry in the Asterisk database for a given family, key,
21   * and value.<br>
22   * Available since Asterisk 1.2
23   * 
24   * @author srt
25   * @version $Id: DBPutAction.java,v 1.3 2005/08/07 00:09:42 srt Exp $
26   * @since 0.2
27   */
28  public class DBPutAction extends AbstractManagerAction
29  {
30      /***
31       * Serial version identifier
32       */
33      private static final long serialVersionUID = 921037572305993779L;
34      private String family;
35      private String key;
36      private String val;
37  
38      /***
39       * Creates a new empty DBPutAction.
40       */
41      public DBPutAction()
42      {
43  
44      }
45  
46      /***
47       * Creates a new DBPutAction that sets the value of the database entry with
48       * the given key in the given family.
49       * 
50       * @param family the family of the key
51       * @param key the key of the entry to set
52       * @param val the value to set
53       * @since 0.2
54       */
55      public DBPutAction(String family, String key, String val)
56      {
57          this.family = family;
58          this.key = key;
59          this.val = val;
60      }
61  
62      public String getAction()
63      {
64          return "DBPut";
65      }
66  
67      /***
68       * Returns the family of the key to set.
69       * 
70       * @return the family of the key to set.
71       */
72      public String getFamily()
73      {
74          return family;
75      }
76  
77      /***
78       * Sets the family of the key to set.
79       * 
80       * @param family the family of the key to set.
81       */
82      public void setFamily(String family)
83      {
84          this.family = family;
85      }
86  
87      /***
88       * Returns the the key to set.
89       * 
90       * @return the key to set.
91       */
92      public String getKey()
93      {
94          return key;
95      }
96  
97      /***
98       * Sets the key to set.
99       * 
100      * @param key the key to set.
101      */
102     public void setKey(String key)
103     {
104         this.key = key;
105     }
106 
107     /***
108      * Returns the value to set.
109      * 
110      * @return the value to set.
111      */
112     public String getVal()
113     {
114         return val;
115     }
116 
117     /***
118      * Sets the value to set.
119      * 
120      * @param val the value to set.
121      */
122     public void setVal(String val)
123     {
124         this.val = val;
125     }
126 }