adContext.setRequestControls(new Control[] { new PagedResultsControl(resultPageSize, cookie, Control.CRITICAL) });
} while (cookie != null);
- //on enregistre la date de synchronisation
+ // on enregistre la date de synchronisation
updateLastSyncParameter(adCurrentTime);
connection.commit();
-
+
endTime = System.currentTimeMillis();
logger.info("Synchronisation AD : " + String.format("%.2g", (endTime - startTime) / 1000.0) + " s");
traitement.setEnd(System.currentTimeMillis());
}
- protected NamingEnumeration getAdUsers(DirContext adContext, String baseDn, String filter, String syncDate) throws NamingException {
+ protected NamingEnumeration<?> getAdUsers(DirContext adContext, String baseDn, String filter, String syncDate) throws NamingException {
SearchControls searchCtrl = new SearchControls();
searchCtrl.setSearchScope(SearchControls.SUBTREE_SCOPE);
return (Long) JdbcUtils.queryObject(connection, getUserIdQuery, new RowMapper.ColToLongRowMapper(), binder.toPStmtBinder());
}
-
+
protected Long getUserIdFromGuid(Connection connection, String guid) throws SQLException {
String getUserIdQuery = queryProvider.getQuery("getUserIdFromGuid");
SimplePStmtBinderBuilder binder = new SimplePStmtBinderBuilder();
}
protected void updateUserProfiles(Connection connection, ActiveDirectoryUser adUser) throws SQLException {
+ String mainAdminAllPower = queryProvider.getQuery("updateUserProfiles.allPower");
String cleanQuery = queryProvider.getQuery("updateUserProfiles.clean");
String fillQuery = queryProvider.getQuery("updateUserProfiles.insertProfiles");
Long userId = getUserIdFromGuid(connection, adUser.getGuid());
binder.add(userId);
if (adGroupDN.equals(mainAdminDn)) {
+ JdbcUtils.executeUpdate(connection, mainAdminAllPower, binder.toPStmtBinder());
binder.add(XEM_MAIN_ADMIN_PROFILE);
JdbcUtils.executeUpdate(connection, fillQuery, binder.toPStmtBinder());
} else if (adGroupDN.equals(delegAdminDn)) {