| | |
| | | import org.opends.server.tools.ConfigureDS; |
| | | import org.opends.server.tools.ConfigureWindowsService; |
| | | import org.opends.server.tools.JavaPropertiesTool; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.LDIFExportConfig; |
| | | import org.opends.server.types.OpenDsException; |
| | | import org.opends.server.util.LDIFException; |
| | |
| | | * @throws ApplicationException |
| | | * if something goes wrong. |
| | | */ |
| | | public void createBackend(ConnectionWrapper conn, String backendName, Set<String> baseDNs, |
| | | public void createBackend(ConnectionWrapper conn, String backendName, Set<DN> baseDNs, |
| | | ManagedObjectDefinition<? extends BackendCfgClient, ? extends BackendCfg> backendType) |
| | | throws ApplicationException |
| | | { |
| | |
| | | RootCfgClient root = conn.getRootConfiguration(); |
| | | BackendCfgClient backend = root.createBackend(backendType, backendName, null); |
| | | backend.setEnabled(true); |
| | | backend.setBaseDN(toDNs(baseDNs)); |
| | | backend.setBaseDN(baseDNs); |
| | | backend.setBackendId(backendName); |
| | | backend.setWritabilityMode(BackendCfgDefn.WritabilityMode.ENABLED); |
| | | backend.commit(); |
| | |
| | | } |
| | | } |
| | | |
| | | private Set<DN> toDNs(Set<String> strings) throws DirectoryException |
| | | { |
| | | Set<DN> results = new HashSet<>(); |
| | | for (String s : strings) |
| | | { |
| | | results.add(DN.valueOf(s)); |
| | | } |
| | | return results; |
| | | } |
| | | |
| | | /** |
| | | * Configures the replication on a given server. |
| | | * @param conn the connection to the server where we want to configure |