| | |
| | | |
| | | import java.net.InetAddress; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | |
| | | import org.opends.server.admin.std.server.BackupBackendCfg; |
| | | import org.opends.server.admin.std.server.ConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.CryptoManagerCfg; |
| | | import org.opends.server.admin.std.server.HTTPConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.JMXConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.LDAPConnectionHandlerCfg; |
| | | import org.opends.server.admin.std.server.LDIFBackendCfg; |
| | |
| | | { |
| | | ex.add(ce); |
| | | } |
| | | String[] connectionHandlers = root.listConnectionHandlers(); |
| | | for (int i=0; i<connectionHandlers.length; i++) |
| | | for (String connHandler : root.listConnectionHandlers()) |
| | | { |
| | | try |
| | | { |
| | | ConnectionHandlerCfg connectionHandler = |
| | | root.getConnectionHandler(connectionHandlers[i]); |
| | | ls.add(getConnectionHandler(connectionHandler, |
| | | connectionHandlers[i])); |
| | | root.getConnectionHandler(connHandler); |
| | | ls.add(getConnectionHandler(connectionHandler, connHandler)); |
| | | } |
| | | catch (OpenDsException oe) |
| | | { |
| | |
| | | } |
| | | isSchemaEnabled = root.getGlobalConfiguration().isCheckSchema(); |
| | | |
| | | String[] backendNames = root.listBackends(); |
| | | for (int i=0; i<backendNames.length; i++) |
| | | for (String backendName : root.listBackends()) |
| | | { |
| | | try |
| | | { |
| | | BackendCfg backend = root.getBackend(backendNames[i]); |
| | | BackendCfg backend = root.getBackend(backendName); |
| | | Set<BaseDNDescriptor> baseDNs = new HashSet<BaseDNDescriptor>(); |
| | | for (DN dn : backend.getBaseDN()) |
| | | { |
| | |
| | | { |
| | | type = BackendDescriptor.Type.LOCAL_DB; |
| | | LocalDBBackendCfg db = (LocalDBBackendCfg)backend; |
| | | String[] indexNames = db.listLocalDBIndexes(); |
| | | try |
| | | { |
| | | for (int j=0; j<indexNames.length; j++) |
| | | for (String indexName : db.listLocalDBIndexes()) |
| | | { |
| | | LocalDBIndexCfg index = db.getLocalDBIndex(indexNames[j]); |
| | | LocalDBIndexCfg index = db.getLocalDBIndex(indexName); |
| | | indexes.add(new IndexDescriptor( |
| | | index.getAttribute().getNameOrOID(), index.getAttribute(), |
| | | null, index.getIndexType(), index.getIndexEntryLimit())); |
| | |
| | | indexes.add(new IndexDescriptor("id2subtree", null, null, |
| | | new TreeSet<IndexType>(), -1)); |
| | | |
| | | String[] vlvIndexNames = db.listLocalDBVLVIndexes(); |
| | | try |
| | | { |
| | | for (int j=0; j<vlvIndexNames.length; j++) |
| | | for (String vlvIndexName : db.listLocalDBVLVIndexes()) |
| | | { |
| | | LocalDBVLVIndexCfg index = |
| | | db.getLocalDBVLVIndex(vlvIndexNames[j]); |
| | | db.getLocalDBVLVIndex(vlvIndexName); |
| | | String s = index.getSortOrder(); |
| | | List<VLVSortOrder> sortOrder = getVLVSortOrder(s); |
| | | vlvIndexes.add(new VLVIndexDescriptor(index.getName(), null, |
| | |
| | | String[] domains = sync.listReplicationDomains(); |
| | | if (domains != null) |
| | | { |
| | | for (int i=0; i<domains.length; i++) |
| | | for (String domain2 : domains) |
| | | { |
| | | ReplicationDomainCfg domain = |
| | | sync.getReplicationDomain(domains[i]); |
| | | sync.getReplicationDomain(domain2); |
| | | DN dn = domain.getBaseDN(); |
| | | for (BackendDescriptor backend : bs) |
| | | { |
| | |
| | | as.clear(); |
| | | if (rootUsers != null) |
| | | { |
| | | for (int i=0; i < rootUsers.length; i++) |
| | | for (String rootUser2 : rootUsers) |
| | | { |
| | | RootDNUserCfg rootUser = rootDN.getRootDNUser(rootUsers[i]); |
| | | RootDNUserCfg rootUser = rootDN.getRootDNUser(rootUser2); |
| | | as.addAll(rootUser.getAlternateBindDN()); |
| | | } |
| | | } |
| | |
| | | { |
| | | protocol = ConnectionHandlerDescriptor.Protocol.LDAP; |
| | | } |
| | | SortedSet<InetAddress> v = ldap.getListenAddress(); |
| | | if (v != null) |
| | | { |
| | | addresses.addAll(v); |
| | | } |
| | | addAll(addresses, ldap.getListenAddress()); |
| | | port = ldap.getListenPort(); |
| | | } |
| | | else if (connHandler instanceof HTTPConnectionHandlerCfg) |
| | | { |
| | | HTTPConnectionHandlerCfg http = (HTTPConnectionHandlerCfg) connHandler; |
| | | if (http.isUseSSL()) |
| | | { |
| | | protocol = ConnectionHandlerDescriptor.Protocol.HTTPS; |
| | | } |
| | | else |
| | | { |
| | | protocol = ConnectionHandlerDescriptor.Protocol.HTTP; |
| | | } |
| | | addAll(addresses, http.getListenAddress()); |
| | | port = http.getListenPort(); |
| | | } |
| | | else if (connHandler instanceof JMXConnectionHandlerCfg) |
| | | { |
| | | JMXConnectionHandlerCfg jmx = (JMXConnectionHandlerCfg)connHandler; |
| | |
| | | { |
| | | protocol = ConnectionHandlerDescriptor.Protocol.JMX; |
| | | } |
| | | SortedSet<InetAddress> v = jmx.getListenAddress(); |
| | | if (v != null) |
| | | { |
| | | addresses.addAll(v); |
| | | } |
| | | addAll(addresses, jmx.getListenAddress()); |
| | | port = jmx.getListenPort(); |
| | | } |
| | | else if (connHandler instanceof LDIFConnectionHandlerCfg) |
| | |
| | | { |
| | | protocol = ConnectionHandlerDescriptor.Protocol.SNMP; |
| | | SNMPConnectionHandlerCfg snmp = (SNMPConnectionHandlerCfg)connHandler; |
| | | SortedSet<InetAddress> v = snmp.getListenAddress(); |
| | | if (v != null) |
| | | { |
| | | addresses.addAll(v); |
| | | } |
| | | addAll(addresses, snmp.getListenAddress()); |
| | | port = snmp.getListenPort(); |
| | | } |
| | | else |
| | |
| | | name, emptySet); |
| | | } |
| | | |
| | | private <T> void addAll(Collection<T> target, Collection<T> source) |
| | | { |
| | | if (source != null) |
| | | { |
| | | target.addAll(source); |
| | | } |
| | | } |
| | | |
| | | private ConnectionHandlerDescriptor getConnectionHandler( |
| | | AdministrationConnectorCfg adminConnector) throws OpenDsException |
| | | { |
| | |
| | | ConnectionHandlerDescriptor.State state = |
| | | ConnectionHandlerDescriptor.State.ENABLED; |
| | | |
| | | |
| | | SortedSet<InetAddress> v = adminConnector.getListenAddress(); |
| | | if (v != null) |
| | | { |
| | | addresses.addAll(v); |
| | | } |
| | | addAll(addresses, adminConnector.getListenAddress()); |
| | | int port = adminConnector.getListenPort(); |
| | | Set<CustomSearchResult> emptySet = Collections.emptySet(); |
| | | return new ConnectionHandlerDescriptor(addresses, port, protocol, state, |