{
StringValue ref = ( StringValue ) value;
String refVal = ref.getString();
LdapUrl ldapUrl = new LdapUrl( refVal );
// We have a LDAP URL, we have to check that :
// - we don't have scope specifier
// - we don't have filters
// - we don't have attribute description list
// - we don't have extensions
// - the Dn is not empty
if ( ldapUrl.getScope() != SearchScope.OBJECT )
{
// This is the default value if we don't have any scope
// Let's assume that it's incorrect if we get something
// else in the LdapURL
String message = I18n.err( I18n.ERR_36 );
LOG.error( message );
throw new LdapException( message );
}
if ( !Strings.isEmpty( ldapUrl.getFilter() ) )
{
String message = I18n.err( I18n.ERR_37 );
LOG.error( message );
throw new LdapException( message );
}
if ( ( ldapUrl.getAttributes() != null ) && ( ldapUrl.getAttributes().size() != 0 ) )
{
String message = I18n.err( I18n.ERR_38 );
LOG.error( message );
throw new LdapException( message );
}
if ( ( ldapUrl.getExtensions() != null ) && ( ldapUrl.getExtensions().size() != 0 ) )
{
String message = I18n.err( I18n.ERR_39 );
LOG.error( message );
throw new LdapException( message );
}
if ( ( ldapUrl.getExtensions() != null ) && ( ldapUrl.getExtensions().size() != 0 ) )
{
String message = I18n.err( I18n.ERR_40 );
LOG.error( message );
throw new LdapException( message );
}
Dn dn = ldapUrl.getDn();
if ( ( dn == null ) || dn.isEmpty() )
{
String message = I18n.err( I18n.ERR_41 );
LOG.error( message );