private void validateAttributes()
{
String name = getName();
if (name == null || "".equals(name.trim()))
{
throw new IllegalConfigurationException("Virtual host name must be specified");
}
String configurationFile = (String) getAttribute(CONFIG_PATH);
String type = (String) getAttribute(TYPE);
boolean invalidAttributes = false;
if (configurationFile == null)
{
if (type == null)
{
invalidAttributes = true;
}
else
{
validateAttributes(type);
}
}/*
else
{
if (type != null)
{
invalidAttributes = true;
}
}*/
if (invalidAttributes)
{
throw new IllegalConfigurationException("Please specify either the 'configPath' attribute or 'type' attributes");
}
// pre-load the configuration in order to validate
try
{
createVirtualHostConfiguration(name);
}
catch(ConfigurationException e)
{
throw new IllegalConfigurationException("Failed to validate configuration", e);
}
}