Methods Summary |
---|
private final void | checkConfigRefValidity(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
checkConfigRefValidity(getServer(cce).getConfigRef(), result);
|
private void | checkConfigRefValidity(java.lang.String config_ref, com.sun.enterprise.config.serverbeans.validation.Result result)
if (config_ref.equals(StaticTest.DAS_CONFIG_NAME)){
result.failed(smh.getLocalString(getClass().getName()+".cannotHaveDASasConfig",
"The configuration of the Domain Administration Server (named {0}) cannot be referenced by a server",
new Object[]{StaticTest.DAS_CONFIG_NAME}));
} else if (config_ref.equals(StaticTest.CONFIG_TEMPLATE_NAME)){
result.failed(smh.getLocalString(getClass().getName()+".cannotHaveTemplateConfig",
"The default configuration template (named {0}) cannot be referenced by a server",
new Object[]{StaticTest.CONFIG_TEMPLATE_NAME}));
}
|
private void | checkNameNotAgent(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
final Server s = getServer(cce);
if ("agent".equals(s.getName())){
result.failed(smh.getLocalString(getClass().getName() + ".illegalServerName",
"Illegal Server Name {0}", new Object[]{s.getName()}));
}
|
protected final java.lang.String | getName(com.sun.enterprise.config.ConfigContextEvent cce)
return getServer(cce).getName();
|
protected final java.util.Set | getReferers(com.sun.enterprise.config.ConfigContextEvent cce)
return ServerBeansFactory.getReferers(getServer(cce), cce.getConfigContext());
|
private com.sun.enterprise.config.serverbeans.Server | getServer(com.sun.enterprise.config.ConfigContextEvent cce)
return (Server) cce.getValidationTarget();
|
protected final boolean | isReferenced(com.sun.enterprise.config.ConfigContextEvent cce)
return ServerBeansFactory.isReferenced(getServer(cce), cce.getConfigContext());
|
private void | preventChangeToConfigRef(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
if (cce.getName().equals(ServerTags.CONFIG_REF)){
result.failed(smh.getLocalString(getClass().getName()+".noChangeToConfigRefInCluster",
"Cannot change a config-ref when the instance is part of a cluster"));
}
|
private void | preventChangeToNodeAgentRef(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
if (cce.getName().equals(ServerTags.NODE_AGENT_REF)){
result.failed(smh.getLocalString(getClass().getName()+".noChangeToNodeAgentRef",
"Cannot change a node agent ref"));
}
|
private final void | preventInvalidConfigRef(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
if (cce.getName().equals(ServerTags.CONFIG_REF)){
checkConfigRefValidity((String) cce.getObject(), result);
}
|
public com.sun.enterprise.config.serverbeans.validation.Result | validate(com.sun.enterprise.config.ConfigContextEvent cce)
Result result = super.validate(cce); // Before doing custom validation do basic validation
boolean flag = false;
String choice = cce.getChoice();
try {
if (choice.equals(StaticTest.SET)){
validateSet(cce, result);
} else if (choice.equals(StaticTest.UPDATE)){
validateUpdate(cce, result);
} else if (choice.equals(StaticTest.ADD)){
validateAdd(cce, result);
} else if(choice.equals(StaticTest.VALIDATE)) {
Domain domain = (Domain)cce.getConfigContext().getRootConfigBean();
Servers servers = domain.getServers();
Server[] server = servers.getServer();
String svrName = server[0].getName();
if(!server[0].getName().equals("server"))
result.failed(smh.getLocalString(getClass().getName() + ".invalidserverName",
"Invalid Server Name {0}: Required 'server'", new Object[]{svrName}));
}
} catch(Exception e) {
_logger.log(Level.FINE, "domainxmlverifier.exception", e);
}
return result;
|
void | validateAdd(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
checkNameNotAgent(cce, result);
checkConfigRefValidity(cce, result);
|
private void | validateAttributeChange(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
checkNameNotAgent(cce, result);
preventChangeToNodeAgentRef(cce, result);
if (this.isReferenced(cce)){
preventChangeToConfigRef(cce, result);
} else {
preventInvalidConfigRef(cce, result);
}
|
private void | validateSet(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
validateAttributeChange(cce, result);
|
void | validateUpdate(com.sun.enterprise.config.ConfigContextEvent cce, com.sun.enterprise.config.serverbeans.validation.Result result)
validateAttributeChange(cce, result);
|