Bonjour,
j'ai un petit problème d'heritage tout bête que je n'arrive pas à résoudre
Voici mes 2 classes
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
public class LdapUserDetailsImpl implements LdapUserDetails {
 
        protected String dn;
 
        protected List authorities = AuthorityUtils.NO_AUTHORITIES;
 
        protected boolean accountNonExpired = true;
 
        protected boolean accountNonLocked = true;
 
        protected boolean credentialsNonExpired = true;
 
        protected boolean enabled = true;
 
        // PPolicy data
        protected int timeBeforeExpiration = Integer.MAX_VALUE;
 
        protected int graceLoginsRemaining = Integer.MAX_VALUE;
 
 
        public String getPassword() {
            return null;
        }
 
        public String getUsername() {
            return null;
        }
 
 
        public String getDn() {
            return dn;
        }
 
        public void setDn(String dn) {
            this.dn = dn;
        }
 
        public List getAuthorities() {
            return authorities;
        }
 
        public void setAuthorities(List authorities) {
            this.authorities = authorities;
        }
 
        public boolean isAccountNonExpired() {
            return accountNonExpired;
        }
 
        public void setAccountNonExpired(boolean accountNonExpired) {
            this.accountNonExpired = accountNonExpired;
        }
 
        public boolean isAccountNonLocked() {
            return accountNonLocked;
        }
 
        public void setAccountNonLocked(boolean accountNonLocked) {
            this.accountNonLocked = accountNonLocked;
        }
 
        public boolean isCredentialsNonExpired() {
            return credentialsNonExpired;
        }
 
        public void setCredentialsNonExpired(boolean credentialsNonExpired) {
            this.credentialsNonExpired = credentialsNonExpired;
        }
 
        public boolean isEnabled() {
            return enabled;
        }
 
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
 
        public int getTimeBeforeExpiration() {
            return timeBeforeExpiration;
        }
 
        public void setTimeBeforeExpiration(int timeBeforeExpiration) {
            this.timeBeforeExpiration = timeBeforeExpiration;
        }
 
        public int getGraceLoginsRemaining() {
            return graceLoginsRemaining;
        }
 
        public void setGraceLoginsRemaining(int graceLoginsRemaining) {
            this.graceLoginsRemaining = graceLoginsRemaining;
        }
}
et

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
public class Person extends LdapUserDetailsImpl {
     protected String cn;
     protected String mail;
     protected String sn;
     protected String uid;
     protected byte[] userPassword;
 
 
     public Person() {
     }
 
 
    public void setCn(String cn) {
        this.cn = cn;
    }
 
    public void setSn(String sn) {
        this.sn = sn;
    }
 
    public void setUid(String uid) {
        this.uid = uid;
    }
 
    public void setUserPassword(byte[] userPassword) {
        this.userPassword = userPassword;
    }
 
    public byte[] getUserPassword() {
 
        return userPassword;
    }
 
    public String getUid() {
 
        return uid;
    }
 
    public String getCn() {
         return cn;
     }
     public String getSn() {
         return sn;
     }
 
     public String getEmail() {
        return mail;
    }
 
 
	public void setMail(String mail) {
		this.mail = mail;
 
	}
 
}
dans une troisième classe j''instancie un objet Person et il ne propose pas les methode de la classe mère

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class PersonAttributesMapper implements AttributesMapper {

        public Object mapFromAttributes(Attributes attrs) throws NamingException {
            Person person = new Person();
            person.setCn((String)attrs.get("cn").get());
            person.setCn((String)attrs.get("sn").get());
            person.setUid((String)attrs.get("uid").get());
            person.setMail((String)attrs.get("mail").get());
            person.setUserPassword((byte [])attrs.get("userPassword").get());
            

            person.setAuthorities(....);         REFUSE
            person.setAccountNonExpired(...)    REFUSE
            
        return person;
        }
}
En d'autres termes, il me refuse d'utiliser les methodes de la classe mère
Est ce que quelqu'un pourrait dire ce qui ne va pas ? Merci d'avance