View Javadoc

1   /*
2    * ------------------------------------------------------------------------------
3    * Hermes FTP Server
4    * Copyright (c) 2005-2007 Lars Behnke
5    * ------------------------------------------------------------------------------
6    * 
7    * This file is part of Hermes FTP Server.
8    * 
9    * Hermes FTP Server is free software; you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as published by
11   * the Free Software Foundation; either version 2 of the License, or
12   * (at your option) any later version.
13   * 
14   * Hermes FTP Server is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public License
20   * along with Hermes FTP Server; if not, write to the Free Software
21   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22   * ------------------------------------------------------------------------------
23   */
24  
25  package net.sf.hermesftp.usermanager.model;
26  
27  import java.util.ArrayList;
28  import java.util.List;
29  
30  /***
31   * Represents the configuration for a particular user; Constructor.
32   */
33  public class UserData {
34  
35      private String       uid;
36  
37      private String       fullName;
38  
39      private String       password;
40  
41      private List<String> groupNames;
42  
43      private String       dir;
44  
45      private boolean      adminRole;
46  
47      /***
48       * Getter method for the java bean <code>uid</code>.
49       * 
50       * @return Returns the value of the java bean <code>uid</code>.
51       */
52      public String getUid() {
53          return uid;
54      }
55  
56      /***
57       * Setter method for the java bean <code>uid</code>.
58       * 
59       * @param uid The value of uid to set.
60       */
61      public void setUid(String uid) {
62          this.uid = uid;
63      }
64  
65      /***
66       * Getter method for the java bean <code>password</code>.
67       * 
68       * @return Returns the value of the java bean <code>password</code>.
69       */
70      public String getPassword() {
71          return password;
72      }
73  
74      /***
75       * Setter method for the java bean <code>password</code>.
76       * 
77       * @param password The value of password to set.
78       */
79      public void setPassword(String password) {
80          this.password = password;
81      }
82  
83      /***
84       * Getter method for the java bean <code>fullName</code>.
85       * 
86       * @return Returns the value of the java bean <code>fullName</code>.
87       */
88      public String getFullName() {
89          return fullName;
90      }
91  
92      /***
93       * Setter method for the java bean <code>fullName</code>.
94       * 
95       * @param fullName The value of fullName to set.
96       */
97      public void setFullName(String fullName) {
98          this.fullName = fullName;
99      }
100 
101     /***
102      * Getter method for the java bean <code>groupNames</code>.
103      * 
104      * @return Returns the value of the java bean <code>groupNames</code>.
105      */
106     public List<String> getGroupNames() {
107         if (groupNames == null) {
108             groupNames = new ArrayList<String>();
109         }
110         return groupNames;
111     }
112 
113     /***
114      * Adds the name of a group the user belongs to.
115      * 
116      * @param name The group name.
117      */
118     public void addGroupName(String name) {
119         getGroupNames().add(name);
120     }
121 
122     /***
123      * Setter method for the java bean <code>groupNames</code>.
124      * 
125      * @param groupNames The value of groupNames to set.
126      */
127     public void setGroupNames(List<String> groupNames) {
128         this.groupNames = groupNames;
129     }
130 
131     /***
132      * Getter method for the java bean <code>dir</code>.
133      * 
134      * @return Returns the value of the java bean <code>dir</code>.
135      */
136     public String getDir() {
137         return dir;
138     }
139 
140     /***
141      * Setter method for the java bean <code>dir</code>.
142      * 
143      * @param dir The value of dir to set.
144      */
145     public void setDir(String dir) {
146         this.dir = dir;
147     }
148 
149     /***
150      * Getter method for the java bean <code>adminRole</code>.
151      * 
152      * @return Returns the value of the java bean <code>adminRole</code>.
153      */
154     public boolean isAdminRole() {
155         return adminRole;
156     }
157 
158     /***
159      * Setter method for the java bean <code>adminRole</code>.
160      * 
161      * @param adminRole The value of adminRole to set.
162      */
163     public void setAdminRole(boolean adminRole) {
164         this.adminRole = adminRole;
165     }
166 
167 }