| | |
| | | // another to be opened. |
| | | if (ec1 != null) |
| | | { |
| | | LocalizableMessage m = ERR_JEB_ENTRY_CONTAINER_ALREADY_REGISTERED.get( |
| | | ec1.getDatabasePrefix(), baseDN.toString()); |
| | | throw new InitializationException(m); |
| | | throw new InitializationException(ERR_JEB_ENTRY_CONTAINER_ALREADY_REGISTERED.get( |
| | | ec1.getDatabasePrefix(), baseDN)); |
| | | } |
| | | |
| | | this.entryContainers.put(baseDN, entryContainer); |
| | |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(LocalDBBackendCfg cfg) |
| | | { |
| | | ConfigChangeResult ccr; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<LocalizableMessage> messages = new ArrayList<LocalizableMessage>(); |
| | | |
| | |
| | | { |
| | | if(!backendDirectory.mkdirs()) |
| | | { |
| | | messages.add(ERR_JEB_CREATE_FAIL.get( |
| | | backendDirectory.getPath())); |
| | | ccr = new ConfigChangeResult( |
| | | messages.add(ERR_JEB_CREATE_FAIL.get(backendDirectory.getPath())); |
| | | return new ConfigChangeResult( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | | adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | } |
| | | } |
| | | //Make sure the directory is valid. |
| | | else if (!backendDirectory.isDirectory()) |
| | | { |
| | | messages.add(ERR_JEB_DIRECTORY_INVALID.get( |
| | | backendDirectory.getPath())); |
| | | ccr = new ConfigChangeResult( |
| | | messages.add(ERR_JEB_DIRECTORY_INVALID.get(backendDirectory.getPath())); |
| | | return new ConfigChangeResult( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | | adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | } |
| | | |
| | | adminActionRequired = true; |
| | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | messages.add(ERR_CONFIG_BACKEND_MODE_INVALID.get( |
| | | config.dn().toString())); |
| | | ccr = new ConfigChangeResult( |
| | | messages.add(ERR_CONFIG_BACKEND_MODE_INVALID.get(config.dn())); |
| | | return new ConfigChangeResult( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | | adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | } |
| | | |
| | | //Make sure the mode will allow the server itself access to |
| | |
| | | { |
| | | messages.add(ERR_CONFIG_BACKEND_INSANE_MODE.get( |
| | | cfg.getDBDirectoryPermissions())); |
| | | ccr = new ConfigChangeResult( |
| | | return new ConfigChangeResult( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | | adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | } |
| | | |
| | | // Get the backend database backendDirectory permissions and apply |
| | |
| | | catch (Exception e) |
| | | { |
| | | messages.add(LocalizableMessage.raw(stackTraceToSingleLineString(e))); |
| | | ccr = new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(), |
| | | return new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(), |
| | | adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | } |
| | | |
| | | |
| | | ccr = new ConfigChangeResult(ResultCode.SUCCESS, adminActionRequired, |
| | | messages); |
| | | return ccr; |
| | | return new ConfigChangeResult(ResultCode.SUCCESS, adminActionRequired, messages); |
| | | } |
| | | |
| | | /** |