{
ServerStringValue ref = ( ServerStringValue ) 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() != SearchControls.OBJECT_SCOPE )
{
// 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 = "An LDAPURL should not contains a scope";
LOG.error( message );
throw new NamingException( message );
}
if ( !StringTools.isEmpty( ldapUrl.getFilter() ) )
{
String message = "An LDAPURL should not contains filters";
LOG.error( message );
throw new NamingException( message );
}
if ( ( ldapUrl.getAttributes() != null ) && ( ldapUrl.getAttributes().size() != 0 ) )
{
String message = "An LDAPURL should not contains any description attribute list";
LOG.error( message );
throw new NamingException( message );
}
if ( ( ldapUrl.getExtensions() != null ) && ( ldapUrl.getExtensions().size() != 0 ) )
{
String message = "An LDAPURL should not contains any extension";
LOG.error( message );
throw new NamingException( message );
}
if ( ( ldapUrl.getExtensions() != null ) && ( ldapUrl.getExtensions().size() != 0 ) )
{
String message = "An LDAPURL should not contains any critical extension";
LOG.error( message );
throw new NamingException( message );
}
LdapDN dn = ldapUrl.getDn();
if ( ( dn == null ) || dn.isEmpty() )
{
String message = "An LDAPURL should contains a non-empty DN";
LOG.error( message );