001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: */
018:
019: package org.apache.lenya.ac;
020:
021: /**
022: * A user type to be supported by the UserManager
023: * Note: the types are configured through the access control configuration
024: *
025: * @version $Id: UserType.java 473861 2006-11-12 03:51:14Z gregor $
026: */
027: public class UserType {
028: private String key;
029: private String className;
030: private String createUseCase;
031:
032: /**
033: * Ctor.
034: */
035: public UserType() {
036: // do nothing
037: }
038:
039: /**
040: * Ctor.
041: * @param _key The key.
042: * @param _className The class name.
043: * @param _createUseCase The create usecase.
044: */
045: public UserType(String _key, String _className,
046: String _createUseCase) {
047: this .key = _key;
048: this .className = _className;
049: this .createUseCase = _createUseCase;
050: }
051:
052: /**
053: * Get the key to be used for this type.
054: * This key can be used for a dictionary entry for the user interface.
055: * @return a <code>String</code>
056: */
057: public String getKey() {
058: return this .key;
059: }
060:
061: /**
062: * Set the key to be used for this type.
063: * This key can be used for a dictionary entry for the user interface.
064: * @param _key the new key
065: */
066: public void setKey(String _key) {
067: this .key = _key;
068: }
069:
070: /**
071: * Get the name of the class responsible for implementing this
072: * type of user. Note that in current version, this field is for
073: * information only; in later versions, it might be used for
074: * introspection and dynamic script creation.
075: * @see org.apache.lenya.ac.file.FileUser
076: * @see org.apache.lenya.ac.ldap.LDAPUser
077: * @return a <code>String</code> the name of the class
078: */
079: public String getClassName() {
080: return this .className;
081: }
082:
083: /**
084: * Set the name of the class responsible for implementing this
085: * type of user. Note that in current version, this field is for
086: * information only; in later versions, it might be used for
087: * introspection and dynamic flowscript creation.
088: * @param _className the new className
089: */
090: public void setClassName(String _className) {
091: this .className = _className;
092: }
093:
094: /**
095: * Get the createUseCase name to be used when a user of this type
096: * is to be created.
097: * This name will be used in the flowscript (currently: user-admin.js),
098: * in order to distinguish between different types.
099: * @return a <code>String</code> the name of the use case in the flowscript
100: */
101: public String getCreateUseCase() {
102: return this .createUseCase;
103: }
104:
105: /**
106: * Set the createUseCase name to be used when a user of this type
107: * is to be created.
108: * This name will be used in the flowscript (currently: user-admin.js),
109: * in order to distinguish between different types.
110: * @param _createUseCase the new createUseCase
111: */
112: public void setCreateUseCase(String _createUseCase) {
113: this.createUseCase = _createUseCase;
114: }
115:
116: }
|