KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > common > users > AdminUser


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
6  * Copyright (C) 2005-2006 Continuent, Inc.
7  * Contact: sequoia@continuent.org
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Initial developer(s): Nicolas Modrzyk
22  * Contributor(s): Emmanuel Cecchet.
23  */

24
25 package org.continuent.sequoia.common.users;
26
27 import org.continuent.sequoia.common.xml.DatabasesXmlTags;
28
29 /**
30  * This class defines a AdminUser
31  *
32  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
33  * @author <a HREF="mailto:Emmanuel.Cecchet@continuent.com">Emmanuel Cecchet</a>
34  * @version 1.0
35  */

36 public class AdminUser extends AbstractDatabaseUser
37 {
38   private static final long serialVersionUID = 5080497103560621226L;
39
40   /**
41    * Creates a new <code>AdminUser</code> instance. The caller must ensure
42    * that the parameters are not <code>null</code>.
43    *
44    * @param login the user name.
45    * @param password the password.
46    */

47   public AdminUser(String JavaDoc login, String JavaDoc password)
48   {
49     super(login, password);
50   }
51
52   /**
53    * @see org.continuent.sequoia.common.users.AbstractDatabaseUser#getXml()
54    */

55   public String JavaDoc getXml()
56   {
57     StringBuffer JavaDoc adminUser = new StringBuffer JavaDoc("<"
58         + DatabasesXmlTags.ELT_AdminUser + " " + DatabasesXmlTags.ATT_username
59         + "=\"" + this.getName() + "\" " + DatabasesXmlTags.ATT_password
60         + "=\"" + this.getPassword() + "\"");
61     if (getAccessControl() == null)
62       adminUser.append("/>");
63     else
64       adminUser.append(">" + getAccessControl().getXml() + "</"
65           + DatabasesXmlTags.ELT_AdminUser + ">");
66     return adminUser.toString();
67   }
68 }
69
Popular Tags