| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.statuspanel; |
| | |
| | | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.admin.ads.ADSContext; |
| | | import org.opends.admin.ads.util.ConnectionUtils; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.util.LDIFException; |
| | | import org.opends.server.util.LDIFReader; |
| | |
| | | if (desc.getState() == ListenerDescriptor.State.ENABLED) |
| | | { |
| | | int port = -1; |
| | | String host = "localhost"; |
| | | try |
| | | { |
| | | String addressPort = desc.getAddressPort(); |
| | |
| | | if (index != -1) |
| | | { |
| | | port = Integer.parseInt(addressPort.substring(index+1)); |
| | | if (index > 0) |
| | | { |
| | | host = addressPort.substring(0, index); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (port != -1) |
| | | { |
| | | url = "ldap://localhost:"+port; |
| | | url = "ldap://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+port; |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | { |
| | | int port = -1; |
| | | String host = "localhost"; |
| | | try |
| | | { |
| | | String addressPort = desc.getAddressPort(); |
| | |
| | | if (index != -1) |
| | | { |
| | | port = Integer.parseInt(addressPort.substring(index+1)); |
| | | if (index > 0) |
| | | { |
| | | host = addressPort.substring(0, index); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | if (!secure && |
| | | (desc.getProtocol() == ListenerDescriptor.Protocol.LDAP)) |
| | | { |
| | | url = "ldap://localhost:"+port; |
| | | url = "ldap://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+ |
| | | port; |
| | | break; |
| | | } |
| | | if (secure && |
| | | (desc.getProtocol() == ListenerDescriptor.Protocol.LDAPS)) |
| | | { |
| | | url = "ldaps://localhost:"+port; |
| | | url = "ldaps://"+ConnectionUtils.getHostNameForLdapUrl(host)+":"+ |
| | | port; |
| | | break; |
| | | } |
| | | } |