| | |
| | | import org.opends.server.admin.std.server.PluginRootCfg; |
| | | import org.opends.server.admin.std.server.RootCfg; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.plugin.DirectoryServerPlugin; |
| | | import org.opends.server.api.plugin.IntermediateResponsePluginResult; |
| | | import org.opends.server.api.plugin.LDIFPluginResult; |
| | | import org.opends.server.api.plugin.PluginType; |
| | | import org.opends.server.api.plugin.PostConnectPluginResult; |
| | | import org.opends.server.api.plugin.PostDisconnectPluginResult; |
| | | import org.opends.server.api.plugin.PostOperationPluginResult; |
| | | import org.opends.server.api.plugin.PostResponsePluginResult; |
| | | import org.opends.server.api.plugin.PreOperationPluginResult; |
| | | import org.opends.server.api.plugin.PreParsePluginResult; |
| | | import org.opends.server.api.plugin.SearchEntryPluginResult; |
| | | import org.opends.server.api.plugin.SearchReferencePluginResult; |
| | | import org.opends.server.api.plugin.StartupPluginResult; |
| | | import org.opends.server.api.plugin.SubordinateModifyDNPluginResult; |
| | | import org.opends.server.api.plugin.*; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DisconnectReason; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.IntermediateResponse; |
| | | import org.opends.server.types.LDIFExportConfig; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchResultEntry; |
| | | import org.opends.server.types.SearchResultReference; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.operation.PostOperationAbandonOperation; |
| | | import org.opends.server.types.operation.PostOperationAddOperation; |
| | | import org.opends.server.types.operation.PostOperationBindOperation; |
| | | import org.opends.server.types.operation.PostOperationCompareOperation; |
| | | import org.opends.server.types.operation.PostOperationDeleteOperation; |
| | | import org.opends.server.types.operation.PostOperationExtendedOperation; |
| | | import org.opends.server.types.operation.PostOperationModifyDNOperation; |
| | | import org.opends.server.types.operation.PostOperationModifyOperation; |
| | | import org.opends.server.types.operation.PostOperationSearchOperation; |
| | | import org.opends.server.types.operation.PostOperationUnbindOperation; |
| | | import org.opends.server.types.operation.PostResponseAddOperation; |
| | | import org.opends.server.types.operation.PostResponseBindOperation; |
| | | import org.opends.server.types.operation.PostResponseCompareOperation; |
| | | import org.opends.server.types.operation.PostResponseDeleteOperation; |
| | | import org.opends.server.types.operation.PostResponseExtendedOperation; |
| | | import org.opends.server.types.operation.PostResponseModifyDNOperation; |
| | | import org.opends.server.types.operation.PostResponseModifyOperation; |
| | | import org.opends.server.types.operation.PostResponseSearchOperation; |
| | | import org.opends.server.types.operation.PostSynchronizationAddOperation; |
| | | import org.opends.server.types.operation.PostSynchronizationDeleteOperation; |
| | | import org.opends.server.types.operation.PostSynchronizationModifyOperation; |
| | | import org.opends.server.types.operation.PostSynchronizationModifyDNOperation; |
| | | import org.opends.server.types.operation.PreOperationAddOperation; |
| | | import org.opends.server.types.operation.PreOperationBindOperation; |
| | | import org.opends.server.types.operation.PreOperationCompareOperation; |
| | | import org.opends.server.types.operation.PreOperationDeleteOperation; |
| | | import org.opends.server.types.operation.PreOperationExtendedOperation; |
| | | import org.opends.server.types.operation.PreOperationModifyDNOperation; |
| | | import org.opends.server.types.operation.PreOperationModifyOperation; |
| | | import org.opends.server.types.operation.PreOperationSearchOperation; |
| | | import org.opends.server.types.operation.PreParseAbandonOperation; |
| | | import org.opends.server.types.operation.PreParseAddOperation; |
| | | import org.opends.server.types.operation.PreParseBindOperation; |
| | | import org.opends.server.types.operation.PreParseCompareOperation; |
| | | import org.opends.server.types.operation.PreParseDeleteOperation; |
| | | import org.opends.server.types.operation.PreParseModifyDNOperation; |
| | | import org.opends.server.types.operation.PreParseExtendedOperation; |
| | | import org.opends.server.types.operation.PreParseModifyOperation; |
| | | import org.opends.server.types.operation.PreParseSearchOperation; |
| | | import org.opends.server.types.operation.PreParseUnbindOperation; |
| | | import org.opends.server.types.operation.SearchEntrySearchOperation; |
| | | import org.opends.server.types.operation.SearchReferenceSearchOperation; |
| | | import org.opends.server.types.operation.SubordinateModifyDNOperation; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.types.operation.*; |
| | | import org.opends.server.workflowelement.localbackend.*; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | |
| | | DirectoryServerPlugin<? extends PluginCfg>> |
| | | registeredPlugins; |
| | | |
| | | // The mapping between an operation and a set of post operation plugins |
| | | // it should skip. This pairs up pre and post operation plugin processing |
| | | // such that only plugins that successfully execute its pre op plugin will |
| | | // have its post op plugin executed on a per operation basis. If an |
| | | // operation is not registered on this list then all all pre op plugins |
| | | // executed successfully for this operation so all post op plugins should |
| | | // execute. |
| | | private ConcurrentHashMap<PluginOperation, ArrayList<DirectoryServerPlugin>> |
| | | skippedPreOperationPlugins; |
| | | |
| | | // The plugin root configuration read at server startup. |
| | | private PluginRootCfg pluginRootConfig; |
| | | |
| | |
| | | registeredPlugins = |
| | | new ConcurrentHashMap<DN, |
| | | DirectoryServerPlugin<? extends PluginCfg>>(); |
| | | skippedPreOperationPlugins = |
| | | new ConcurrentHashMap<PluginOperation, |
| | | ArrayList<DirectoryServerPlugin>>(); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the startup plugins. |
| | | */ |
| | | public StartupPluginResult invokeStartupPlugins() |
| | | public PluginResult.Startup invokeStartupPlugins() |
| | | { |
| | | StartupPluginResult result = null; |
| | | PluginResult.Startup result = null; |
| | | |
| | | for (DirectoryServerPlugin p : startupPlugins) |
| | | { |
| | |
| | | String.valueOf(p.getPluginEntryDN()), |
| | | stackTraceToSingleLineString(e)); |
| | | |
| | | result = new StartupPluginResult(false, false, message); |
| | | break; |
| | | return PluginResult.Startup.stopStartup(message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | Message message = ERR_PLUGIN_STARTUP_PLUGIN_RETURNED_NULL.get( |
| | | String.valueOf(p.getPluginEntryDN())); |
| | | logError(message); |
| | | return new StartupPluginResult(false, false, message); |
| | | return PluginResult.Startup.stopStartup(message); |
| | | } |
| | | else if (! result.completedSuccessfully()) |
| | | else if (! result.continueProcessing()) |
| | | { |
| | | if (result.continueStartup()) |
| | | { |
| | | Message message = ERR_PLUGIN_STARTUP_PLUGIN_FAIL_CONTINUE. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | result.getErrorMessage(), |
| | | result.getErrorMessage().getDescriptor().getId()); |
| | | logError(message); |
| | | } |
| | | else |
| | | { |
| | | Message message = ERR_PLUGIN_STARTUP_PLUGIN_FAIL_ABORT. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | result.getErrorMessage(), |
| | | result.getErrorMessage().getDescriptor().getId()); |
| | | logError(message); |
| | | return result; |
| | | } |
| | | Message message = ERR_PLUGIN_STARTUP_PLUGIN_FAIL_ABORT. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | result.getErrorMessage(), |
| | | result.getErrorMessage().getDescriptor().getId()); |
| | | logError(message); |
| | | return result; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | // This should only happen if there were no startup plugins registered, |
| | | // which is fine. |
| | | result = StartupPluginResult.SUCCESS; |
| | | result = PluginResult.Startup.continueStartup(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-connect plugins. |
| | | */ |
| | | public PostConnectPluginResult invokePostConnectPlugins(ClientConnection |
| | | clientConnection) |
| | | public PluginResult.PostConnect invokePostConnectPlugins(ClientConnection |
| | | clientConnection) |
| | | { |
| | | PostConnectPluginResult result = null; |
| | | PluginResult.PostConnect result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postConnectPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | try |
| | | { |
| | | clientConnection.disconnect(DisconnectReason.SERVER_ERROR, true, |
| | | message); |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | | return new PostConnectPluginResult(true, false); |
| | | return PluginResult.PostConnect.disconnectClient( |
| | | DisconnectReason.SERVER_ERROR, true, message); |
| | | } |
| | | |
| | | |
| | |
| | | clientConnection.getClientAddress()); |
| | | logError(message); |
| | | |
| | | try |
| | | { |
| | | clientConnection.disconnect(DisconnectReason.SERVER_ERROR, true, |
| | | message); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | return new PostConnectPluginResult(true, false); |
| | | return PluginResult.PostConnect.disconnectClient( |
| | | DisconnectReason.SERVER_ERROR, true, message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no post-connect plugins |
| | | // registered, which is fine. |
| | | result = PostConnectPluginResult.SUCCESS; |
| | | result = PluginResult.PostConnect.continueConnectProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-connect plugins. |
| | | */ |
| | | public PostDisconnectPluginResult invokePostDisconnectPlugins( |
| | | public PluginResult.PostDisconnect invokePostDisconnectPlugins( |
| | | ClientConnection clientConnection, |
| | | DisconnectReason disconnectReason, |
| | | Message message) |
| | | { |
| | | PostDisconnectPluginResult result = null; |
| | | PluginResult.PostDisconnect result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postDisconnectPlugins) |
| | | { |
| | |
| | | clientConnection.getClientAddress(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(msg); |
| | | |
| | | return new PostDisconnectPluginResult(false); |
| | | } |
| | | |
| | | |
| | |
| | | clientConnection.getConnectionID(), |
| | | clientConnection.getClientAddress()); |
| | | logError(msg); |
| | | |
| | | return new PostDisconnectPluginResult(false); |
| | | } |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | |
| | | { |
| | | // This should only happen if there were no post-disconnect plugins |
| | | // registered, which is fine. |
| | | result = PostDisconnectPluginResult.SUCCESS; |
| | | result = PluginResult.PostDisconnect.continueDisconnectProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the LDIF import plugins. |
| | | */ |
| | | public LDIFPluginResult invokeLDIFImportPlugins(LDIFImportConfig importConfig, |
| | | Entry entry) |
| | | public PluginResult.ImportLDIF invokeLDIFImportPlugins( |
| | | LDIFImportConfig importConfig, Entry entry) |
| | | { |
| | | LDIFPluginResult result = null; |
| | | PluginResult.ImportLDIF result = null; |
| | | |
| | | for (DirectoryServerPlugin p : ldifImportPlugins) |
| | | { |
| | |
| | | String.valueOf(entry.getDN()), stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new LDIFPluginResult(false, false, message); |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(entry.getDN())); |
| | | logError(message); |
| | | |
| | | return new LDIFPluginResult(false, false, message); |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | | } |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | |
| | | { |
| | | // This should only happen if there were no LDIF import plugins |
| | | // registered, which is fine. |
| | | result = LDIFPluginResult.SUCCESS; |
| | | result = PluginResult.ImportLDIF.continueEntryProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the LDIF export plugins. |
| | | */ |
| | | public LDIFPluginResult invokeLDIFExportPlugins(LDIFExportConfig exportConfig, |
| | | Entry entry) |
| | | public PluginResult.ImportLDIF invokeLDIFExportPlugins( |
| | | LDIFExportConfig exportConfig, Entry entry) |
| | | { |
| | | LDIFPluginResult result = null; |
| | | PluginResult.ImportLDIF result = null; |
| | | |
| | | for (DirectoryServerPlugin p : ldifExportPlugins) |
| | | { |
| | |
| | | String.valueOf(entry.getDN()), stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new LDIFPluginResult(false, false, message); |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(entry.getDN())); |
| | | logError(message); |
| | | |
| | | return new LDIFPluginResult(false, false, message); |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | | } |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | |
| | | { |
| | | // This should only happen if there were no LDIF export plugins |
| | | // registered, which is fine. |
| | | result = LDIFPluginResult.SUCCESS; |
| | | result = PluginResult.ImportLDIF.continueEntryProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the pre-parse abandon plugins. |
| | | */ |
| | | public PreParsePluginResult invokePreParseAbandonPlugins( |
| | | public PluginResult.PreParse invokePreParseAbandonPlugins( |
| | | PreParseAbandonOperation abandonOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseAbandonPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | abandonOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | abandonOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(abandonOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | abandonOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | abandonOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse abandon plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * plugins. |
| | | * |
| | | * @return The result of processing the pre-parse add plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseAddPlugins( |
| | | public PluginResult.PreParse invokePreParseAddPlugins( |
| | | PreParseAddOperation addOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseAddPlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(addOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(addOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse add plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the pre-parse bind plugins. |
| | | */ |
| | | public PreParsePluginResult invokePreParseBindPlugins( |
| | | public PluginResult.PreParse invokePreParseBindPlugins( |
| | | PreParseBindOperation bindOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseBindPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(bindOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse bind plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse compare plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseComparePlugins( |
| | | PreParseCompareOperation compareOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | public PluginResult.PreParse invokePreParseComparePlugins( |
| | | PreParseCompareOperation compareOperation) |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseComparePlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(compareOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(compareOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse compare plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse delete plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseDeletePlugins( |
| | | public PluginResult.PreParse invokePreParseDeletePlugins( |
| | | PreParseDeleteOperation deleteOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseDeletePlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(deleteOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(deleteOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse delete plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse extended plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseExtendedPlugins( |
| | | public PluginResult.PreParse invokePreParseExtendedPlugins( |
| | | PreParseExtendedOperation extendedOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseExtendedPlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(extendedOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(extendedOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse extended plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse modify plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseModifyPlugins( |
| | | public PluginResult.PreParse invokePreParseModifyPlugins( |
| | | PreParseModifyOperation modifyOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyPlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(modifyOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(modifyOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse modify plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse modify DN plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseModifyDNPlugins( |
| | | public PluginResult.PreParse invokePreParseModifyDNPlugins( |
| | | PreParseModifyDNOperation modifyDNOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyDNPlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(modifyDNOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(modifyDNOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse modify DN plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-parse plugins. |
| | | * |
| | | * @return The result of processing the pre-parse search plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreParsePluginResult invokePreParseSearchPlugins( |
| | | public PluginResult.PreParse invokePreParseSearchPlugins( |
| | | PreParseSearchOperation searchOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseSearchPlugins) |
| | | { |
| | |
| | | { |
| | | result = p.doPreParse(searchOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(searchOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse search plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the pre-parse unbind plugins. |
| | | */ |
| | | public PreParsePluginResult invokePreParseUnbindPlugins( |
| | | public PluginResult.PreParse invokePreParseUnbindPlugins( |
| | | PreParseUnbindOperation unbindOperation) |
| | | { |
| | | PreParsePluginResult result = null; |
| | | PluginResult.PreParse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseUnbindPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | unbindOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | unbindOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(unbindOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | unbindOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | unbindOperation.appendErrorMessage(message); |
| | | |
| | | return new PreParsePluginResult(false, false, true); |
| | | return PluginResult.PreParse.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-parse unbind plugins |
| | | // registered, which is fine. |
| | | result = PreParsePluginResult.SUCCESS; |
| | | result = PluginResult.PreParse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation add plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationAddPlugins( |
| | | public PluginResult.PreOperation invokePreOperationAddPlugins( |
| | | PreOperationAddOperation addOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationAddPlugins) |
| | | for (int i = 0; i < preOperationAddPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationAddPlugins[i]; |
| | | if (addOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(addOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationAddPlugins, |
| | | addOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | addOperation.getConnectionID(), addOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationAddPlugins, |
| | | addOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationAddPlugins, |
| | | addOperation); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the pre-operation bind plugins. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationBindPlugins( |
| | | public PluginResult.PreOperation invokePreOperationBindPlugins( |
| | | PreOperationBindOperation bindOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationBindPlugins) |
| | | for (int i = 0; i < preOperationBindPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationBindPlugins[i]; |
| | | if (bindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationBindPlugins, |
| | | bindOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | bindOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationBindPlugins, |
| | | bindOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationBindPlugins, |
| | | bindOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation bind plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation compare plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationComparePlugins( |
| | | public PluginResult.PreOperation invokePreOperationComparePlugins( |
| | | PreOperationCompareOperation compareOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationComparePlugins) |
| | | for (int i = 0; i < preOperationComparePlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationComparePlugins[i]; |
| | | if (compareOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(compareOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationComparePlugins, |
| | | compareOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | compareOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationComparePlugins, |
| | | compareOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation compare plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation delete plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationDeletePlugins( |
| | | public PluginResult.PreOperation invokePreOperationDeletePlugins( |
| | | PreOperationDeleteOperation deleteOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationDeletePlugins) |
| | | for (int i = 0; i < preOperationDeletePlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationDeletePlugins[i]; |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(deleteOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationDeletePlugins, |
| | | deleteOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | deleteOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationDeletePlugins, |
| | | deleteOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationDeletePlugins, |
| | | deleteOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation delete plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation extended plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationExtendedPlugins( |
| | | public PluginResult.PreOperation invokePreOperationExtendedPlugins( |
| | | PreOperationExtendedOperation extendedOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationExtendedPlugins) |
| | | for (int i = 0; i < preOperationExtendedPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationExtendedPlugins[i]; |
| | | if (extendedOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | registerSkippedPreOperationPlugin(p, extendedOperation); |
| | | continue; |
| | | } |
| | | |
| | |
| | | { |
| | | result = p.doPreOperation(extendedOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationExtendedPlugins, |
| | | extendedOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | extendedOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationExtendedPlugins, |
| | | extendedOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationExtendedPlugins, |
| | | extendedOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation extended plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation modify plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationModifyPlugins( |
| | | public PluginResult.PreOperation invokePreOperationModifyPlugins( |
| | | PreOperationModifyOperation modifyOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationModifyPlugins) |
| | | for (int i = 0; i < preOperationModifyPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationModifyPlugins[i]; |
| | | if (modifyOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(modifyOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyPlugins, |
| | | modifyOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyPlugins, |
| | | modifyOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyPlugins, |
| | | modifyOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation modify plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation modify DN plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationModifyDNPlugins( |
| | | public PluginResult.PreOperation invokePreOperationModifyDNPlugins( |
| | | PreOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationModifyDNPlugins) |
| | | for (int i = 0; i < preOperationModifyDNPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationModifyDNPlugins[i]; |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(modifyDNOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyDNPlugins, |
| | | modifyDNOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyDNOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyDNPlugins, |
| | | modifyDNOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationModifyDNPlugins, |
| | | modifyDNOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation modify DN |
| | | // plugins registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * pre-operation plugins. |
| | | * |
| | | * @return The result of processing the pre-operation search plugins. |
| | | * |
| | | * @throws CanceledOperationException if the operation should be canceled. |
| | | */ |
| | | public PreOperationPluginResult invokePreOperationSearchPlugins( |
| | | public PluginResult.PreOperation invokePreOperationSearchPlugins( |
| | | PreOperationSearchOperation searchOperation) |
| | | { |
| | | PreOperationPluginResult result = null; |
| | | throws CanceledOperationException { |
| | | PluginResult.PreOperation result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationSearchPlugins) |
| | | for (int i = 0; i < preOperationSearchPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationSearchPlugins[i]; |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | |
| | | { |
| | | result = p.doPreOperation(searchOperation); |
| | | } |
| | | catch (CanceledOperationException coe) |
| | | { |
| | | throw coe; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationSearchPlugins, |
| | | searchOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | searchOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | registerSkippedPreOperationPlugins(i, preOperationSearchPlugins, |
| | | searchOperation); |
| | | |
| | | return new PreOperationPluginResult(false, false, true); |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | registerSkippedPreOperationPlugins(i, preOperationSearchPlugins, |
| | | searchOperation); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no pre-operation search plugins |
| | | // This should only happen if there were no pre-operation add plugins |
| | | // registered, which is fine. |
| | | result = PreOperationPluginResult.SUCCESS; |
| | | result = PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-operation abandon plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationAbandonPlugins( |
| | | public PluginResult.PostOperation invokePostOperationAbandonPlugins( |
| | | PostOperationAbandonOperation abandonOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAbandonPlugins) |
| | | { |
| | |
| | | abandonOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | abandonOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | abandonOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | abandonOperation.getConnectionID(), |
| | | abandonOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | abandonOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | abandonOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation abandon plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation add plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationAddPlugins( |
| | | public PluginResult.PostOperation invokePostOperationAddPlugins( |
| | | PostOperationAddOperation addOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAddPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(addOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(addOperation); |
| | |
| | | addOperation.getConnectionID(), addOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(p.getPluginEntryDN()), |
| | | addOperation.getConnectionID(), addOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | addOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | addOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation bind plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationBindPlugins( |
| | | public PluginResult.PostOperation invokePostOperationBindPlugins( |
| | | PostOperationBindOperation bindOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationBindPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(bindOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(bindOperation); |
| | |
| | | bindOperation.getConnectionID(), bindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | bindOperation.getConnectionID(), |
| | | bindOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | bindOperation.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | bindOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation bind plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation compare plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationComparePlugins( |
| | | public PluginResult.PostOperation invokePostOperationComparePlugins( |
| | | PostOperationCompareOperation compareOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationComparePlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(compareOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(compareOperation); |
| | |
| | | compareOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | compareOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | compareOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation compare plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation delete plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationDeletePlugins( |
| | | public PluginResult.PostOperation invokePostOperationDeletePlugins( |
| | | PostOperationDeleteOperation deleteOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationDeletePlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(deleteOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(deleteOperation); |
| | |
| | | deleteOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | deleteOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | deleteOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation delete plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation extended plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationExtendedPlugins( |
| | | public PluginResult.PostOperation invokePostOperationExtendedPlugins( |
| | | PostOperationExtendedOperation extendedOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationExtendedPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(extendedOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(extendedOperation); |
| | |
| | | extendedOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | extendedOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | extendedOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation extended |
| | | // plugins registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation modify plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationModifyPlugins( |
| | | public PluginResult.PostOperation invokePostOperationModifyPlugins( |
| | | PostOperationModifyOperation modifyOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(modifyOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(modifyOperation); |
| | |
| | | modifyOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | modifyOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation modify plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation modify DN plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationModifyDNPlugins( |
| | | public PluginResult.PostOperation invokePostOperationModifyDNPlugins( |
| | | PostOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyDNPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(modifyDNOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(modifyDNOperation); |
| | |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | modifyDNOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | modifyDNOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation modify DN |
| | | // plugins registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation search plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationSearchPlugins( |
| | | public PluginResult.PostOperation invokePostOperationSearchPlugins( |
| | | PostOperationSearchOperation searchOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationSearchPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(searchOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(searchOperation); |
| | |
| | | searchOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | searchOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | searchOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation search plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-operation unbind plugins. |
| | | */ |
| | | public PostOperationPluginResult invokePostOperationUnbindPlugins( |
| | | public PluginResult.PostOperation invokePostOperationUnbindPlugins( |
| | | PostOperationUnbindOperation unbindOperation) |
| | | { |
| | | PostOperationPluginResult result = null; |
| | | PluginResult.PostOperation result = null; |
| | | PluginResult.PostOperation finalResult = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationUnbindPlugins) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | skippedPreOperationPlugins.remove(unbindOperation); |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | try |
| | | { |
| | | result = p.doPostOperation(unbindOperation); |
| | |
| | | unbindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | unbindOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | unbindOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | unbindOperation.getConnectionID(), |
| | | unbindOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | unbindOperation.setResultCode( |
| | | DirectoryServer.getServerErrorResultCode()); |
| | | unbindOperation.appendErrorMessage(message); |
| | | |
| | | return new PostOperationPluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continueProcessing()) |
| | | { |
| | | return result; |
| | | // This plugin requested operation processing to stop. However, we |
| | | // still have to invoke all the post op plugins that successfully |
| | | // invoked its pre op plugins. We will just take this plugin's |
| | | // results as the final result. |
| | | finalResult = result; |
| | | } |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-operation unbind plugins |
| | | // This should only happen if there were no post-operation add plugins |
| | | // registered, which is fine. |
| | | result = PostOperationPluginResult.SUCCESS; |
| | | finalResult = PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | else if(finalResult == null) |
| | | { |
| | | // None of the plugins requested processing to stop so all results |
| | | // have equal priority. Just return the last one. |
| | | finalResult = result; |
| | | } |
| | | |
| | | return result; |
| | | return finalResult; |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-response add plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseAddPlugins( |
| | | public PluginResult.PostResponse invokePostResponseAddPlugins( |
| | | PostResponseAddOperation addOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseAddPlugins) |
| | | { |
| | |
| | | addOperation.getConnectionID(), addOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(p.getPluginEntryDN()), |
| | | addOperation.getConnectionID(), addOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response bind plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseBindPlugins( |
| | | public PluginResult.PostResponse invokePostResponseBindPlugins( |
| | | PostResponseBindOperation bindOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseBindPlugins) |
| | | { |
| | |
| | | bindOperation.getConnectionID(), bindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | bindOperation.getConnectionID(), |
| | | bindOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response bind plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response compare plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseComparePlugins( |
| | | public PluginResult.PostResponse invokePostResponseComparePlugins( |
| | | PostResponseCompareOperation compareOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseComparePlugins) |
| | | { |
| | |
| | | compareOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response compare plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response delete plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseDeletePlugins( |
| | | public PluginResult.PostResponse invokePostResponseDeletePlugins( |
| | | PostResponseDeleteOperation deleteOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseDeletePlugins) |
| | | { |
| | |
| | | deleteOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response delete plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | * |
| | | * @return The result of processing the post-response extended plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseExtendedPlugins( |
| | | public PluginResult.PostResponse invokePostResponseExtendedPlugins( |
| | | PostResponseExtendedOperation extendedOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseExtendedPlugins) |
| | | { |
| | |
| | | extendedOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response extended plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response modify plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseModifyPlugins( |
| | | public PluginResult.PostResponse invokePostResponseModifyPlugins( |
| | | PostResponseModifyOperation modifyOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyPlugins) |
| | | { |
| | |
| | | modifyOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response modify plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response modify DN plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseModifyDNPlugins( |
| | | public PluginResult.PostResponse invokePostResponseModifyDNPlugins( |
| | | PostResponseModifyDNOperation modifyDNOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyDNPlugins) |
| | | { |
| | |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response modify DN |
| | | // plugins registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the post-response search plugins. |
| | | */ |
| | | public PostResponsePluginResult invokePostResponseSearchPlugins( |
| | | public PluginResult.PostResponse invokePostResponseSearchPlugins( |
| | | PostResponseSearchOperation searchOperation) |
| | | { |
| | | PostResponsePluginResult result = null; |
| | | PluginResult.PostResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseSearchPlugins) |
| | | { |
| | |
| | | searchOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new PostResponsePluginResult(false, false); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | |
| | | if (result == null) |
| | | { |
| | | // This should only happen if there were no post-response search plugins |
| | | // This should only happen if there were no post-response add plugins |
| | | // registered, which is fine. |
| | | result = PostResponsePluginResult.SUCCESS; |
| | | result = PluginResult.PostResponse.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the search result entry plugins. |
| | | */ |
| | | public SearchEntryPluginResult invokeSearchResultEntryPlugins( |
| | | public PluginResult.IntermediateResponse invokeSearchResultEntryPlugins( |
| | | LocalBackendSearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | SearchEntryPluginResult result = null; |
| | | PluginResult.IntermediateResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultEntryPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new SearchEntryPluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(searchEntry.getDN())); |
| | | logError(message); |
| | | |
| | | return new SearchEntryPluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no search result entry plugins |
| | | // registered, which is fine. |
| | | result = SearchEntryPluginResult.SUCCESS; |
| | | result = PluginResult.IntermediateResponse. |
| | | continueOperationProcessing(true); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the search result entry plugins. |
| | | */ |
| | | public SearchEntryPluginResult invokeSearchResultEntryPlugins( |
| | | public PluginResult.IntermediateResponse invokeSearchResultEntryPlugins( |
| | | SearchEntrySearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | SearchEntryPluginResult result = null; |
| | | PluginResult.IntermediateResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultEntryPlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new SearchEntryPluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | String.valueOf(searchEntry.getDN())); |
| | | logError(message); |
| | | |
| | | return new SearchEntryPluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no search result entry plugins |
| | | // registered, which is fine. |
| | | result = SearchEntryPluginResult.SUCCESS; |
| | | result = |
| | | PluginResult.IntermediateResponse.continueOperationProcessing(true); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the search result reference plugins. |
| | | */ |
| | | public SearchReferencePluginResult invokeSearchResultReferencePlugins( |
| | | public PluginResult.IntermediateResponse invokeSearchResultReferencePlugins( |
| | | LocalBackendSearchOperation searchOperation, |
| | | SearchResultReference searchReference) |
| | | { |
| | | SearchReferencePluginResult result = null; |
| | | PluginResult.IntermediateResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultReferencePlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new SearchReferencePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | searchReference.getReferralURLString()); |
| | | logError(message); |
| | | |
| | | return new SearchReferencePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no search result reference |
| | | // plugins registered, which is fine. |
| | | result = SearchReferencePluginResult.SUCCESS; |
| | | result = |
| | | PluginResult.IntermediateResponse.continueOperationProcessing(true); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the search result reference plugins. |
| | | */ |
| | | public SearchReferencePluginResult invokeSearchResultReferencePlugins( |
| | | public PluginResult.IntermediateResponse invokeSearchResultReferencePlugins( |
| | | SearchReferenceSearchOperation searchOperation, |
| | | SearchResultReference searchReference) |
| | | { |
| | | SearchReferencePluginResult result = null; |
| | | PluginResult.IntermediateResponse result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultReferencePlugins) |
| | | { |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new SearchReferencePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | searchReference.getReferralURLString()); |
| | | logError(message); |
| | | |
| | | return new SearchReferencePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no search result reference |
| | | // plugins registered, which is fine. |
| | | result = SearchReferencePluginResult.SUCCESS; |
| | | result = |
| | | PluginResult.IntermediateResponse.continueOperationProcessing(true); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the subordinate modify DN plugins. |
| | | */ |
| | | public SubordinateModifyDNPluginResult invokeSubordinateModifyDNPlugins( |
| | | public PluginResult.SubordinateModifyDN invokeSubordinateModifyDNPlugins( |
| | | SubordinateModifyDNOperation modifyDNOperation, Entry oldEntry, |
| | | Entry newEntry, List<Modification> modifications) |
| | | { |
| | | SubordinateModifyDNPluginResult result = null; |
| | | PluginResult.SubordinateModifyDN result = null; |
| | | |
| | | for (DirectoryServerPlugin p : subordinateModifyDNPlugins) |
| | | { |
| | |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logError(ERR_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_EXCEPTION.get( |
| | | |
| | | Message message = |
| | | ERR_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_EXCEPTION.get( |
| | | String.valueOf(p.getPluginEntryDN()), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e))); |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new SubordinateModifyDNPluginResult(false, false, true); |
| | | return PluginResult.SubordinateModifyDN.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logError(ERR_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_RETURNED_NULL.get( |
| | | Message message = |
| | | ERR_PLUGIN_SUBORDINATE_MODIFY_DN_PLUGIN_RETURNED_NULL.get( |
| | | String.valueOf(p.getPluginEntryDN()), |
| | | modifyDNOperation.getConnectionID(), |
| | | String.valueOf(modifyDNOperation.getOperationID()))); |
| | | String.valueOf(modifyDNOperation.getOperationID())); |
| | | logError(message); |
| | | |
| | | return new SubordinateModifyDNPluginResult(false, false, true); |
| | | return PluginResult.SubordinateModifyDN.stopProcessing( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no subordinate modify DN plugins |
| | | // registered, which is fine. |
| | | result = SubordinateModifyDNPluginResult.SUCCESS; |
| | | result = PluginResult.SubordinateModifyDN.continueOperationProcessing(); |
| | | } |
| | | |
| | | return result; |
| | |
| | | * |
| | | * @return The result of processing the intermediate response plugins. |
| | | */ |
| | | public IntermediateResponsePluginResult |
| | | public PluginResult.IntermediateResponse |
| | | invokeIntermediateResponsePlugins( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | | IntermediateResponsePluginResult result = null; |
| | | PluginResult.IntermediateResponse result = null; |
| | | Operation operation = intermediateResponse.getOperation(); |
| | | |
| | | for (DirectoryServerPlugin p : intermediateResponsePlugins) |
| | |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return new IntermediateResponsePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing |
| | | (false, DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | |
| | | if (result == null) |
| | |
| | | operation.getConnectionID(), operation.getOperationID()); |
| | | logError(message); |
| | | |
| | | return new IntermediateResponsePluginResult(false, false, false, false); |
| | | return PluginResult.IntermediateResponse.stopProcessing |
| | | (false, DirectoryServer.getServerErrorResultCode(), message); |
| | | } |
| | | else if (result.connectionTerminated() || |
| | | (! result.continuePluginProcessing())) |
| | | else if (! result.continuePluginProcessing()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // This should only happen if there were no intermediate response plugins |
| | | // registered, which is fine. |
| | | result = IntermediateResponsePluginResult.SUCCESS; |
| | | result = |
| | | PluginResult.IntermediateResponse.continueOperationProcessing(true); |
| | | } |
| | | |
| | | return result; |
| | |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | | private void registerSkippedPreOperationPlugins(int i, |
| | | DirectoryServerPlugin[] plugins, |
| | | PluginOperation operation) |
| | | { |
| | | ArrayList<DirectoryServerPlugin> skippedPlugins = |
| | | new ArrayList<DirectoryServerPlugin>(plugins.length - i); |
| | | for(int j = i; j < plugins.length; j++) |
| | | { |
| | | skippedPlugins.add(plugins[j]); |
| | | } |
| | | skippedPreOperationPlugins.put(operation, skippedPlugins); |
| | | } |
| | | |
| | | private void registerSkippedPreOperationPlugin(DirectoryServerPlugin plugin, |
| | | PluginOperation operation) |
| | | { |
| | | ArrayList<DirectoryServerPlugin> existingList = |
| | | skippedPreOperationPlugins.get(operation); |
| | | if(existingList == null) |
| | | { |
| | | existingList = new ArrayList<DirectoryServerPlugin>(); |
| | | } |
| | | existingList.add(plugin); |
| | | skippedPreOperationPlugins.put(operation, existingList); |
| | | } |
| | | } |
| | | |