01: /**
02: * $Id: AuthlessUID.java,v 1.3 2006/04/25 19:47:27 rt94277 Exp $
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.admin.console.desktop;
14:
15: /**
16: *
17: * @author rt94277
18: */
19: public class AuthlessUID {
20:
21: /** Creates a new instance of AuthlessUID */
22: public AuthlessUID() {
23: setId(EMPTY_UID + EMPTY_UID_INT);
24: EMPTY_UID_INT++;
25: }
26:
27: public AuthlessUID(String dn) {
28: setId(EMPTY_UID + EMPTY_UID_INT);
29: EMPTY_UID_INT++;
30: setDn(dn);
31: }
32:
33: private String password = null; // Userpassword.
34: private String dn = null; // dn.
35: private boolean defaultUID = false;
36: private String id = null;
37: private static final String EMPTY_UID = "empty";
38: private static int EMPTY_UID_INT = 0;
39:
40: /** Default constructor. */
41: public AuthlessUID(String dn, String password, boolean defaultUID) {
42: this .password = password;
43: this .dn = dn;
44: this .id = dn;
45: this .defaultUID = defaultUID;
46: }
47:
48: /** Get first password. */
49: public String getPassword() {
50: return password;
51: }
52:
53: /** Set password. */
54: public void setPassword(String value) {
55: password = value;
56: }
57:
58: /** Get DN. */
59: public String getDn() {
60: return dn;
61: }
62:
63: /** Set DN. */
64: public void setDn(String value) {
65: dn = value;
66: }
67:
68: public String getId() {
69: return id;
70: }
71:
72: public void setId(String id) {
73: this .id = id;
74: }
75:
76: public boolean getDefaultUID() {
77: return defaultUID;
78: }
79:
80: /** Set DN. */
81: public void setDefaultUID(boolean value) {
82: defaultUID = value;
83: }
84:
85: public boolean isEmpty() {
86: return id.startsWith(EMPTY_UID);
87: }
88:
89: public String toString() {
90: StringBuffer sb = new StringBuffer();
91: sb.append(dn).append("|").append(password);
92: return sb.toString();
93: }
94:
95: }
|