*/
public class ExtendedHandler extends LdapRequestHandler<InternalExtendedRequest>
{
public void handle( LdapSession session, InternalExtendedRequest req ) throws Exception
{
ExtendedOperationHandler handler = getLdapServer().getExtendedOperationHandler( req.getOid() );
if ( handler == null )
{
// As long as no extended operations are implemented, send appropriate
// error back to the client.
String msg = "Unrecognized extended operation EXTENSION_OID: " + req.getOid();
InternalLdapResult result = req.getResultResponse().getLdapResult();
result.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
result.setErrorMessage( msg );
session.getIoSession().write( req.getResultResponse() );
return;
}
try
{
handler.handleExtendedOperation( session, req );
}
catch ( Exception e )
{
InternalLdapResult result = req.getResultResponse().getLdapResult();
result.setResultCode( ResultCodeEnum.OTHER );