]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.core/src/org/argeo/osgi/useradmin/LdifUser.java
1 package org
.argeo
.osgi
.useradmin
;
3 import java
.util
.ArrayList
;
4 import java
.util
.Dictionary
;
7 import javax
.naming
.directory
.Attributes
;
8 import javax
.naming
.ldap
.LdapName
;
10 import org
.osgi
.service
.useradmin
.User
;
12 class LdifUser
implements User
{
14 List
<LdifGroup
> directMemberOf
= new ArrayList
<LdifGroup
>();
16 private final LdapName dn
;
17 private Attributes attributes
;
19 LdifUser(LdapName dn
, Attributes attributes
) {
21 this.attributes
= attributes
;
25 public String
getName() {
30 public int getType() {
35 public Dictionary
<String
, Object
> getProperties() {
36 if (attributes
== null)
37 throw new ArgeoUserAdminException(
38 "Must be loaded from user admin service");
39 return new AttributeDictionary(attributes
);
43 public Dictionary
<String
, Object
> getCredentials() {
44 // TODO Auto-generated method stub
49 public boolean hasCredential(String key
, Object value
) {
50 // TODO Auto-generated method stub
54 protected LdapName
getDn() {
58 protected Attributes
getAttributes() {
63 public int hashCode() {
68 public boolean equals(Object obj
) {
71 if (obj
instanceof LdifUser
) {
72 LdifUser that
= (LdifUser
) obj
;
73 return this.dn
.equals(that
.dn
);
79 public String
toString() {