| | |
| | | administrativeUsers.clear(); |
| | | replicationConfigured = false; |
| | | replicatedSuffixes.clear(); |
| | | LDIFReader reader = null; |
| | | try |
| | | { |
| | | Installation installation = |
| | | new Installation(Utils.getInstallPathFromClasspath()); |
| | | LDIFImportConfig c = new LDIFImportConfig( |
| | | Utils.getPath(installation.getCurrentConfigurationFile())); |
| | | LDIFReader reader = new LDIFReader(c); |
| | | reader = new LDIFReader(c); |
| | | for (Entry entry = reader.readEntry(false); entry != null; |
| | | entry = reader.readEntry(false)) |
| | | { |
| | |
| | | errorMessage = Utils.getThrowableMsg(getI18n(), |
| | | "error-reading-config-file", null, t); |
| | | } |
| | | finally |
| | | { |
| | | if (reader != null) |
| | | { |
| | | try |
| | | { |
| | | reader.close(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public HashSet<String> getAdministrativeUsers() |
| | | { |
| | | return administrativeUsers; |
| | | HashSet<String> copy = new HashSet<String>(); |
| | | copy.addAll(administrativeUsers); |
| | | return copy; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public HashSet<DatabaseDescriptor> getDatabases() |
| | | { |
| | | return databases; |
| | | HashSet<DatabaseDescriptor> copy = new HashSet<DatabaseDescriptor>(); |
| | | copy.addAll(databases); |
| | | return copy; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public HashSet<ListenerDescriptor> getListeners() |
| | | { |
| | | return listeners; |
| | | HashSet<ListenerDescriptor> copy = new HashSet<ListenerDescriptor>(); |
| | | copy.addAll(listeners); |
| | | return copy; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | if (!isConfigBackend(id)) |
| | | { |
| | | Set<String> baseDns = new TreeSet<String>(); |
| | | baseDns.addAll(getValues(entry, "ds-cfg-backend-base-dn")); |
| | | Set<BaseDNDescriptor> replicas = new LinkedHashSet<BaseDNDescriptor>(); |
| | | Set<String> baseDns = getValues(entry, "ds-cfg-backend-base-dn"); |
| | | TreeSet<BaseDNDescriptor> replicas = new TreeSet<BaseDNDescriptor>(); |
| | | |
| | | DatabaseDescriptor db = new DatabaseDescriptor(id, replicas, nEntries); |
| | | |
| | | for (String baseDn : baseDns) |
| | | { |
| | | replicas.add(getBaseDNDescriptor(entry, baseDn)); |
| | | } |
| | | |
| | | DatabaseDescriptor db = new DatabaseDescriptor(id, replicas, nEntries); |
| | | databases.add(db); |
| | | for (BaseDNDescriptor rep: replicas) |
| | | { |
| | | BaseDNDescriptor rep = getBaseDNDescriptor(entry, baseDn); |
| | | rep.setDatabase(db); |
| | | db.getBaseDns().add(rep); |
| | | } |
| | | databases.add(db); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (replica != null) |
| | | { |
| | | replica.setType(BaseDNDescriptor.Type.REPLICATED); |
| | | } |
| | | replica.setType(BaseDNDescriptor.Type.REPLICATED); } |
| | | } |
| | | } |
| | | } |