| | |
| | | import java.util.logging.Logger; |
| | | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.util.LDIFException; |
| | | import org.opends.server.util.LDIFReader; |
| | | import org.opends.server.types.Attribute; |
| | |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.guitools.i18n.ResourceProvider; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.quicksetup.Installation; |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | |
| | | /** |
| | | * This class is used to retrieve configuration information directly from the |
| | | * config.ldif file. |
| | |
| | | private HashSet<DatabaseDescriptor> databases = |
| | | new HashSet<DatabaseDescriptor>(); |
| | | private HashSet<String> administrativeUsers = new HashSet<String>(); |
| | | private String errorMessage; |
| | | private Message errorMessage; |
| | | private boolean replicationConfigured = false; |
| | | private HashSet<String> replicatedSuffixes = new HashSet<String>(); |
| | | |
| | |
| | | catch (IOException ioe) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error reading config file: "+ioe, ioe); |
| | | errorMessage = Utils.getThrowableMsg(getI18n(), |
| | | "error-reading-config-file", null, ioe); |
| | | errorMessage = Utils.getThrowableMsg( |
| | | INFO_ERROR_READING_CONFIG_FILE.get(), ioe); |
| | | } |
| | | catch (LDIFException le) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error reading config file: "+le, le); |
| | | errorMessage = Utils.getThrowableMsg(getI18n(), |
| | | "error-reading-config-file", null, le); |
| | | errorMessage = Utils.getThrowableMsg( |
| | | INFO_ERROR_READING_CONFIG_FILE.get(), le); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error reading config file: "+t, t); |
| | | // Bug |
| | | t.printStackTrace(); |
| | | errorMessage = Utils.getThrowableMsg(getI18n(), |
| | | "error-reading-config-file", null, t); |
| | | errorMessage = Utils.getThrowableMsg( |
| | | INFO_ERROR_READING_CONFIG_FILE.get(), t); |
| | | } |
| | | finally |
| | | { |
| | |
| | | * @return the error message that we got when retrieving the information |
| | | * from the config.ldif file. |
| | | */ |
| | | public String getErrorMessage() |
| | | public Message getErrorMessage() |
| | | { |
| | | return errorMessage; |
| | | } |
| | |
| | | getFirstValue(entry, "ds-cfg-use-ssl")); |
| | | |
| | | ListenerDescriptor.Protocol protocol; |
| | | String protocolDescription; |
| | | Message protocolDescription; |
| | | |
| | | ListenerDescriptor.State state; |
| | | if (entry.hasObjectClass(ldapConnectionHandlerOc)) |
| | |
| | | addressPort = address+":"+port; |
| | | if (isSecure) |
| | | { |
| | | protocolDescription = getMsg("ldaps-protocol-label"); |
| | | protocolDescription = INFO_LDAPS_PROTOCOL_LABEL.get(); |
| | | protocol = ListenerDescriptor.Protocol.LDAPS; |
| | | } |
| | | else |
| | | { |
| | | protocolDescription = getMsg("ldap-protocol-label"); |
| | | protocolDescription = INFO_LDAP_PROTOCOL_LABEL.get(); |
| | | protocol = ListenerDescriptor.Protocol.LDAP; |
| | | } |
| | | boolean enabled = "true".equalsIgnoreCase( |
| | |
| | | addressPort = "0.0.0.0:"+port; |
| | | if (isSecure) |
| | | { |
| | | protocolDescription = getMsg("jmx-secure-protocol-label"); |
| | | protocolDescription = INFO_JMX_SECURE_PROTOCOL_LABEL.get(); |
| | | protocol = ListenerDescriptor.Protocol.JMXS; |
| | | } |
| | | else |
| | | { |
| | | protocolDescription = getMsg("jmx-protocol-label"); |
| | | protocolDescription = INFO_JMX_PROTOCOL_LABEL.get(); |
| | | protocol = ListenerDescriptor.Protocol.JMX; |
| | | } |
| | | boolean enabled = "true".equalsIgnoreCase( |
| | |
| | | } |
| | | else |
| | | { |
| | | addressPort = getMsg("unknown-label"); |
| | | addressPort = INFO_UNKNOWN_LABEL.get().toString(); |
| | | protocolDescription = null; |
| | | protocol = ListenerDescriptor.Protocol.OTHER; |
| | | /* Try to figure a name from the cn */ |
| | |
| | | int index = cn.toLowerCase().indexOf("connection handler"); |
| | | if (index > 0) |
| | | { |
| | | protocolDescription = cn.substring(0, index).trim(); |
| | | protocolDescription = Message.raw(cn.substring(0, index).trim()); |
| | | } |
| | | else |
| | | { |
| | | protocolDescription = cn; |
| | | protocolDescription = Message.raw(cn); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | protocolDescription = getMsg("undefined-protocol-label"); |
| | | protocolDescription = INFO_UNDEFINED_PROTOCOL_LABEL.get(); |
| | | } |
| | | state = ListenerDescriptor.State.UNKNOWN; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * The following three methods are just commodity methods to get localized |
| | | * messages. |
| | | */ |
| | | private String getMsg(String key) |
| | | { |
| | | return getI18n().getMsg(key); |
| | | } |
| | | |
| | | private ResourceProvider getI18n() |
| | | { |
| | | return ResourceProvider.getInstance(); |
| | | } |
| | | |
| | | /* |
| | | * The following 2 methods are convenience methods to retrieve String values |
| | | * from an entry. |