Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
[BZ 1303952] Separate EAP6 instances from EAP7 instances by using dom…
Browse files Browse the repository at this point in the history
…ain version (sort of like Wildfly 8 detection was done). Keep the "EAP" as SHORT_NAME since several feature detections are using EAP as magic word
  • Loading branch information
Michael Burman committed Feb 11, 2016
1 parent 6139191 commit f01d65c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Expand Up @@ -302,6 +302,9 @@ private void validateServerAttributes() throws InvalidPluginConfigurationExcepti
runtimeProductName = AS.PRODUCT_NAME;
}
}
if(runtimeProductName.equals("JBoss EAP")) {
runtimeProductName = "EAP";
}
if (!runtimeProductName.equals(expectedRuntimeProductName)) {
throw new InvalidPluginConfigurationException("The original product type discovered for this server was "
+ expectedRuntimeProductName + ", but the server is now reporting its product type is ["
Expand Down
Expand Up @@ -32,6 +32,7 @@ public enum JBossProductType {

AS("AS", "JBoss AS 7", "JBoss Application Server 7", "AS"),
EAP("EAP", "JBoss EAP 6", "JBoss Enterprise Application Platform 6", "EAP"),
EAP7("EAP", "JBoss EAP 7", "JBoss Enterprise Application Platform 7", "EAP"),
ISPN("ISPN", "Infinispan Server", "Infinispan Server", "Infinispan Server"),
JDG("JDG", "JBoss JDG 6", "JBoss Data Grid 6", "Data Grid"),
JPP("JPP", "JBoss JPP 6", "JBoss Portal Platform 6", "Portal Platform"),
Expand Down Expand Up @@ -76,7 +77,7 @@ public static JBossProductType determineJBossProductType(File homeDir) {
*/
public static JBossProductType determineJBossProductType(File homeDir, String apiVersion) {
try {
JBossProductType jBossProductType = determineJBossProductTypeViaProductConfFile(homeDir);
JBossProductType jBossProductType = determineJBossProductTypeViaProductConfFile(homeDir, apiVersion);
if (jBossProductType==null) {
// Wildfly and The Server Formerly Known AS JBossAS share the same absence of a slot
// and thus have no product type. So we need to check differently
Expand Down Expand Up @@ -105,7 +106,7 @@ public static JBossProductType getValueByProductName(String productName) {
throw new IllegalArgumentException("No product type with product-name '" + productName + "' is known.");
}

private static JBossProductType determineJBossProductTypeViaProductConfFile(File homeDir) throws Exception {
private static JBossProductType determineJBossProductTypeViaProductConfFile(File homeDir, String apiVersion) throws Exception {
JBossProductType productType;
File productConfFile = new File(homeDir, "bin/product.conf");
if (productConfFile.exists()) {
Expand All @@ -125,6 +126,9 @@ private static JBossProductType determineJBossProductTypeViaProductConfFile(File
}
if (slot.equals("eap")) {
productType = JBossProductType.EAP;
if(apiVersion.startsWith("4")) {
productType = JBossProductType.EAP7;
}
} else if (slot.equals("ispn")) {
productType = JBossProductType.ISPN;
} else if (slot.equals("jdg")) {
Expand Down
Expand Up @@ -334,8 +334,7 @@ else if (supportsLoginModuleOptionType(grandParentType)) {
Result result = getASConnection().execute(op);
if (result.isSuccess()) {
//populate attribute values
List<Value> currentAttributeState = new ArrayList<Value>();
currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
List<Value> currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
ModuleOptionsComponent.loadModuleOptionType(attribute));

//locate specific node and populate the config
Expand Down

0 comments on commit f01d65c

Please sign in to comment.