else throw new PublisherConnectionException("Error binding to and reading from LDAP server. ");
throw new PublisherConnectionException("Error binding to and reading from LDAP server. ");
	public void testConnection(Admin admin) throws PublisherConnectionException{	    int ldapVersion = LDAPConnection.LDAP_V3;        LDAPConnection lc = null;        if(getUseSSL()){          lc = new LDAPConnection(new LDAPJSSESecureSocketFactory());        }else{          lc = new LDAPConnection();                }        LDAPEntry entry = null;        try {            // connect to the server            lc.connect(getHostname(), Integer.parseInt(getPort()));            // authenticate to the server            lc.bind(ldapVersion, getLoginDN(), getLoginPassword());            // try to read the old object            entry = lc.read(getBaseDN());            // disconnect with the server            lc.disconnect();                        log.debug("Entry" + entry.toString());                        if(entry == null)              throw new PublisherConnectionException("Couldn't find bindDN.");        } catch (LDAPException e) {        	log.error("Error binding to LDAP server: ", e);            if(e.getMessage() != null)                throw new PublisherConnectionException("Error binding to and reading from LDAP server: " + e.getMessage());              else                throw new PublisherConnectionException("Error binding to and reading from LDAP server. ");                                    }	} 