KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > ac > UserType


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
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
18 package org.apache.lenya.ac;
19
20 /**
21  * A user type to be supported by the UserManager
22  * Note: the types are configured through access control (ac.xconf)
23  *
24  * @version $Id:$
25  */

26 public class UserType {
27     private String JavaDoc key;
28     private String JavaDoc className;
29     private String JavaDoc createUseCase;
30
31     /**
32      * Ctor.
33      */

34     public UserType() {
35     }
36
37     /**
38      * Ctor.
39      *
40      * @param key The key.
41      * @param className The class name.
42      * @param createUseCase The create usecase.
43      */

44     public UserType(String JavaDoc key, String JavaDoc className, String JavaDoc createUseCase) {
45       this.key = key;
46       this.className = className;
47       this.createUseCase = createUseCase;
48     }
49
50     /**
51      * Get the key to be used for this type.
52      * This key can be used for a dictionary entry for the user interface.
53      *
54      * @return a <code>String</code>
55      */

56     public String JavaDoc getKey() {
57       return key;
58     }
59     
60     /**
61      * Set the key to be used for this type.
62      * This key can be used for a dictionary entry for the user interface.
63      *
64      * @param key the new key
65      */

66     public void setKey(String JavaDoc key) {
67       this.key = key;
68     }
69     
70     /**
71      * Get the name of the class responsible for implementing this
72      * type of user. Note that in current version, this field is for
73      * information only; in later versions, it might be used for
74      * introspection and dynamic script creation.
75      *
76      * @see org.apache.lenya.ac.file.FileUser
77      * @see org.apache.lenya.ac.ldap.LDAPUser
78      * @return a <code>String</code> the name of the class
79      */

80     public String JavaDoc getClassName() {
81       return className;
82     }
83     
84     /**
85      * Set the name of the class responsible for implementing this
86      * type of user. Note that in current version, this field is for
87      * information only; in later versions, it might be used for
88      * introspection and dynamic flowscript creation.
89      *
90      * @param className the new className
91      */

92     public void setClassName(String JavaDoc className) {
93       this.className = className;
94     }
95     
96     /**
97      * Get the createUseCase name to be used when a user of this type
98      * is to be created.
99      * This name will be used in the flowscript (currently: user-admin.js),
100      * in order to distinguish between different types.
101      *
102      * @return a <code>String</code> the name of the use case in the flowscript
103      */

104     public String JavaDoc getCreateUseCase() {
105       return createUseCase;
106     }
107     
108     /**
109      * Set the createUseCase name to be used when a user of this type
110      * is to be created.
111      * This name will be used in the flowscript (currently: user-admin.js),
112      * in order to distinguish between different types.
113      *
114      * @param createUseCase the new createUseCase
115      */

116     public void setCreateUseCase(String JavaDoc createUseCase) {
117       this.createUseCase = createUseCase;
118     }
119     
120 }
121
Popular Tags