AutoRefactor'ed Use multi-catch
| | |
| | | } |
| | | } while (true); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage m = INFO_RESULT_CLIENT_SIDE_ENCODING_ERROR.get(); |
| | | throw new LDAPConnectionException(m, CLIENT_SIDE_CONNECT_ERROR, null, le); |
| | | } |
| | | catch (DecodeException ae) |
| | | { |
| | | LocalizableMessage m = INFO_RESULT_CLIENT_SIDE_ENCODING_ERROR.get(); |
| | | throw new LDAPConnectionException(m, CLIENT_SIDE_CONNECT_ERROR, null, ae); |
| | | } |
| | | catch (IOException ie) |
| | | catch (LDAPException | IOException ie) |
| | | { |
| | | LocalizableMessage m = INFO_RESULT_CLIENT_SIDE_ENCODING_ERROR.get(); |
| | | throw new LDAPConnectionException(m, CLIENT_SIDE_CONNECT_ERROR, null, ie); |
| | |
| | | |
| | | xmlReader.parse(new InputSource(is)); |
| | | } |
| | | catch (ParserConfigurationException e) |
| | | { |
| | | // ignore |
| | | } |
| | | catch (SAXException e) |
| | | { |
| | | // ignore |
| | | } |
| | | catch (IOException e) |
| | | catch (ParserConfigurationException | SAXException | IOException e) |
| | | { |
| | | // ignore |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.client.ldap; |
| | | |
| | |
| | | DirContext ctx; |
| | | try { |
| | | ctx = new InitialLdapContext(env, null); |
| | | } catch (javax.naming.CommunicationException e) { |
| | | throw new CommunicationException(e); |
| | | } catch (javax.naming.AuthenticationException e) { |
| | | throw new AuthenticationException(e); |
| | | } catch (javax.naming.AuthenticationNotSupportedException e) { |
| | |
| | | AuthorizationException { |
| | | try { |
| | | throw ne; |
| | | } catch (javax.naming.CommunicationException e) { |
| | | throw new CommunicationException(e); |
| | | } catch (javax.naming.ServiceUnavailableException e) { |
| | | throw new CommunicationException(e); |
| | | } catch (javax.naming.NoPermissionException e) { |
| | | throw new AuthorizationException(e); |
| | | } catch (NamingException e) { |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | logger.info(NOTE_SCHEMA_IMPORT_FAILED, attrType, de.getMessage()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.info(NOTE_SCHEMA_IMPORT_FAILED, attrType, e.getMessage()); |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | logger.info(NOTE_SCHEMA_IMPORT_FAILED, newObjectClass, de.getMessage()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.info(NOTE_SCHEMA_IMPORT_FAILED, newObjectClass, e.getMessage()); |
| | |
| | | logger.traceException(intEx); |
| | | throw new DirectoryException(errorRC, ERR_INTERRUPTED_ERROR.get(intEx.getMessage())); |
| | | } |
| | | catch (JebException je) |
| | | catch (JebException | InitializationException | ConfigException e) |
| | | { |
| | | logger.traceException(je); |
| | | throw new DirectoryException(errorRC, je.getMessageObject()); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | logger.traceException(ie); |
| | | throw new DirectoryException(errorRC, ie.getMessageObject()); |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | | logger.traceException(ce); |
| | | throw new DirectoryException(errorRC, ce.getMessageObject()); |
| | | logger.traceException(e); |
| | | throw new DirectoryException(errorRC, e.getMessageObject()); |
| | | } |
| | | finally |
| | | { |
| | |
| | | logger.traceException(intEx); |
| | | throw new DirectoryException(errorRC, ERR_INTERRUPTED_ERROR.get(intEx.getMessage())); |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | | logger.traceException(ce); |
| | | throw new DirectoryException(errorRC, ce.getMessageObject()); |
| | | } |
| | | catch (JebException e) |
| | | catch (ConfigException | JebException e) |
| | | { |
| | | logger.traceException(e); |
| | | throw new DirectoryException(errorRC, e.getMessageObject()); |
| | |
| | | entryCache.putEntry(entry, backend, entryID.longValue()); |
| | | } |
| | | } |
| | | catch (DatabaseException databaseException) |
| | | catch (DatabaseException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw databaseException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | subordinateEntriesDeleted + 1)); |
| | | } |
| | | } |
| | | catch (DatabaseException databaseException) |
| | | catch (DatabaseException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw databaseException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | entryCache.putEntry(newEntry, backend, entryID.longValue()); |
| | | } |
| | | } |
| | | catch (DatabaseException databaseException) |
| | | catch (DatabaseException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw databaseException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | // Commit the transaction. |
| | | EntryContainer.transactionCommit(txn); |
| | | } |
| | | catch (DatabaseException databaseException) |
| | | catch (DatabaseException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw databaseException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | EntryContainer.transactionAbort(txn); |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | errorCount++; |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.traceException(e); |
| | | logger.trace("Error reading VLV index %s for entry %s: %s", |
| | | vlvIndex.getName(), entry.getName(), StaticUtils.getBacktrace(e)); |
| | | } |
| | | errorCount++; |
| | | } |
| | | catch (JebException e) |
| | | catch (DatabaseException | JebException e) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | entryCache.putEntry(entry, backend, entryID.longValue()); |
| | | } |
| | | } |
| | | catch (StorageRuntimeException StorageRuntimeException) |
| | | catch (StorageRuntimeException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | throw StorageRuntimeException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | subordinateEntriesDeleted + 1)); |
| | | } |
| | | } |
| | | catch (StorageRuntimeException StorageRuntimeException) |
| | | catch (StorageRuntimeException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | throw StorageRuntimeException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | entryCache.putEntry(newEntry, backend, entryID.longValue()); |
| | | } |
| | | } |
| | | catch (StorageRuntimeException StorageRuntimeException) |
| | | catch (StorageRuntimeException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | throw StorageRuntimeException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | modifyDNOperation.checkIfCanceled(true); |
| | | } |
| | | } |
| | | catch (StorageRuntimeException StorageRuntimeException) |
| | | catch (StorageRuntimeException | DirectoryException | CanceledOperationException e) |
| | | { |
| | | throw StorageRuntimeException; |
| | | } |
| | | catch (DirectoryException directoryException) |
| | | { |
| | | throw directoryException; |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | throw e; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | this, ALERT_TYPE_CANNOT_RENAME_NEW_TASK_FILE, message); |
| | | } |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | | logger.traceException(ioe); |
| | | LocalizableMessage message = |
| | | ERR_TASKSCHED_CANNOT_WRITE_BACKING_FILE.get(tmpFilePath, |
| | | stackTraceToSingleLineString(ioe)); |
| | | logger.error(message); |
| | | DirectoryServer.sendAlertNotification(this, |
| | | ALERT_TYPE_CANNOT_WRITE_TASK_FILE, message); |
| | | } |
| | | catch (LDIFException le) |
| | | { |
| | | logger.traceException(le); |
| | |
| | | { |
| | | updateConfiguration(configuration, false); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_PWPOLICY_INVALID_POLICY_CONFIG.get( |
| | | configuration.dn(), ce.getMessage()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIG_PWPOLICY_INVALID_POLICY_CONFIG.get( |
| | | configuration.dn(), ie.getMessage()); |
| | | configuration.dn(), e.getMessage()); |
| | | unacceptableReasons.add(message); |
| | | return false; |
| | | } |
| | |
| | | { |
| | | new PasswordPolicyImpl(null, configuration); |
| | | } |
| | | catch (final ConfigException ce) |
| | | { |
| | | logger.traceException(ce); |
| | | |
| | | unacceptableReasons.add(ce.getMessageObject()); |
| | | return false; |
| | | } |
| | | catch (final InitializationException ie) |
| | | catch (final ConfigException | InitializationException ie) |
| | | { |
| | | logger.traceException(ie); |
| | | |
| | |
| | | { |
| | | loadDictionary(configuration); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | unacceptableReasons.add(ce.getMessageObject()); |
| | | return false; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | unacceptableReasons.add(ie.getMessageObject()); |
| | | unacceptableReasons.add(e.getMessageObject()); |
| | | return false; |
| | | } |
| | | catch (Exception e) |
| | |
| | | long count = backend.getNumberOfChildren(entry.getName()); |
| | | return count >= 0 && Long.parseLong(value.toString()) == count; |
| | | } |
| | | catch (NumberFormatException e) |
| | | { |
| | | logger.traceException(e); |
| | | return false; |
| | | } |
| | | catch (DirectoryException e) |
| | | catch (NumberFormatException | DirectoryException e) |
| | | { |
| | | logger.traceException(e); |
| | | return false; |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | readyConnection.disconnect(DisconnectReason.PROTOCOL_ERROR, true, |
| | | e.getMessageObject()); |
| | | } |
| | | catch (LDAPException e) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | logger.traceException(e); |
| | | readyConnection.disconnect(DisconnectReason.PROTOCOL_ERROR, true, |
| | |
| | | replayErrorMsg = message.toString(); |
| | | updateError(csn); |
| | | } |
| | | } catch (DecodeException e) |
| | | { |
| | | replayErrorMsg = logDecodingOperationError(msg, e); |
| | | } catch (LDAPException e) |
| | | { |
| | | replayErrorMsg = logDecodingOperationError(msg, e); |
| | | } catch (DataFormatException e) |
| | | } catch (DecodeException | LDAPException | DataFormatException e) |
| | | { |
| | | replayErrorMsg = logDecodingOperationError(msg, e); |
| | | } catch (Exception e) |
| | |
| | | + totalLength + " bytes."); |
| | | } |
| | | } |
| | | catch (final IOException e) |
| | | { |
| | | setSessionError(e); |
| | | throw e; |
| | | } |
| | | catch (final DataFormatException e) |
| | | { |
| | | setSessionError(e); |
| | | throw e; |
| | | } |
| | | catch (final NotSupportedOldVersionPDUException e) |
| | | { |
| | | setSessionError(e); |
| | | throw e; |
| | | } |
| | | catch (final RuntimeException e) |
| | | catch (final IOException | DataFormatException | NotSupportedOldVersionPDUException | RuntimeException e) |
| | | { |
| | | setSessionError(e); |
| | | throw e; |
| | |
| | | import static org.opends.messages.TaskMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.core.DirectoryServer.getSchemaDN; |
| | | import static org.opends.server.core.DirectoryServer.getServerErrorResultCode; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | |
| | | { |
| | | SchemaConfigManager.loadSchemaFile(schema, schemaFile); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | logger.traceException(ce); |
| | | logger.traceException(e); |
| | | |
| | | LocalizableMessage message = ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE.get( |
| | | schemaFile, ce.getMessage()); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, ce); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | logger.traceException(ie); |
| | | |
| | | LocalizableMessage message = ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE.get( |
| | | schemaFile, ie.getMessage()); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, ie); |
| | | LocalizableMessage message = ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE.get(schemaFile, e.getMessage()); |
| | | throw new DirectoryException(getServerErrorResultCode(), message, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | .toAttribute())); |
| | | } |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | logger.traceException(ce); |
| | | logger.error(ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE, schemaFile, ce.getMessage()); |
| | | return TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | logger.traceException(ie); |
| | | logger.error(ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE, schemaFile, ie.getMessage()); |
| | | logger.traceException(e); |
| | | logger.error(ERR_TASK_ADDSCHEMAFILE_ERROR_LOADING_SCHEMA_FILE, schemaFile, e.getMessage()); |
| | | return TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get( |
| | | ce.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(getExceptionMessage(e)); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | ce.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(getExceptionMessage(e)); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ce.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(getExceptionMessage(e)); |
| | | printMessage(message); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | |
| | | new PasswordStorageSchemeConfigManager(directoryServer.getServerContext()); |
| | | storageSchemeConfigManager.initializePasswordStorageSchemes(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES.get( |
| | | ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_STORAGE_SCHEMES.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return OPERATIONS_ERROR; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return false; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return false; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return false; |
| | | } |
| | |
| | | directoryServer.initializeAuthenticationPolicyComponents(); |
| | | directoryServer.initializeAuthenticatedUsers(); |
| | | new CryptoManagerSync(); |
| | | } catch (InitializationException ie) { |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_SERVER_COMPONENTS.get( |
| | | getExceptionMessage(ie)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return false; |
| | | } catch (ConfigException ce) { |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_SERVER_COMPONENTS.get( |
| | | getExceptionMessage(ce)); |
| | | } catch (InitializationException | ConfigException e) { |
| | | LocalizableMessage message = ERR_ENCPW_CANNOT_INITIALIZE_SERVER_COMPONENTS.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return false; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | getExceptionMessage(e)); |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | pluginTypes.add(PluginType.LDIF_EXPORT); |
| | | directoryServer.initializePlugins(pluginTypes); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS.get(ie.getMessage()); |
| | | ERR_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS.get( |
| | | getExceptionMessage(e)); |
| | | ERR_LDIFEXPORT_CANNOT_INITIALIZE_PLUGINS.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | throw e; |
| | | } |
| | | catch (ConfigException e2) |
| | | { |
| | | return e2.getMessage(); |
| | | } |
| | | catch (InitializationException e2) |
| | | catch (ConfigException | InitializationException e2) |
| | | { |
| | | return e2.getMessage(); |
| | | } |
| | |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_SEND_SIMPLE_BIND.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, |
| | | message, e); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, message, e); |
| | | } |
| | | |
| | | |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_SEND_SASL_BIND.get( |
| | | SASL_MECHANISM_ANONYMOUS, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, |
| | | message, e); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, message, e); |
| | | } |
| | | |
| | | |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_SEND_INITIAL_SASL_BIND.get( |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, |
| | | message, e); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_ENCODING_ERROR, message, e); |
| | | } |
| | | |
| | | |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_CRAM_MD5, getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_INITIAL_BIND_RESPONSE.get( |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | | SASL_MECHANISM_DIGEST_MD5, getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_SECOND_BIND_RESPONSE.get( |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException e) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE |
| | | .get(getExceptionMessage(ae)); |
| | | ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, ae); |
| | | ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_SERVER_DOWN, |
| | | message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get( |
| | | getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPAUTH_CANNOT_READ_BIND_RESPONSE.get( |
| | |
| | | message); |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_WHOAMI_RESPONSE.get(getExceptionMessage(ae)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, ae); |
| | | ERR_LDAPAUTH_CANNOT_READ_WHOAMI_RESPONSE.get(getExceptionMessage(e)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, message, e); |
| | | } |
| | | catch (IOException ioe) |
| | | { |
| | |
| | | throw new ClientException( |
| | | ReturnCode.CLIENT_SIDE_SERVER_DOWN, message, ioe); |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPAUTH_CANNOT_READ_WHOAMI_RESPONSE.get(getExceptionMessage(le)); |
| | | throw new ClientException(ReturnCode.CLIENT_SIDE_DECODING_ERROR, |
| | | message, le); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = |
| | |
| | | socket = createSSLOrBasicSocket(startTLSSocket, sslConnectionFactory); |
| | | ldapWriter = new LDAPWriter(socket); |
| | | ldapReader = new LDAPReader(socket); |
| | | } catch(UnknownHostException uhe) |
| | | } catch(UnknownHostException | ConnectException e) |
| | | { |
| | | LocalizableMessage msg = INFO_RESULT_CLIENT_SIDE_CONNECT_ERROR.get(); |
| | | throw new LDAPConnectionException(msg, CLIENT_SIDE_CONNECT_ERROR, null, |
| | | uhe); |
| | | } catch(ConnectException ce) |
| | | { |
| | | LocalizableMessage msg = INFO_RESULT_CLIENT_SIDE_CONNECT_ERROR.get(); |
| | | throw new LDAPConnectionException(msg, CLIENT_SIDE_CONNECT_ERROR, null, |
| | | ce); |
| | | throw new LDAPConnectionException(msg, CLIENT_SIDE_CONNECT_ERROR, null, e); |
| | | } catch (LDAPConnectionException e) |
| | | { |
| | | throw e; |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | // Retrieve a list of the backkends defined in the server. |
| | | // Retrieve a list of the backends defined in the server. |
| | | TreeMap<String,TreeSet<DN>> backends; |
| | | try |
| | | { |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get( |
| | | getExceptionMessage(e)); |
| | | LocalizableMessage message = ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(getExceptionMessage(e)); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | return LDAPResultCode.CLIENT_SIDE_SERVER_DOWN; |
| | | } |
| | | } |
| | | catch (DecodeException ae) |
| | | catch (DecodeException | LDAPException e) |
| | | { |
| | | LocalizableMessage message = ERR_STOPDS_DECODE_ERROR.get(ae.getMessage()); |
| | | LocalizableMessage message = ERR_STOPDS_DECODE_ERROR.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return LDAPResultCode.CLIENT_SIDE_DECODING_ERROR; |
| | | } |
| | |
| | | err.println(wrapText(ERR_STOPDS_IO_ERROR.get(ioe), MAX_LINE_WIDTH)); |
| | | return LDAPResultCode.CLIENT_SIDE_SERVER_DOWN; |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | LocalizableMessage message = ERR_STOPDS_DECODE_ERROR.get(le.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return LDAPResultCode.CLIENT_SIDE_DECODING_ERROR; |
| | | } |
| | | |
| | | |
| | | if (responseMessage.getProtocolOpType() != |
| | |
| | | { |
| | | directoryServer.initializeSchema(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(ie.getMessage()); |
| | | LocalizableMessage message = ERR_CANNOT_LOAD_SCHEMA.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | CoreConfigManager coreConfigManager = new CoreConfigManager(directoryServer.getServerContext()); |
| | | coreConfigManager.initializeCoreConfig(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CORE_CONFIG.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | { |
| | | directoryServer.initializeCryptoManager(); |
| | | } |
| | | catch (ConfigException ce) |
| | | catch (ConfigException | InitializationException e) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(ce.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(ie.getMessage()); |
| | | ERR_CANNOT_INITIALIZE_CRYPTO_MANAGER.get(e.getMessage()); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | return 1; |
| | | } |
| | |
| | | taskArgs.validateArgs(); |
| | | } |
| | | } |
| | | catch (ClientException ce) |
| | | catch (ClientException | ArgumentException e) |
| | | { |
| | | addMessage(buf, ce.getMessageObject()); |
| | | } |
| | | catch (ArgumentException ae) |
| | | { |
| | | addMessage(buf, ae.getMessageObject()); |
| | | addMessage(buf, e.getMessageObject()); |
| | | } |
| | | } |
| | | |
| | |
| | | logger.info(LocalizableMessage.raw("created task entry: "+attrs)); |
| | | dirCtx.close(); |
| | | } |
| | | catch (NameAlreadyBoundException ex) |
| | | { |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ex)); |
| | | LocalizableMessage msg = ERR_LAUNCHING_PURGE_HISTORICAL.get(); |
| | | ReplicationCliReturnCode code = ERROR_LAUNCHING_PURGE_HISTORICAL; |
| | | throw new ReplicationCliException( |
| | | getThrowableMsg(msg, ex), code, ex); |
| | | } |
| | | catch (NamingException ne) |
| | | { |
| | | logger.error(LocalizableMessage.raw("Error creating task "+attrs, ne)); |
| | |
| | | * |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools.status; |
| | | |
| | |
| | | controlInfo.setTrustManager(interactiveTrustManager); |
| | | useInteractiveTrustManager = true; |
| | | } |
| | | } catch (ArgumentException e) { |
| | | println(e.getMessageObject()); |
| | | return ReturnCode.CLIENT_SIDE_PARAM_ERROR.get(); |
| | | } catch (ClientException e) { |
| | | } catch (ArgumentException | ClientException e) { |
| | | println(e.getMessageObject()); |
| | | return ReturnCode.CLIENT_SIDE_PARAM_ERROR.get(); |
| | | } finally { |
| | |
| | | |
| | | return LDAPManagementContext.newManagementContext(connection, LDAPProfile.getInstance()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | ret = 0; |
| | | } catch (ArgumentException e) { |
| | | LocalizableMessage message = e.getMessageObject(); |
| | | if (err != null) err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | ret = 1; |
| | | } catch (LDAPConnectionException e) { |
| | | LocalizableMessage message; |
| | | if (isWrongPortException(e, |
| | |
| | | LocalizableMessage message = ERR_TASK_TOOL_LDAP_ERROR.get(le.getMessage()); |
| | | if (err != null) err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | ret = 1; |
| | | } catch (OpenDsException e) { |
| | | } catch (ArgumentException | OpenDsException e) { |
| | | LocalizableMessage message = e.getMessageObject(); |
| | | if (err != null) err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | | ret = 1; |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools.upgrade; |
| | | |
| | |
| | | |
| | | context.notifyProgress(pnc.setProgress(100)); |
| | | } |
| | | catch (final IOException e) |
| | | { |
| | | manageTaskException(context, ERR_UPGRADE_ADDATTRIBUTE_FAILS.get( |
| | | schemaFileTemplate.getName(), e.getMessage()), pnc); |
| | | } |
| | | catch (final IllegalStateException e) |
| | | catch (final IOException | IllegalStateException e) |
| | | { |
| | | manageTaskException(context, ERR_UPGRADE_ADDATTRIBUTE_FAILS.get( |
| | | schemaFileTemplate.getName(), e.getMessage()), pnc); |
| | |
| | | isValid = false; |
| | | } |
| | | } |
| | | catch (final InputMismatchException e) |
| | | { |
| | | isValid = false; |
| | | } |
| | | catch (final NoSuchElementException e) |
| | | { |
| | | isValid = false; |
| | |
| | | ui.populateLDAPOptions(options), |
| | | ui.getConnectTimeout(), |
| | | out, err); |
| | | } catch (ArgumentException e) { |
| | | if ((e.getCause() != null) && (e.getCause().getCause() != null) && |
| | | e.getCause().getCause() instanceof SSLException) { |
| | | err.println(ERR_TASKINFO_LDAP_EXCEPTION_SSL.get(ui.getHostName(), ui.getPortNumber())); |
| | | } else { |
| | | err.println(e.getMessageObject()); |
| | | } |
| | | } catch (OpenDsException e) { |
| | | } catch (ArgumentException | OpenDsException e) { |
| | | if ((e.getCause() != null) && (e.getCause().getCause() != null) && |
| | | e.getCause().getCause() instanceof SSLException) { |
| | | err.println(ERR_TASKINFO_LDAP_EXCEPTION_SSL.get(ui.getHostName(), ui.getPortNumber())); |