{
syntax.finalizeSyntax();
}
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
// Get the class for the attribute syntax. If the syntax is already
// enabled, then we shouldn't do anything with it although if the class has
// changed then we'll at least need to indicate that administrative action
// is required. If the syntax is disabled, then instantiate the class and
// initialize and register it as an attribute syntax.
String className = configuration.getJavaClass();
if (existingSyntax != null)
{
if (! className.equals(existingSyntax.getClass().getName()))
{
adminActionRequired = true;
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
AttributeSyntax syntax = null;
try
{
syntax = loadSyntax(className, configuration, true);
try
{
DirectoryServer.registerAttributeSyntax(syntax, false);
syntaxes.put(configuration.dn(), syntax);
}
catch (DirectoryException de)
{
Message message = WARN_CONFIG_SCHEMA_SYNTAX_CONFLICTING_SYNTAX.get(
String.valueOf(configuration.dn()),
de.getMessageObject());
messages.add(message);
if (resultCode == ResultCode.SUCCESS)
{
resultCode = DirectoryServer.getServerErrorResultCode();
}
}
}
catch (InitializationException ie)
{
if (resultCode == ResultCode.SUCCESS)
{
resultCode = DirectoryServer.getServerErrorResultCode();
}
messages.add(ie.getMessageObject());
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}