001: package de.webman.acl;
002:
003: import com.teamkonzept.lib.TKException;
004: import com.teamkonzept.lib.TKVector;
005: import de.webman.acl.db.PropertyDBData;
006:
007: /**
008: * A property holds a configuration value associated to a login.
009: *
010: * @version 1.0
011: * @since 1.0
012: * @author © 2001 Webman AG
013: */
014: public class Property extends WMObject {
015:
016: // $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/Property.java,v 1.1 2001/08/20 08:25:07 mischa Exp $
017:
018: // Attributes
019:
020: /**
021: * The login of the property.
022: */
023: private Integer login = null;
024:
025: /**
026: * The name of the property.
027: */
028: private String name = null;
029:
030: /**
031: * The value of the property.
032: */
033: private String value = null;
034:
035: // Constructors
036:
037: /**
038: * Provide instantion only to package classes or subclasses.
039: *
040: * @param data the initial property data.
041: */
042: protected Property(PropertyDBData data) {
043: super (data);
044:
045: this .login = data.getLogin();
046: this .name = data.getName();
047: this .value = data.getValue();
048: }
049:
050: // Method implementations
051:
052: /**
053: * Returns the factory of the object.
054: *
055: * @return the factory of the object.
056: * @exception com.teamkonzept.lib.TKException if an error occured during factory retrieval.
057: */
058: public final ObjectFactory getFactory() throws TKException {
059: return PropertyFactory.getInstance();
060: }
061:
062: /**
063: * Returns the name of the property.
064: *
065: * @return the name of the property.
066: */
067: public final String getName() {
068: return name;
069: }
070:
071: /**
072: * Assigns the name of the property.
073: *
074: * @param name the name of the property.
075: */
076: public final void setName(String name) {
077: super .modifyAttribute(this .name, name);
078: this .name = name;
079: }
080:
081: /**
082: * Returns the value of the property.
083: *
084: * @return the value of the property.
085: */
086: public final String getValue() {
087: return value;
088: }
089:
090: /**
091: * Assigns the value of the property.
092: *
093: * @param value the value of the property.
094: */
095: public final void setValue(String value) {
096: super .modifyAttribute(this .value, value);
097: this .value = value;
098: }
099:
100: /**
101: * Returns the ID of the login of the property.
102: *
103: * @return the ID of the login of the property.
104: */
105: public final Integer getLoginID() {
106: return login;
107: }
108:
109: /**
110: * Returns the login of the property.
111: *
112: * @return the login of the property.
113: * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
114: */
115: public final Login getLogin() throws TKException {
116: return login != null ? (Login) LoginFactory.getInstance()
117: .getObject(login) : null;
118: }
119:
120: }
|