From b2d9540db94ce5754a4d891d4f120199cbe6a40a Mon Sep 17 00:00:00 2001 From: Michael Burman Date: Wed, 23 Mar 2016 11:13:32 +0200 Subject: [PATCH] [BZ 1313863] Add support for patching of EAP7 instances, clear some garbage --- .../java/org/rhq/common/wildfly/Patch.java | 6 + .../org/rhq/common/wildfly/PatchParser.java | 12 +- .../rhq/common/wildfly/PatchProductType.java | 66 ++++++ modules/enterprise/server/plugins/pom.xml | 1 + .../plugins/wfly-10-patch-bundle/pom.xml | 137 ++++++++++++ ...fly10PatchBundleServerPluginComponent.java | 206 ++++++++++++++++++ .../resources/META-INF/rhq-serverplugin.xml | 33 +++ ...ldflyPatchBundleServerPluginComponent.java | 9 +- .../wildfly10/BaseProcessDiscovery.java | 3 - .../wildfly10/BaseServerComponent.java | 12 - .../patching/PatchHandlerComponent.java | 12 - .../PatchHandlerDiscoveryComponent.java | 4 +- .../main/resources/META-INF/rhq-plugin.xml | 18 +- 13 files changed, 467 insertions(+), 52 deletions(-) create mode 100644 modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchProductType.java create mode 100644 modules/enterprise/server/plugins/wfly-10-patch-bundle/pom.xml create mode 100644 modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wfly10patch/Wildfly10PatchBundleServerPluginComponent.java create mode 100644 modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/resources/META-INF/rhq-serverplugin.xml diff --git a/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/Patch.java b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/Patch.java index a0e065e684c..03b578dd830 100644 --- a/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/Patch.java +++ b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/Patch.java @@ -44,6 +44,7 @@ public String toString() { private final String id; private final Type type; private final String identityName; + private final PatchProductType productType; private final String targetVersion; private final String description; private final String contents; @@ -52,6 +53,7 @@ public Patch(String id, Type type, String identityName, String targetVersion, St this.id = id; this.type = type; this.identityName = identityName; + this.productType = PatchProductType.getValueByProductName(identityName); this.targetVersion = targetVersion; this.description = description; this.contents = contents; @@ -81,6 +83,10 @@ public String getContents() { return contents; } + public PatchProductType getProductType() { + return productType; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchParser.java b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchParser.java index c980480cbb1..a657a70829e 100644 --- a/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchParser.java +++ b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchParser.java @@ -27,6 +27,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -44,7 +46,8 @@ */ public final class PatchParser { private static final String PATCHES_NAMESPACE_URI = "urn:jboss:patch:bundle:1.0"; - private static final String PATCH_NAMESPACE_URI = "urn:jboss:patch:1.0"; + private static final String PATCH_NAMESPACE_URI_REGEXP = "urn:jboss:patch:1[.][012]"; + private static final Pattern NAMESPACE_PATTERN = Pattern.compile(PATCH_NAMESPACE_URI_REGEXP); private PatchParser() { @@ -190,16 +193,15 @@ private static Patch parsePatchXml(InputStream patchXmlStream, boolean captureCo continue; } + QName name = rdr.getName(); if (!foundPatch) { if (foundElements) { throw new IllegalArgumentException("Not a Wildfly patch"); } - String namespace = rdr.getName().getNamespaceURI(); - foundPatch = PATCH_NAMESPACE_URI.equals(namespace) && "patch".equals(rdr.getName().getLocalPart()); + foundPatch = NAMESPACE_PATTERN.matcher(name.getNamespaceURI()).matches() && "patch".equals(name.getLocalPart()); patchId = getAttributeValue(rdr, "", "id"); } else { - QName name = rdr.getName(); - if (PATCH_NAMESPACE_URI.equals(name.getNamespaceURI())) { + if (NAMESPACE_PATTERN.matcher(name.getNamespaceURI()).matches()) { if ("upgrade".equals(name.getLocalPart())) { patchType = Patch.Type.CUMULATIVE; identityName = getAttributeValue(rdr, "", "name"); diff --git a/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchProductType.java b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchProductType.java new file mode 100644 index 00000000000..176f5151230 --- /dev/null +++ b/modules/common/wfly-patch-parser/src/main/java/org/rhq/common/wildfly/PatchProductType.java @@ -0,0 +1,66 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2016 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, Inc, + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +package org.rhq.common.wildfly; + +/** + * Simplified and combined version of JBossProductType as defined in the jboss-as-7 and wfly-10 agent plugins + * + * @author Michael Burman + */ +public enum PatchProductType { + + EAP("EAP", "JBoss EAP 6", "JBoss Enterprise Application Platform 6", "EAP"), + EAP7("EAP", "EAP 7", "JBoss Enterprise Application Platform 7", "JBoss 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"), + SOA("SOA-P", "JBoss SOA-P 6", "Red Hat JBoss Fuse Service Works", "Red Hat JBoss Fuse Service Works"), + BRMS("BRMS", "JBoss BRMS", "Red Hat JBoss BRMS", "BRMS"), + BPMS("BPM Suite", "JBoss BPM Suite", "Red Hat JBoss BPM Suite", "BPM Suite"), + JDV("JDV", "Data Virt", "Red Hat JBoss Data Virtualization", "Red Hat JBoss Data Virtualization"), + WILDFLY10("WildFly", "WildFly 10", "WildFly Application Server 10", "WildFly Full"); + + public final String SHORT_NAME; + public final String NAME; + public final String FULL_NAME; + /** The value the server returns for the "product-name" attribute of the root resource. */ + public final String PRODUCT_NAME; + + PatchProductType(String shortName, String name, String fullName, String productName) { + this.SHORT_NAME = shortName; + this.NAME = name; + this.FULL_NAME = fullName; + this.PRODUCT_NAME = productName; + } + + public static PatchProductType getValueByProductName(String productName) { + for (PatchProductType productType : PatchProductType.values()) { + if (productType.PRODUCT_NAME.equals(productName)) { + return productType; + } + } + return null; + } + + @Override + public String toString() { + return this.NAME; + } + +} diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 7c9560490d2..625e9ee494d 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -72,6 +72,7 @@ validate-all-serverplugins packagetype-cli wfly-patch-bundle + wfly-10-patch-bundle diff --git a/modules/enterprise/server/plugins/wfly-10-patch-bundle/pom.xml b/modules/enterprise/server/plugins/wfly-10-patch-bundle/pom.xml new file mode 100644 index 00000000000..7c8d16f15c3 --- /dev/null +++ b/modules/enterprise/server/plugins/wfly-10-patch-bundle/pom.xml @@ -0,0 +1,137 @@ + + + 4.0.0 + + + org.rhq + rhq-enterprise-server-plugins-parent + 4.14.0-SNAPSHOT + + + rhq-serverplugin-wfly-10-patch-bundle + jar + + RHQ Wildfly 10 Patch Bundle Server Plugin + Server side plugin that manages Wildfly 10 patch files and exposes them as RHQ bundles + + + + org.rhq + rhq-wfly-patch-parser + ${project.version} + + + + + + + + maven-surefire-plugin + + ${rhq.testng.excludedGroups} + + + + + maven-dependency-plugin + + + copy-rhq-plugins + process-resources + + copy + + + + + + org.rhq + rhq-wfly-patch-parser + ${project.version} + + + ${project.build.outputDirectory}/lib + + + + + + + + + + + dev + + + ../../../../.. + ${rhq.rootDir}/${rhq.devContainerServerPath} + ${rhq.containerDir}/${rhq.serverPluginDir} + + + + + + + maven-antrun-plugin + + + + deploy + compile + + + + + *** Updating ${deployment.file}... + + + + + run + + + + + undeploy + clean + + + + *** Deleting ${deployment.file}... + + + + + run + + + + + deploy-jar-meta-inf + package + + + + *** Updating META-INF dir in ${deployment.file}... + + + + + + + + + + + run + + + + + + + + + + diff --git a/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wfly10patch/Wildfly10PatchBundleServerPluginComponent.java b/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wfly10patch/Wildfly10PatchBundleServerPluginComponent.java new file mode 100644 index 00000000000..84a28b632ac --- /dev/null +++ b/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wfly10patch/Wildfly10PatchBundleServerPluginComponent.java @@ -0,0 +1,206 @@ +/* + * RHQ Management Platform + * Copyright (C) 2014-2016 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +package org.rhq.enterprise.server.plugins.wfly10patch; + +import java.io.File; +import java.io.FileInputStream; +import java.util.HashMap; +import java.util.Map; + +import org.rhq.common.wildfly.PatchProductType; +import org.rhq.common.wildfly.Patch; +import org.rhq.common.wildfly.PatchBundle; +import org.rhq.common.wildfly.PatchInfo; +import org.rhq.common.wildfly.PatchParser; +import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; +import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; +import org.rhq.core.domain.configuration.definition.PropertySimpleType; +import org.rhq.core.util.updater.DeploymentProperties; +import org.rhq.core.util.updater.DestinationComplianceMode; +import org.rhq.enterprise.server.bundle.BundleDistributionInfo; +import org.rhq.enterprise.server.bundle.RecipeParseResults; +import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent; +import org.rhq.enterprise.server.plugin.pc.ServerPluginContext; +import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginFacet; +import org.rhq.enterprise.server.plugin.pc.bundle.UnknownRecipeException; + +/** + * @author Lukas Krejci + * @author Michael Burman + * @since 4.13 + */ +public class Wildfly10PatchBundleServerPluginComponent implements ServerPluginComponent, BundleServerPluginFacet { + + @Override + public RecipeParseResults parseRecipe(String recipe) throws UnknownRecipeException { + throw new UnknownRecipeException( + "The Wildfly 10 patches cannot be dealt with using only recipes - the whole distribution file is needed."); + } + + @Override + public BundleDistributionInfo processBundleDistributionFile(File distributionFile) + throws Exception { + + if (null == distributionFile) { + throw new IllegalArgumentException("distributionFile == null"); + } + + String fileName = null; + String recipe = null; + RecipeParseResults parseResults = null; + + FileInputStream in = new FileInputStream(distributionFile); + try { + PatchInfo patchInfo = PatchParser.parse(in, true); + + if (patchInfo == null) { + throw new UnknownRecipeException(); + } + + if (patchInfo.is(Patch.class)) { + Patch patch = patchInfo.as(Patch.class); + + if(!PatchProductType.EAP7.equals(patch.getProductType())) { + throw new UnknownRecipeException(); + } + + String version = patch.getType() == Patch.Type.ONE_OFF ? patch.getTargetVersion() + "+" + patch.getId() + : patch.getTargetVersion(); + + DeploymentProperties props = new DeploymentProperties(0, patch.getIdentityName(), + version, patch.getDescription(), DestinationComplianceMode.full); + + ConfigurationDefinition config = new ConfigurationDefinition("wildfly-patch", null); + PropertyDefinitionSimple patchIdProp = new PropertyDefinitionSimple("patchId", "The ID of the patch", + true, + PropertySimpleType.STRING); + patchIdProp.setDefaultValue(patch.getId()); + patchIdProp.setReadOnly(true); + PropertyDefinitionSimple patchTypeProp = new PropertyDefinitionSimple("patchType", + "The type of the patch", + true, PropertySimpleType.STRING); + patchTypeProp.setDefaultValue(patch.getType().toString()); + patchTypeProp.setReadOnly(true); + + config.put(patchIdProp); + config.put(patchTypeProp); + addCommonProperties(config); + + parseResults = new RecipeParseResults(props, config, null); + fileName = patch.getId(); + recipe = patch.getContents(); + } else if (patchInfo.is(PatchBundle.class)) { + PatchBundle patchBundle = patchInfo.as(PatchBundle.class); + + Patch lastPatch = null; + StringBuilder allPatchIds = new StringBuilder(); + + for (PatchBundle.Element p : patchBundle) { + lastPatch = p.getPatch(); + allPatchIds.append(p.getPatch().getId()).append("#"); + } + allPatchIds.replace(allPatchIds.length() - 1, allPatchIds.length(), ""); + + if (lastPatch == null) { + throw new UnknownRecipeException("Not a Wildfly patch"); + } else if (!PatchProductType.EAP7.equals(lastPatch.getProductType())) { + throw new UnknownRecipeException(); + } + + DeploymentProperties props = new DeploymentProperties(0, lastPatch.getIdentityName(), + lastPatch.getTargetVersion(), lastPatch.getDescription(), DestinationComplianceMode.full); + + ConfigurationDefinition config = new ConfigurationDefinition("wildfly-patch", null); + PropertyDefinitionSimple allPatchIdsProp = new PropertyDefinitionSimple("allPatchIds", + "Hash-separated list of all individual patches the patch bundle is composed of.", true, + PropertySimpleType.STRING); + allPatchIdsProp.setDefaultValue(allPatchIds.toString()); + allPatchIdsProp.setReadOnly(true); + PropertyDefinitionSimple patchTypeProp = new PropertyDefinitionSimple("patchType", + "The type of the patch", true, PropertySimpleType.STRING); + patchTypeProp.setDefaultValue("patch-bundle"); + patchTypeProp.setReadOnly(true); + + config.put(allPatchIdsProp); + config.put(patchTypeProp); + addCommonProperties(config); + + parseResults = new RecipeParseResults(props, config, null); + fileName = allPatchIds.toString(); + recipe = patchBundle.getContents(); + } + } finally { + in.close(); + } + + fileName += ".zip"; + + Map patchFiles = new HashMap(); + patchFiles.put(fileName, distributionFile); + + return new BundleDistributionInfo(recipe, parseResults, patchFiles); + } + + void addCommonProperties(ConfigurationDefinition config) { + PropertyDefinitionSimple overrideProp = new PropertyDefinitionSimple("override", + "The value is a comma-separated list of the miscellaneous items in the patch that can be overridden on the server whether the item reports a conflict or not.", + false, PropertySimpleType.LONG_STRING); + PropertyDefinitionSimple overrideAllProp = new PropertyDefinitionSimple("override-all", + "The argument does not expect any value and is optional. The default is 'false'. It signifies to bypass any content verification on the miscellaneous items changed by the patch.", + false, PropertySimpleType.BOOLEAN); + PropertyDefinitionSimple overrideModules = new PropertyDefinitionSimple("override-modules", + "The argument does not expect any value and is optional. The default is 'false'. It signifies to bypass any content verification on the modules and OSGi bundles affected by the patch.", + false, PropertySimpleType.LONG_STRING); + PropertyDefinitionSimple preserve = new PropertyDefinitionSimple("preserve", + "The value is a comma-separated list of the miscellaneous items that must be preserved and not modified by applying or rolling back a patch.", + false, PropertySimpleType.LONG_STRING); + PropertyDefinitionSimple restart = new PropertyDefinitionSimple("restart", + "This only applies if the server being deployed to is running. When true, the server is stopped before the patch application and started back up afterwards.", + true, PropertySimpleType.BOOLEAN); + restart.setDefaultValue(Boolean.toString(true)); + PropertyDefinitionSimple takeOver = new PropertyDefinitionSimple("takeOver", + "Set this to true ONLY in cases where you want this destination to become the new originating destination for the patch deployments to the servers in the resource group. Each server can have at most 1 originating destination for its patch deployments at a time. As an example, you might want to use this in cases where a destination that was used for prior patch deployments was deleted, yet the target servers weren't purged and thus still relate to the deleted destination as their originating destination.", + true, PropertySimpleType.BOOLEAN); + takeOver.setDefaultValue(Boolean.toString(false)); + + config.put(overrideProp); + config.put(overrideAllProp); + config.put(overrideModules); + config.put(preserve); + config.put(restart); + config.put(takeOver); + } + + @Override + public void initialize(ServerPluginContext context) throws Exception { + } + + @Override + public void start() { + } + + @Override + public void stop() { + } + + @Override + public void shutdown() { + } +} diff --git a/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/resources/META-INF/rhq-serverplugin.xml new file mode 100644 index 00000000000..46bd801965b --- /dev/null +++ b/modules/enterprise/server/plugins/wfly-10-patch-bundle/src/main/resources/META-INF/rhq-serverplugin.xml @@ -0,0 +1,33 @@ + + + + + + + + + + diff --git a/modules/enterprise/server/plugins/wfly-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wflypatch/WildflyPatchBundleServerPluginComponent.java b/modules/enterprise/server/plugins/wfly-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wflypatch/WildflyPatchBundleServerPluginComponent.java index 933acebfcf8..225e8e261a9 100644 --- a/modules/enterprise/server/plugins/wfly-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wflypatch/WildflyPatchBundleServerPluginComponent.java +++ b/modules/enterprise/server/plugins/wfly-patch-bundle/src/main/java/org/rhq/enterprise/server/plugins/wflypatch/WildflyPatchBundleServerPluginComponent.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2014 Red Hat, Inc. + * Copyright (C) 2014-2016 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -28,6 +28,7 @@ import org.rhq.common.wildfly.PatchBundle; import org.rhq.common.wildfly.PatchInfo; import org.rhq.common.wildfly.PatchParser; +import org.rhq.common.wildfly.PatchProductType; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; import org.rhq.core.domain.configuration.definition.PropertySimpleType; @@ -75,6 +76,10 @@ public BundleDistributionInfo processBundleDistributionFile(File distributionFil if (patchInfo.is(Patch.class)) { Patch patch = patchInfo.as(Patch.class); + if(PatchProductType.EAP7.equals(patch.getProductType())) { + throw new UnknownRecipeException(); + } + String version = patch.getType() == Patch.Type.ONE_OFF ? patch.getTargetVersion() + "+" + patch.getId() : patch.getTargetVersion(); @@ -114,6 +119,8 @@ public BundleDistributionInfo processBundleDistributionFile(File distributionFil if (lastPatch == null) { throw new UnknownRecipeException("Not a Wildfly patch"); + } else if (PatchProductType.EAP7.equals(lastPatch.getProductType())) { + throw new UnknownRecipeException(); } DeploymentProperties props = new DeploymentProperties(0, lastPatch.getIdentityName(), diff --git a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseProcessDiscovery.java b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseProcessDiscovery.java index 8e1583b2d4b..3b9339a7763 100644 --- a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseProcessDiscovery.java +++ b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseProcessDiscovery.java @@ -225,8 +225,6 @@ protected DiscoveredResourceDetails buildResourceDetails(ResourceDiscoveryContex String description = buildDefaultResourceDescription(hostPort, productType); String version = getVersion(homeDir, productType); - pluginConfig.setSimpleValue("supportsPatching", Boolean.toString(true)); - return new DiscoveredResourceDetails(discoveryContext.getResourceType(), key, name, version, description, pluginConfig, process); } @@ -482,7 +480,6 @@ public DiscoveredResourceDetails discoverResource(Configuration pluginConfig, Re pluginConfig.put(new PropertySimple("manuallyAdded", true)); pluginConfig.put(new PropertySimple("productType", productType.name())); - pluginConfig.put(new PropertySimple("supportsPatching", true)); // @TODO Remove after cleaning elsewhere pluginConfig.setSimpleValue("expectedRuntimeProductName", productType.PRODUCT_NAME); DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), key, name, version, diff --git a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseServerComponent.java b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseServerComponent.java index 27b72bd89c2..c944f63f7df 100644 --- a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseServerComponent.java +++ b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/BaseServerComponent.java @@ -1004,15 +1004,6 @@ private void collectServerKindTraits(MeasurementReport report, Set sanityCheck(ServerControl serverControl, Configuration referencedConfiguration, BundleManagerProvider bmp, BundleResourceDeployment resourceDeployment, boolean uniqueDeploymentRequired) { - //check if patching is supported - - PropertySimple supportsPatching = referencedConfiguration.getSimple("supportsPatching"); - - if (supportsPatching == null) { - return Result.error("Target resource doesn't contain the 'Supports Patching' property in its connection settings. Using an old version of the JBossAS7 plugin?"); - } - - if (supportsPatching.getBooleanValue() == null || !supportsPatching.getBooleanValue()) { - return Result.error("The target resource does not support patching."); - } - ProcessExecutionResults results = serverControl.cli().disconnected(true).executeCliCommand("help --commands"); switch (handleExecutionResults(results, bmp, resourceDeployment, false)) { case EXECUTION_ERROR: diff --git a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/patching/PatchHandlerDiscoveryComponent.java b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/patching/PatchHandlerDiscoveryComponent.java index 46b513fbef9..696bdd2fd9d 100644 --- a/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/patching/PatchHandlerDiscoveryComponent.java +++ b/modules/plugins/wfly-10/src/main/java/org/rhq/modules/plugins/wildfly10/patching/PatchHandlerDiscoveryComponent.java @@ -37,8 +37,8 @@ public final class PatchHandlerDiscoveryComponent implements ResourceDiscoveryCo public Set discoverResources(ResourceDiscoveryContext> context) { Configuration pluginConfig = context.getDefaultPluginConfiguration(); - DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), "WflyPatchHandler", - "Wildfly/JBoss EAP Patch Handler", null, null, pluginConfig, null); + DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), "Wildfly10PatchHandler", + "Wildfly 10/EAP 7 Patch Handler", null, null, pluginConfig, null); return Collections.singleton(details); } diff --git a/modules/plugins/wfly-10/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/wfly-10/src/main/resources/META-INF/rhq-plugin.xml index 3708187e14f..6cf0e628b75 100644 --- a/modules/plugins/wfly-10/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/wfly-10/src/main/resources/META-INF/rhq-plugin.xml @@ -1120,14 +1120,6 @@ - - - Whether this EAP server supports patching. This should be automatically deduced by the agent. It is highly - recommended to leave this with the discovered value. However, you will need to manually update this value - if you manually upgrade your server from a version that does not support patching to a version that does. - - &startScriptPluginConfigGroup; &logSources; @@ -1504,14 +1496,6 @@ - - - Whether this EAP server supports patching. This should be automatically deduced by the agent. It is highly - recommended to leave this with the discovered value. However, you will need to manually update this value - if you manually upgrade your server from a version that does not support patching to a version that does. - - @@ -16167,7 +16151,7 @@ -