| | |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor.Arg4; |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor.Arg5; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | |
| | | for (PluginCfgDefn.PluginType pluginType : pluginConfiguration.getPluginType()) |
| | | { |
| | | PluginType t = getPluginType(pluginType); |
| | | if ((pluginTypes == null) || pluginTypes.contains(t)) |
| | | if (pluginTypes == null || pluginTypes.contains(t)) |
| | | { |
| | | initTypes.add(t); |
| | | } |
| | |
| | | |
| | | try |
| | | { |
| | | Iterator<DirectoryServerPlugin<? extends PluginCfg>> iterator = |
| | | registeredPlugins.values().iterator(); |
| | | while (iterator.hasNext()) |
| | | for (DirectoryServerPlugin<? extends PluginCfg> plugin : registeredPlugins.values()) |
| | | { |
| | | try |
| | | { |
| | | iterator.next().finalizePlugin(); |
| | | plugin.finalizePlugin(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | // wildcard, then simply add the new plugin to the end of the list. |
| | | // Otherwise, parse the order string and figure out where to put the |
| | | // provided plugin. |
| | | if ((pluginOrder == null) || |
| | | ((pluginOrder = pluginOrder.trim()).length() == 0) || |
| | | pluginOrder.equals("*")) |
| | | if (pluginOrder == null |
| | | || (pluginOrder = pluginOrder.trim()).length() == 0 |
| | | || pluginOrder.equals("*")) |
| | | { |
| | | DirectoryServerPlugin[] newPlugins = |
| | | new DirectoryServerPlugin[pluginArray.length+1]; |
| | |
| | | System.arraycopy(pluginArray, 0, newPlugins, 0, slot); |
| | | } |
| | | |
| | | if (slot < (length-1)) |
| | | if (slot < length-1) |
| | | { |
| | | System.arraycopy(pluginArray, slot+1, newPlugins, slot, (length-slot-1)); |
| | | System.arraycopy(pluginArray, slot+1, newPlugins, slot, length-slot-1); |
| | | } |
| | | |
| | | return newPlugins; |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseAbandonPlugins) |
| | | { |
| | | if (abandonOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(abandonOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseAddPlugins) |
| | | { |
| | | if (addOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(addOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseBindPlugins) |
| | | { |
| | | if (bindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(bindOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseComparePlugins) |
| | | { |
| | | if (compareOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(compareOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseDeletePlugins) |
| | | { |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(deleteOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseExtendedPlugins) |
| | | { |
| | | if (extendedOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(extendedOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyPlugins) |
| | | { |
| | | if (modifyOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyDNPlugins) |
| | | { |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyDNOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseSearchPlugins) |
| | | { |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(searchOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : preParseUnbindPlugins) |
| | | { |
| | | if (unbindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(unbindOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationAddPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationAddPlugins[i]; |
| | | if (addOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(addOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationBindPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationBindPlugins[i]; |
| | | if (bindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(bindOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationComparePlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationComparePlugins[i]; |
| | | if (compareOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(compareOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationDeletePlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationDeletePlugins[i]; |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(deleteOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationExtendedPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationExtendedPlugins[i]; |
| | | if (extendedOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(extendedOperation, p)) |
| | | { |
| | | registerSkippedPreOperationPlugin(p, extendedOperation); |
| | | continue; |
| | |
| | | for (int i = 0; i < preOperationModifyPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationModifyPlugins[i]; |
| | | if (modifyOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationModifyDNPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationModifyDNPlugins[i]; |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyDNOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | for (int i = 0; i < preOperationSearchPlugins.length; i++) |
| | | { |
| | | DirectoryServerPlugin p = preOperationSearchPlugins[i]; |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(searchOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAbandonPlugins) |
| | | { |
| | | if (abandonOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(abandonOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | abandonOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | abandonOperation.getConnectionID(), |
| | | abandonOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(abandonOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | abandonOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | abandonOperation.getConnectionID(), |
| | | abandonOperation.getOperationID()); |
| | | logNullResult(abandonOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAddPlugins) |
| | | { |
| | | if (addOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(addOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | addOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | addOperation.getConnectionID(), addOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(addOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | addOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | addOperation.getConnectionID(), addOperation.getOperationID()); |
| | | logNullResult(addOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationBindPlugins) |
| | | { |
| | | if (bindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(bindOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | bindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | bindOperation.getConnectionID(), bindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(bindOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | bindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | bindOperation.getConnectionID(), |
| | | bindOperation.getOperationID()); |
| | | logNullResult(bindOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationComparePlugins) |
| | | { |
| | | if (compareOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(compareOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | compareOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(compareOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | compareOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID()); |
| | | logNullResult(compareOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | return finalResult; |
| | | } |
| | | |
| | | private boolean isInternalOperation(PluginOperation op, DirectoryServerPlugin p) |
| | | { |
| | | return op.isInternalOperation() && !p.invokeForInternalOperations(); |
| | | } |
| | | |
| | | private boolean isSkipped(ArrayList<DirectoryServerPlugin> skippedPlugins, DirectoryServerPlugin p) |
| | | { |
| | | return skippedPlugins != null && skippedPlugins.contains(p); |
| | | } |
| | | |
| | | /** |
| | | * Invokes the set of post-operation delete plugins that have been configured |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationDeletePlugins) |
| | | { |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(deleteOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | deleteOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(deleteOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | deleteOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID()); |
| | | logNullResult(deleteOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationExtendedPlugins) |
| | | { |
| | | if (extendedOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(extendedOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | extendedOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(extendedOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | extendedOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID()); |
| | | logNullResult(extendedOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyPlugins) |
| | | { |
| | | if (modifyOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(modifyOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | modifyOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | modifyOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID()); |
| | | logNullResult(modifyOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyDNPlugins) |
| | | { |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(modifyDNOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | modifyDNOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyDNOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | modifyDNOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID()); |
| | | logNullResult(modifyDNOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationSearchPlugins) |
| | | { |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(searchOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | searchOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(searchOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | searchOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID()); |
| | | logNullResult(searchOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postOperationUnbindPlugins) |
| | | { |
| | | if (unbindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if(skippedPlugins != null && skippedPlugins.contains(p)) |
| | | if (isInternalOperation(unbindOperation, p) |
| | | || isSkipped(skippedPlugins, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION, |
| | | unbindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | unbindOperation.getConnectionID(), |
| | | unbindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(unbindOperation, p, e, ERR_PLUGIN_POST_OPERATION_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL, |
| | | unbindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | unbindOperation.getConnectionID(), |
| | | unbindOperation.getOperationID()); |
| | | logNullResult(unbindOperation, p, ERR_PLUGIN_POST_OPERATION_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continueProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseAddPlugins) |
| | | { |
| | | if (addOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(addOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | addOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | addOperation.getConnectionID(), addOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(addOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | addOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | addOperation.getConnectionID(), addOperation.getOperationID()); |
| | | logNullResult(addOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseBindPlugins) |
| | | { |
| | | if (bindOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(bindOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | bindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | bindOperation.getConnectionID(), bindOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(bindOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | bindOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | bindOperation.getConnectionID(), |
| | | bindOperation.getOperationID()); |
| | | logNullResult(bindOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseComparePlugins) |
| | | { |
| | | if (compareOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(compareOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | compareOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(compareOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | compareOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | compareOperation.getConnectionID(), |
| | | compareOperation.getOperationID()); |
| | | logNullResult(compareOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Invokes the set of post-response delete plugins that have been configured |
| | | * in the Directory Server. |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseDeletePlugins) |
| | | { |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(deleteOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | deleteOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(deleteOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | deleteOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID()); |
| | | logNullResult(deleteOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseExtendedPlugins) |
| | | { |
| | | if (extendedOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(extendedOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | extendedOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(extendedOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | extendedOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | extendedOperation.getConnectionID(), |
| | | extendedOperation.getOperationID()); |
| | | logNullResult(extendedOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyPlugins) |
| | | { |
| | | if (modifyOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | modifyOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | modifyOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID()); |
| | | logNullResult(modifyOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyDNPlugins) |
| | | { |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyDNOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | modifyDNOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyDNOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | modifyDNOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID()); |
| | | logNullResult(modifyDNOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | |
| | | for (DirectoryServerPlugin p : postResponseSearchPlugins) |
| | | { |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(searchOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION, |
| | | searchOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(searchOperation, p, e, ERR_PLUGIN_POST_RESPONSE_PLUGIN_EXCEPTION); |
| | | } |
| | | |
| | | if (result == null) |
| | | { |
| | | logger.error(ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL, |
| | | searchOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID()); |
| | | logNullResult(searchOperation, p, ERR_PLUGIN_POST_RESPONSE_PLUGIN_RETURNED_NULL); |
| | | } |
| | | else if (!result.continuePluginProcessing()) |
| | | { |
| | |
| | | return result; |
| | | } |
| | | |
| | | private void logException(PluginOperation op, DirectoryServerPlugin p, Exception e, |
| | | Arg5<Object, Object, Number, Number, Object> errorMsg) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(errorMsg, |
| | | op.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | op.getConnectionID(), op.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | |
| | | private void logNullResult(PluginOperation op, DirectoryServerPlugin p, |
| | | Arg4<Object, Object, Number, Number> nullResultMsg) |
| | | { |
| | | logger.error(nullResultMsg, |
| | | op.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | op.getConnectionID(), op.getOperationID()); |
| | | } |
| | | |
| | | /** |
| | | * Invokes the set of post-synchronization add plugins that have been |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION, |
| | | addOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | addOperation.getConnectionID(), addOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(addOperation, p, e, ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION, |
| | | deleteOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | deleteOperation.getConnectionID(), |
| | | deleteOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(deleteOperation, p, e, ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Invokes the set of post-synchronization modify plugins that have been |
| | | * configured in the Directory Server. |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION, |
| | | modifyOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyOperation.getConnectionID(), |
| | | modifyOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyOperation, p, e, ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION, |
| | | modifyDNOperation.getOperationType().getOperationName(), |
| | | p.getPluginEntryDN(), |
| | | modifyDNOperation.getConnectionID(), |
| | | modifyDNOperation.getOperationID(), |
| | | stackTraceToSingleLineString(e)); |
| | | logException(modifyDNOperation, p, e, ERR_PLUGIN_POST_SYNCHRONIZATION_PLUGIN_EXCEPTION); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : searchResultEntryPlugins) |
| | | { |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(searchOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : searchResultReferencePlugins) |
| | | { |
| | | if (searchOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(searchOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : subordinateModifyDNPlugins) |
| | | { |
| | | if (modifyDNOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (isInternalOperation(modifyDNOperation, p)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | for (DirectoryServerPlugin p : subordinateDeletePlugins) |
| | | { |
| | | if (deleteOperation.isInternalOperation() && |
| | | (! p.invokeForInternalOperations())) |
| | | if (deleteOperation.isInternalOperation() && !p.invokeForInternalOperations()) |
| | | { |
| | | continue; |
| | | } |