}
}
}
Config config = domain.getConfigNamed(cluster.getConfigRef());
JmsService jmsService = config.getExtensionByType(JmsService.class);
if(jmsService == null) {
report.setMessage(localStrings.getLocalString("configure.jms.cluster.nojmsservice",
"No JMS Service element in config"));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
if(! CONVENTIONAL.equalsIgnoreCase(clusterType) && ! ENHANCED.equalsIgnoreCase(clusterType)){
report.setMessage(localStrings.getLocalString("configure.jms.cluster.wrongClusterType",
"Invalid option sepecified for clustertype. Valid options are conventional and enhanced"));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
if (CONVENTIONAL.equalsIgnoreCase(clusterType) && ! MASTER_BROKER.equalsIgnoreCase(configStoreType) && ! SHARED_DB.equalsIgnoreCase(configStoreType)){
report.setMessage(localStrings.getLocalString("configure.jms.cluster.wrongConfigStoreType",
"Invalid option sepecified for configstoretype. Valid options are masterbroker and shareddb"));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
if(ENHANCED.equalsIgnoreCase(clusterType) && configStoreType != null){
report.setMessage(localStrings.getLocalString("configure.jms.cluster.wrongStoreType",
"configstoretype option is not configurable for Enhanced clusters."));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
if (CONVENTIONAL.equalsIgnoreCase(clusterType) && ! MASTER_BROKER.equalsIgnoreCase(configStoreType) && ! FILE.equalsIgnoreCase(messageStoreType) && ! JDBC.equalsIgnoreCase(messageStoreType)){
report.setMessage(localStrings.getLocalString("configure.jms.cluster.wrongMessageStoreType",
"Invalid option sepecified for messagestoretype. Valid options are file and jdbc"));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
if(ENHANCED.equalsIgnoreCase(clusterType) && messageStoreType != null){
report.setMessage(localStrings.getLocalString("configure.jms.cluster.wrongmsgStoreType",
"messagestoretype option is not configurable for Enhanced clusters."));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
String integrationMode = jmsService.getType();
if(REMOTE.equalsIgnoreCase(integrationMode)) {
report.setMessage(localStrings.getLocalString("configure.jms.cluster.remoteMode",
"JMS integration mode should be either EMBEDDED or LOCAL to run this command. Please use the asadmin.set command to change the integration mode"));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;