checkIfCanceled(false);
// Get the extended operation handler for the request OID. If there is
// none, then fail.
ExtendedOperationHandler handler =
DirectoryServer.getExtendedOperationHandler(requestOID);
if (handler == null)
{
setResultCode(ResultCode.UNWILLING_TO_PERFORM);
appendErrorMessage(ERR_EXTENDED_NO_HANDLER.get(
String.valueOf(requestOID)));
return;
}
// Look at the controls included in the request and ensure that all
// critical controls are supported by the handler.
List<Control> requestControls = getRequestControls();
if ((requestControls != null) && (! requestControls.isEmpty()))
{
for (Control c : requestControls)
{
try
{
if (!AccessControlConfigManager.getInstance()
.getAccessControlHandler().isAllowed(
this.getAuthorizationDN(), this, c))
{
setResultCode(ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
appendErrorMessage(ERR_CONTROL_INSUFFICIENT_ACCESS_RIGHTS
.get(c.getOID()));
return;
}
}
catch (DirectoryException e)
{
setResultCode(e.getResultCode());
appendErrorMessage(e.getMessageObject());
return;
}
if (! c.isCritical())
{
// The control isn't critical, so we don't care if it's supported
// or not.
}
else if (! handler.supportsControl(c.getOID()))
{
setResultCode(ResultCode.UNAVAILABLE_CRITICAL_EXTENSION);
appendErrorMessage(ERR_EXTENDED_UNSUPPORTED_CRITICAL_CONTROL.get(
String.valueOf(requestOID),
c.getOID()));
return;
}
}
}
// Check to see if the client has permission to perform the
// extended operation.
// FIXME: for now assume that this will check all permission
// pertinent to the operation. This includes proxy authorization
// and any other controls specified.
try
{
if (AccessControlConfigManager.getInstance()
.getAccessControlHandler().isAllowed(this) == false)
{
setResultCode(ResultCode.INSUFFICIENT_ACCESS_RIGHTS);
appendErrorMessage(ERR_EXTENDED_AUTHZ_INSUFFICIENT_ACCESS_RIGHTS
.get(String.valueOf(requestOID)));
return;
}
}
catch (DirectoryException e)
{
setResultCode(e.getResultCode());
appendErrorMessage(e.getMessageObject());
return;
}
try
{
// Invoke the pre-operation extended plugins.
PluginResult.PreOperation preOpResult =
pluginConfigManager.invokePreOperationExtendedPlugins(this);
if(!preOpResult.continueProcessing())
{
setResultCode(preOpResult.getResultCode());
appendErrorMessage(preOpResult.getErrorMessage());
setMatchedDN(preOpResult.getMatchedDN());
setReferralURLs(preOpResult.getReferralURLs());
return;
}
checkIfCanceled(false);
// Actually perform the processing for this operation.
handler.processExtendedOperation(this);
}
finally
{
pluginConfigManager.invokePostOperationExtendedPlugins(this);