Project

General

Profile

1
package eu.dnetlib.openaire.user.store;
2

    
3
import com.unboundid.ldap.sdk.LDAPConnection;
4
import com.unboundid.ldap.sdk.LDAPException;
5
import org.apache.log4j.Logger;
6

    
7
/**
8
 * Created by sofia on 3/10/2016.
9
 */
10
public class LDAPConnector
11
{
12

    
13
    private String address;
14
    private String username;
15
    private String usersDN;
16
    private String password;
17
    private int port;
18

    
19
    private static Logger logger = Logger.getLogger(LDAPConnector.class);
20

    
21

    
22
    public LDAPConnection getConnection() throws LDAPException {
23
        logger.debug("Getting ldap connection");
24
        return new LDAPConnection(address, port, username, password);
25
    }
26

    
27
    public String getAddress() {
28
        return address;
29
    }
30

    
31
    public void setAddress(String address) {
32
        this.address = address;
33
    }
34

    
35
    public String getUsername() {
36
        return username;
37
    }
38

    
39
    public void setUsername(String username) {
40
        this.username = username;
41
    }
42

    
43
    public String getUsersDN() {
44
        return usersDN;
45
    }
46

    
47
    public void setUsersDN(String usersDN) {
48
        this.usersDN = usersDN;
49
    }
50

    
51
    public String getPassword() {
52
        return password;
53
    }
54

    
55
    public void setPassword(String password) {
56
        this.password = password;
57
    }
58

    
59
    public int getPort() {
60
        return port;
61
    }
62

    
63
    public void setPort(int port) {
64
        this.port = port;
65
    }
66
}
67

    
(3-3/4)