Oved Ourfali has posted comments on this change.

Change subject: core: Supporting hard coded ldap servers per domain
......................................................................


Patch Set 1: (7 inline comments)

Minor comments.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/DirectorySearcher.java
Line 80:         List<?> response = null;
Line 81: 
Line 82:         for (Iterator<URI> iterator = ldapServerURIs.iterator(); 
iterator.hasNext();) {
Line 83:             URI ldapURI = iterator.next();
Line 84:             response = 
findAndOrderServers(queryData,ldapURI,domainName,resultCount,ldapServerURIs);
space this line a bit.
Line 85:             if (response != null) {
Line 86:                 break;
Line 87:             }
Line 88:         }


Line 119:         } catch (Exception exception) {
Line 120:             LdapSearchExceptionHandlingResponse handlingResponse = 
handler.handle(exception,ldapCredentials);
Line 121:             Exception translatedException = 
handlingResponse.getTranslatedException();
Line 122:             setException(translatedException);
Line 123:             
LdapServersOrderingAlgorithmFactory.getInstance().getOrderingAlgorithm(handlingResponse.getOrderingAlgorithm()).replaceLdapServerInList(ldapURI,
 modifiedLdapServersURIs);
reoreder
Line 124:             log.errorFormat("Failed ldap search server {0} due to 
{1}. We {2} try the next server",
Line 125:                     ldapURI,
Line 126:                     
LdapBrokerUtils.getFriendlyExceptionMessage(translatedException),
Line 127:                     handlingResponse.isTryNextServer() ? "should" : 
"should not");


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/Domain.java
Line 66:         }
Line 67:     }
Line 68: 
Line 69:     /*
Line 70:     public void scoreLdapServer(URI ldapURI, Score score) {
delete this method if not in use.
Line 71:         ScorableLDAPServer server = ldapServers.get(ldapURI);
Line 72:         if (server != null) {
Line 73:             server.setScore(score.getValue());
Line 74:             if (log.isDebugEnabled()) {


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/UsersDomainsCacheManagerService.java
Line 87:                     if (uris == null) {
Line 88:                         uris = new ArrayList<URI>();
Line 89:                         ldapServerPerDomain.put(domain,uris);
Line 90:                     }
Line 91:                     for (String ldapServer:ldapServers) {
space this one.
Line 92:                         ldapURI = new URI("ldap://"; + 
ldapServer.trim() + ":" + ldapPort);
Line 93:                         uris.add(ldapURI);
Line 94:                     }
Line 95:                 } catch (URISyntaxException e) {


Line 223: 
Line 224:         List<URI> ldapServers = 
ldapServerPerDomain.get(domain.getName());
Line 225: 
Line 226:         if (ldapServers != null) {
Line 227:             for (URI ldapServerURI:ldapServers) {
space it
Line 228:                 domain.addLDAPServer(ldapServerURI);
Line 229:             }
Line 230:             return;
Line 231:         }


Line 242:             }
Line 243:             for (int counter = 0; counter < 
results.getNumOfValidAddresses(); counter++) {
Line 244:                 String address = results.getAddresses()[counter];
Line 245:                 try {
Line 246:                     URI ldapURI = locator.constructURI("LDAP", 
address,null);
space it.
Line 247:                     domain.addLDAPServer(ldapURI);
Line 248:                 } catch (URISyntaxException e) {
Line 249:                     log.errorFormat("Error in getting LDAP url based 
on srv record for address {0}", address);
Line 250:                 }


....................................................
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/dns/DnsSRVLocator.java
Line 345:         }
Line 346:         return results;
Line 347:     }
Line 348: 
Line 349:     public URI constructURI(String protocol, String address, String 
defaultLdapSeverPort) throws URISyntaxException {
consider factoring it out somewhere, and using it where you construct the LDAP 
url.
Line 350:         String[] parts = address.split("\\.:");
Line 351:         String hostname = address;
Line 352:         String port = defaultLdapSeverPort;
Line 353:         if (parts.length == 2) {


--
To view, visit http://gerrit.ovirt.org/11064
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic0914f2f6d9432ecac0cebee3790eae902a1329a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to