| | |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | | |
| | | import static com.forgerock.opendj.util.OperatingSystem.isWindows; |
| | | |
| | | import java.io.File; |
| | | import java.net.InetAddress; |
| | | import java.util.Collection; |
| | |
| | | |
| | | import com.forgerock.opendj.cli.CliConstants; |
| | | |
| | | import static com.forgerock.opendj.cli.Utils.*; |
| | | import static com.forgerock.opendj.util.OperatingSystem.*; |
| | | |
| | | import static org.opends.admin.ads.util.ConnectionUtils.*; |
| | | |
| | | /** |
| | | * This is the classes that is shared among all the different places in the |
| | | * Control Panel. It contains information about the server status and |
| | |
| | | toRemove.add(i); |
| | | } |
| | | } |
| | | |
| | | if (!toRemove.isEmpty()) |
| | | { |
| | | boolean returnValue = modifiedIndexes.removeAll(toRemove); |
| | | indexModified(toRemove.iterator().next()); |
| | | return returnValue; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | else if (lastRemoteAdministrationURL != null) |
| | | { |
| | | ctx = Utils.createLdapsContext(lastRemoteAdministrationURL, |
| | | ctx = createLdapsContext(lastRemoteAdministrationURL, |
| | | lastWorkingBindDN, |
| | | lastWorkingBindPwd, |
| | | getConnectTimeout(), null, |
| | | getTrustManager()); |
| | | getTrustManager(), null); |
| | | } |
| | | } |
| | | catch (ConfigReadException cre) |
| | |
| | | regenerateDescriptor(); |
| | | Thread.sleep(poolingPeriod); |
| | | } |
| | | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | // been called). |
| | | return localAdminConnectorURL; |
| | | } |
| | | else |
| | | { |
| | | return adminConnectorURL; |
| | | } |
| | | return adminConnectorURL; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | else |
| | | { |
| | | url = sProtocol +"://"+ |
| | | ConnectionUtils.getHostNameForLdapUrl(server.getHostname())+ |
| | | ":"+port; |
| | | url = sProtocol + "://" + getHostNameForLdapUrl(server.getHostname()) + ":" + port; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (server.isLocal()) |
| | | { |
| | | InetAddress address = addresses.first(); |
| | | url = sProtocol +"://"+ |
| | | ConnectionUtils.getHostNameForLdapUrl(address.getHostAddress())+ |
| | | ":"+ |
| | | port; |
| | | url = sProtocol + "://" + getHostNameForLdapUrl(address.getHostAddress()) + ":" + port; |
| | | } |
| | | else |
| | | { |
| | | url = sProtocol +"://"+ |
| | | ConnectionUtils.getHostNameForLdapUrl(server.getHostname())+ |
| | | ":"+port; |
| | | url = sProtocol + "://" + getHostNameForLdapUrl(server.getHostname()) + ":" + port; |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return the Administration Connector URL. |
| | | */ |
| | | private static String getAdminConnectorURL(ServerDescriptor server) { |
| | | String url = null; |
| | | |
| | | ConnectionHandlerDescriptor desc = server.getAdminConnector(); |
| | | if (desc != null) |
| | | { |
| | |
| | | SortedSet<InetAddress> addresses = desc.getAddresses(); |
| | | if (addresses.size() == 0) { |
| | | if (port > 0) { |
| | | url = ConnectionUtils.getLDAPUrl("localhost", port, true); |
| | | return getLDAPUrl("localhost", port, true); |
| | | } |
| | | } else { |
| | | if (port > 0) { |
| | | InetAddress address = addresses.first(); |
| | | String a = address.getHostAddress(); |
| | | url = ConnectionUtils.getLDAPUrl(a, port, true); |
| | | return getLDAPUrl(a, port, true); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | url = null; |
| | | } |
| | | return url; |
| | | return null; |
| | | } |
| | | |
| | | /** |