throw new IllegalArgumentException( msg );
}
int newId = messageId.incrementAndGet();
BindOperationContext bindContext = new BindOperationContext( null );
bindContext.setCredentials( bindRequest.getCredentials() );
bindContext.setDn( bindRequest.getName() );
OperationManager operationManager = directoryService.getOperationManager();
BindResponse bindResp = new BindResponseImpl( newId );
bindResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
try
{
if ( !bindRequest.isSimple() )
{
bindContext.setSaslMechanism( bindRequest.getSaslMechanism() );
}
operationManager.bind( bindContext );
session = bindContext.getSession();
bindResp.addAllControls( bindContext.getResponseControls() );
}
catch ( LdapOperationException e )
{
LOG.warn( e.getMessage(), e );
LdapResult res = bindResp.getLdapResult();