* @throws EncoderException on codec failures
*/
private SearchControls createSearchControls( DirContext ctx, int sizeLimit, int pagedSize )
throws NamingException, EncoderException
{
SearchControls controls = new SearchControls();
controls.setCountLimit( sizeLimit );
controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
PagedResultsDecorator pagedSearchControl = new PagedResultsDecorator( codec );
pagedSearchControl.setSize( pagedSize );
( ( LdapContext ) ctx ).setRequestControls( JndiUtils.toJndiControls( codec, new Control[]
{ pagedSearchControl } ) );