[rhq] .classpath modules/plugins
by Simeon Pinder
.classpath | 8
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsComponent.java | 867 +++++
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsDiscoveryComponent.java | 188 +
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 1503 +++++-----
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/SecurityModuleOptionsTest.java | 319 ++
5 files changed, 2203 insertions(+), 682 deletions(-)
New commits:
commit 2918e9c7df1d792b2b91f2e412ef7d2187cd55d4
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Tue Jun 5 16:55:29 2012 -0400
[BZ 826542] Adding support for security-domain child nodes (authentication=classic,authentication=jaspi,audit=classic,audit=classic,acl=classic,authorization=classic,identity-trust=classic,mapping=classic]. -Explicitly allows the creation of and update of N ModuleOptionType instances and support of N module options for each type instance.
diff --git a/.classpath b/.classpath
index fd400dc..76e080c 100644
--- a/.classpath
+++ b/.classpath
@@ -153,7 +153,7 @@
<classpathentry kind="src" path="modules/helpers/pluginAnnotations/src/main/java"/>
<classpathentry kind="src" path="modules/helpers/pluginGen/src/main/java"/>
<classpathentry kind="src" path="modules/helpers/perftest-support/src/main/java"/>
- <classpathentry kind="src" path="modules/helpers/rtfilter/src/main/java"/>
+ <classpathentry kind="src" path="modules/helpers/rtfilter/src/main/java"/>
<classpathentry kind="src" path="modules/core/plugin-container-itest/src/test/java"/>
<classpathentry kind="src" path="modules/core/plugin-test-util/src/main/java"/>
<classpathentry kind="src" path="modules/core/arquillian-integration/container/src/test/java"/>
@@ -241,7 +241,7 @@
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/jbossws/jbossws-native-core/3.1.1.GA/jbossws-native-core-3.1.1.GA.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/org/codehaus/swizzle/swizzle-confluence/1.6.1/swizzle-confluence-1.6.1.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/codehaus/swizzle/1.6.1/swizzle-confluence-1.6.1.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jvnet/inflector/0.7.0/inflector-0.7.0.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/net/augeas/augeas/0.0.2/augeas-0.0.2.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/json/json/20080701/json-20080701.jar"/>
@@ -308,7 +308,7 @@
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/arquillian/container/arquillian-container-spi/1.0.0.Final/arquillian-container-spi-1.0.0.Final.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/arquillian/container/arquillian-container-test-api/1.0.0.Final/arquillian-container-test-api-1.0.0.Final.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/arquillian/testng/arquillian-testng-core/1.0.0.Final/arquillian-testng-core-1.0.0.Final.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/com/wordnik/swagger-annotations_2.9.1/1.1-SNAPSHOT/swagger-annotations_2.9.1-1.1-20120531.064118-1.jar"/>
- <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/byteman/byteman/1.2.1/byteman-1.2.1.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/com/wordnik/swagger-annotations_2.9.1/1.1-SNAPSHOT/swagger-annotations_2.9.1-1.1-20120531.064118-1.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/byteman/byteman/1.2.1/byteman-1.2.1.jar"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsComponent.java
new file mode 100644
index 0000000..d486542
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsComponent.java
@@ -0,0 +1,867 @@
+package org.rhq.modules.plugins.jbossas7;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.ReadAttribute;
+import org.rhq.modules.plugins.jbossas7.json.ReadChildrenNames;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
+
+/**
+ * Component class for Module Options. Necessary because Module Options are child
+ * attributes of another as7 node attribute and cannot be created/updated without
+ * rewriting the parent attribute as well. The following as7 node snippets shows how the
+ * 'login-modules' attribute contains both simple and complex child attributes. The complex
+ * 'module-options' child attribute values can be numerous and can/may need to be modifiable
+ * independently.
+ * Read:
+ * [standalone@localhost:9999 authentication=classic] :read-attribute(name=login-modules)
+ {
+ "outcome" => "success",
+ "result" => [{
+ "code" => "Ldap",
+ "flag" => "requisite",
+ "module-options" => [("bindDn"=>"uid=ldapUser,ou=People,dc=redat,dc=com")]
+ }]
+ }
+ * Write back:
+ [standalone@localhost:9999 authentication=classic]
+ :write-attribute(name=login-modules,
+ value=[{"code"=>"Ldap","flag"=>"required",
+ "module-options"=>[("bindDn"=>"uid=ldapSecureUser,ou=People,dc=redat,dc=com")]}])
+ {
+ "outcome" => "success",
+ "response-headers" => {
+ "operation-requires-reload" => true,
+ "process-state" => "reload-required"
+ }
+ }
+ *
+ * @author Simeon Pinder
+ */
+public class ModuleOptionsComponent extends BaseComponent implements ConfigurationFacet, DeleteResourceFacet,
+ CreateChildResourceFacet {
+
+ //shared identifier for module-options attribute reused by all nodes with Module Options
+ private static String moduleOptionsNode = ",module-options";
+
+ //Module Option type attribute identifiers
+ private static String loginModules = "login-modules";//Authentication (Classic,-Managed Server,-Profile)
+ private static String aclModules = "acl-modules";//Acl
+ private static String providerModules = "provider-modules";//Audit
+ private static String policyModules = "policy-modules";//Authorization
+ private static String trustModules = "trust-modules";//IdentityTrust
+ private static String mappingModules = "mapping-modules";//Mapping
+ private static String authModules = "auth-modules";//Authentication (Jaspi,-Managed Server,-Profile)
+
+ //Enumerates list of AS7 types that support module options.
+ public enum ModuleOptionType {
+ Acl(aclModules), Audit(providerModules), Authentication(loginModules), AuthenticationJaspi(authModules), Authorization(
+ policyModules), IdentityTrust(
+ trustModules), Mapping(mappingModules);
+ private String attribute = "";
+
+ //stores mapping of as7 attribute name to module option type mapping Ex. login-modules -> Authentication Module Option Type.
+ public static HashMap<String, ModuleOptionType> typeMap = new HashMap<String, ModuleOptionType>();
+ static {//populate all module option type mappings
+ for (ModuleOptionType type : ModuleOptionType.values()) {
+ typeMap.put(type.getAttribute(), type);
+ }
+ }
+ //Stores mapping of as7 attribute name to more user friendly Module option type
+ public static Map<String, String> readableNameMap = new HashMap<String, String>();
+ static {
+ readableNameMap.put(aclModules, "ACL Modules");
+ readableNameMap.put(providerModules, "Provider Modules");
+ readableNameMap.put(loginModules, "Login Modules");//Authentication=classic
+ readableNameMap.put(authModules, "Auth Modules");//Authentication=jaspi
+ readableNameMap.put(policyModules, "Policy Modules");
+ readableNameMap.put(trustModules, "Trust Modules");
+ readableNameMap.put(mappingModules, "Mapping Modules");
+ }
+
+ public String getAttribute() {
+ return attribute;
+ }
+
+ private ModuleOptionType(String attribute) {
+ this.attribute = attribute;
+ }
+ }
+
+ //Strings unique to nodes
+ private static String AUTH_CLASSIC_NODE = "Authentication (Classic";
+ private static String AUTH_JASPI_NODE = "Authentication (Jaspi";
+ private static String ACL_NODE = "ACL";
+ private static String AUDIT_NODE = "Audit";
+ private static String AUTHORIZATION_NODE = "Authorization";
+ private static String TRUST_NODE = "Identity Trust";
+ private static String MAPPING_NODE = "Mapping";
+ private static String[] supportedModuleOptionTypeNodes = { AUTH_CLASSIC_NODE, AUTH_JASPI_NODE, ACL_NODE,
+ AUDIT_NODE, AUTHORIZATION_NODE, TRUST_NODE, MAPPING_NODE };
+
+ //define operation/type mappings where specific plugin descriptor nodes map to specific
+ // as7 node names.
+ public static HashMap<String, String> attributeMap = new HashMap<String, String>();
+ static {
+ attributeMap.put(AUTH_CLASSIC_NODE + ")", loginModules);
+ attributeMap.put(AUTH_CLASSIC_NODE + " - Managed Server)", loginModules);
+ attributeMap.put(AUTH_CLASSIC_NODE + " - Profile)", loginModules);
+ attributeMap.put(AUTH_JASPI_NODE + ")", authModules);
+ attributeMap.put(AUTH_JASPI_NODE + " - Managed Server)", authModules);
+ attributeMap.put(AUTH_JASPI_NODE + " - Profile)", authModules);
+ attributeMap.put(ACL_NODE, aclModules);
+ attributeMap.put(ACL_NODE + " (Managed Server)", aclModules);
+ attributeMap.put(ACL_NODE + " (Profile)", aclModules);
+ attributeMap.put(AUDIT_NODE, providerModules);
+ attributeMap.put(AUDIT_NODE + " (Managed Server)", providerModules);
+ attributeMap.put(AUDIT_NODE + " (Profile)", providerModules);
+ attributeMap.put(AUTHORIZATION_NODE, policyModules);
+ attributeMap.put(AUTHORIZATION_NODE + " (Managed Server)", policyModules);
+ attributeMap.put(AUTHORIZATION_NODE + " (Profile)", policyModules);
+ attributeMap.put(TRUST_NODE, trustModules);
+ attributeMap.put(TRUST_NODE + " (Managed Server)", trustModules);
+ attributeMap.put(TRUST_NODE + " (Profile)", trustModules);
+ attributeMap.put(MAPPING_NODE, mappingModules);
+ attributeMap.put(MAPPING_NODE + " (Managed Server)", mappingModules);
+ attributeMap.put(MAPPING_NODE + " (Profile)", mappingModules);
+ }
+
+ public static HashMap<String, String> newChildTypeMap = new HashMap<String, String>();
+ static {
+ newChildTypeMap.put(loginModules, "authentication=classic");
+ newChildTypeMap.put(authModules, "authentication=jaspi");
+ newChildTypeMap.put(aclModules, "acl=classic");
+ newChildTypeMap.put(providerModules, "audit=classic");
+ newChildTypeMap.put(policyModules, "authorization=classic");
+ newChildTypeMap.put(trustModules, "identity-trust=classic");
+ newChildTypeMap.put(mappingModules, "mapping=classic");
+ }
+
+ @Override
+ public CreateResourceReport createResource(CreateResourceReport report) {
+
+ if (report.getPackageDetails() != null) { // Content deployment
+ return deployContent(report);
+ } else {
+ ASConnection connection = getASConnection();
+
+ // Check for the Highlander principle
+ boolean isSingleton = report.getResourceType().isSingleton();
+ if (isSingleton) {
+ // check if there is already a child with the desired type is present
+ Configuration pluginConfig = report.getPluginConfiguration();
+ PropertySimple pathProperty = pluginConfig.getSimple("path");
+ if (path == null || path.isEmpty()) {
+ report.setErrorMessage("No path property found in plugin configuration");
+ report.setStatus(CreateResourceStatus.INVALID_CONFIGURATION);
+ return report;
+ }
+
+ ReadChildrenNames op = new ReadChildrenNames(address, pathProperty.getStringValue());
+ Result res = connection.execute(op);
+ if (res.isSuccess()) {
+ List<String> entries = (List<String>) res.getResult();
+ if (!entries.isEmpty()) {
+ report.setErrorMessage("Resource is a singleton, but there are already children " + entries
+ + " please remove them and retry");
+ report.setStatus(CreateResourceStatus.FAILURE);
+ return report;
+ }
+ }
+ }
+
+ //determine type then attribute
+ ResourceType resourceType = report.getResourceType();
+ String attribute = attributeMap.get(resourceType.getName());
+ //determine new child name from attribute
+ String newChild = newChildTypeMap.get(attribute);
+
+ //get resourceConfig
+ Configuration configuration = report.getResourceConfiguration();
+
+ if(attribute!=null){//create executed from SecurityDomain level
+
+ //retrieve the values passed in via config
+ Value loaded = loadCodeFlagType(configuration, attribute, null);
+
+ //populate the ModuleOptionType from the Configuration
+ List<Value> newAttributeState = new ArrayList<Value>();
+ newAttributeState.add(loaded);
+
+ //build the operation
+ //update the address to point to the new child being created
+ Address newChildLocation = new Address(path + "," + newChild);
+ Operation op = createAddModuleOptionTypeOperation(newChildLocation, attribute, newAttributeState);
+
+ Result result = connection.execute(op);
+ if (result.isSuccess()) {
+ report.setStatus(CreateResourceStatus.SUCCESS);
+ report.setResourceKey(newChildLocation.getPath());
+ report.setResourceName(report.getResourceType().getName());
+ } else {
+ report.setStatus(CreateResourceStatus.FAILURE);
+ report.setErrorMessage(result.getFailureDescription());
+ }
+ }else{//Create executed from the 'Login Modules/Provider Modules/etc. level.
+ //retrieve the parent type to lookup attribute to write to
+ ResourceType parentType = (ResourceType) resourceType.getParentResourceTypes().toArray()[0];
+ attribute = attributeMap.get(parentType.getName());
+
+ //retrieve existing attribute definition
+ //get the current attribute value
+ ReadAttribute op = new ReadAttribute(address, attribute);
+ Result result = getASConnection().execute(op);
+ if (result.isSuccess()) {
+ //populate attribute values
+ List<Value> currentAttributeState = new ArrayList<Value>();
+ currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ //populate new Module type data
+ //retrieve the values passed in via config
+ Value loaded = loadCodeFlagType(configuration, attribute, null);
+
+ //append new type information
+ currentAttributeState.add(loaded);
+ //write values back out.
+ Operation write = new WriteAttribute(address);
+ write.addAdditionalProperty("name", attribute);//attribute to execute on
+
+ //now complete the write operation by updating the value
+ write.addAdditionalProperty("value", (Object) currentAttributeState);
+ result = connection.execute(write);
+ if (result.isSuccess()) {
+ report.setStatus(CreateResourceStatus.SUCCESS);
+ //Ex. subsystem=security,security-domain=createOne,authentication=classic,login-modules:0
+ report.setResourceKey(path + "," + attribute + ":" + (currentAttributeState.size() - 1));
+ //Ex. Login Modules 0
+ report.setResourceName(ModuleOptionType.readableNameMap.get(attribute) + " "
+ + (currentAttributeState.size() - 1));
+ } else {
+ report.setStatus(CreateResourceStatus.FAILURE);
+ report.setErrorMessage(result.getFailureDescription());
+ }
+ }
+ }
+ return report;
+ }
+ }
+
+ @Override
+ public Configuration loadResourceConfiguration() throws Exception {
+ Configuration configuration = new Configuration();
+
+ //determine the component
+ ResourceType resourceType = context.getResourceType();
+ Set<ResourceType> nodeParentTypes = context.getResourceType().getParentResourceTypes();
+ ResourceType parentType = (ResourceType) nodeParentTypes.toArray()[0];
+ ResourceType grandParentType = (ResourceType) parentType.getParentResourceTypes().toArray()[0];
+
+ //For each Module Option type, like Authentication (Classic) and the immediate
+ // child node of each, the configuration is shared as it is in the AS7 node as well.
+ if (isSupportedModuleOptionTypeOrImmediateChildOf(parentType, resourceType)) {//Classic, Managed, Profile
+ boolean currentNodeIsModuleType = false;
+ //if the current resourceType is included in the attributeMap then it is an actual Module Option Type.
+ if (ModuleOptionsComponent.attributeMap.get(resourceType.getName()) != null) {
+ currentNodeIsModuleType = true;
+ }
+ //get type and lookup supported node and type
+ //retrieve the parent resource
+ String attribute = ModuleOptionsComponent.attributeMap.get(parentType.getName());
+ if (currentNodeIsModuleType) {//if is an actual Module Option Type then update attribute retrieved.
+ attribute = ModuleOptionsComponent.attributeMap.get(resourceType.getName());
+ }
+
+ //get the current attribute value
+ ReadAttribute op = new ReadAttribute(address, attribute);
+ Result result = getASConnection().execute(op);
+ if (result.isSuccess()) {
+ //populate attribute values
+ List<Value> currentAttributeState = new ArrayList<Value>();
+ currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ if (currentNodeIsModuleType) {//grab first available module type
+ Value loaded = currentAttributeState.get(0);
+ //populate configuration
+ populateCodeFlagType(configuration, attribute, loaded);
+ } else {//Need to locate specific module type
+ //locate specific node and populate the config
+ //Ex."login-modules:";
+ String moduleTypeIdentifier = attribute + ":";
+ int index = path.indexOf(moduleTypeIdentifier);
+ String loginModuleIndex = path.substring(index + moduleTypeIdentifier.length());
+ int lmi = Integer.valueOf(loginModuleIndex);//Ex 0,1,30
+ if (currentAttributeState.size() > lmi) {//then retrieve.
+ Value loaded = currentAttributeState.get(lmi);
+ //populate configuration
+ populateCodeFlagType(configuration, attribute, loaded);
+ }
+ }
+ }
+ //read attribute
+ return configuration;
+ }
+ //Module Options child, Ex. 'Login Modules (Classic', ..-Managed, .. - Profile
+ else if (supportsLoginModuleOptionType(grandParentType)) {
+ //get type and lookup supported node and type
+ String attribute = ModuleOptionsComponent.attributeMap.get(grandParentType.getName());
+
+ //get the current attribute value
+ ReadAttribute op = new ReadAttribute(address, attribute);
+ Result result = getASConnection().execute(op);
+ if (result.isSuccess()) {
+ //populate attribute values
+ List<Value> currentAttributeState = new ArrayList<Value>();
+ currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+
+ //locate specific node and populate the config
+ //Ex."login-modules:";
+ String moduleTypeIdentifier = attribute + ":";
+ int index = path.indexOf(moduleTypeIdentifier);
+ String loginModuleIndex = path.substring(index + moduleTypeIdentifier.length());
+ String[] split = loginModuleIndex.split(",");
+ int lmi = Integer.valueOf(split[0]);//Ex 0,1,30
+ if (lmi < currentAttributeState.size()) {//then proceed
+ Value loaded = currentAttributeState.get(lmi);
+ //populate configuration: module-options
+ LinkedHashMap<String, Object> currentModuleOptions = loaded.getOptions();
+
+ //This must match exactly the mapping identifier from descriptor, otherwise loadResource fails silently.
+ String id = "Module Options";
+ PropertyMap map = new PropertyMap(id);
+ for (String key : currentModuleOptions.keySet()) {
+ PropertySimple option = new PropertySimple(key, currentModuleOptions.get(key));
+ map.put(option);
+ }
+ if (!currentModuleOptions.isEmpty()) {//check that keyset is non empty before adding to config.
+ configuration.put(map);
+ }
+ }
+ }
+ return configuration;
+ } else {//otherwise default subsystem discovery behavior.
+ ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition();
+ ConfigurationLoadDelegate delegate = new ConfigurationLoadDelegate(configDef, getASConnection(), address,
+ includeRuntime);
+ configuration = delegate.loadResourceConfiguration();
+
+ // Read server state
+ ReadAttribute op = new ReadAttribute(getAddress(), "name");
+ executeAndGenerateServerUpdateIfNecessary(configuration, op);
+ return configuration;
+ }
+ }
+
+ /** Looks up whether the current node supports the Module Options.
+ *
+ * @param grandParentType
+ * @return
+ */
+ private boolean supportsLoginModuleOptionType(ResourceType grandParentType) {
+ boolean supportModuleOptionTypes = false;
+ if (grandParentType != null) {
+ for (String moduleOptionType : supportedModuleOptionTypeNodes) {
+ if (grandParentType.getName().indexOf(moduleOptionType) > -1) {
+ supportModuleOptionTypes = true;
+ }
+ }
+ }
+ return supportModuleOptionTypes;
+ }
+
+ /**Iterates through the list of supported Module Option Type nodes
+ * to determine if the current node is i)supported Module option node or
+ * ii)the immediated child of a supported Module option node.
+ *
+ * @param parentType
+ * @param resourceType
+ * @return
+ */
+ private boolean isSupportedModuleOptionTypeOrImmediateChildOf(ResourceType parentType, ResourceType resourceType) {
+ boolean loadThisConfiguration = false;
+ if ((parentType != null) && (resourceType != null)) {
+ for (String moduleOptionType : attributeMap.keySet()) {
+ if ((parentType.getName().equals(moduleOptionType))
+ || (resourceType.getName().equals(moduleOptionType))) {
+ loadThisConfiguration = true;
+ }
+ }
+
+ }
+ return loadThisConfiguration;
+ }
+
+ /** Handles the different types of configuration population based on the attribute value passed in.
+ *
+ * @param configuration
+ * @param attribute
+ * @param loaded
+ */
+ private void populateCodeFlagType(Configuration configuration, String attribute, Value loaded) {
+ if (attribute.equals(providerModules)) {//audit=classic. Ex. only code
+ PropertySimple currentValue = new PropertySimple("code", loaded.getCode());
+ configuration.put(currentValue);
+ } else if (attribute.equals(mappingModules)) {//mapping=classic. Ex. code type
+ PropertySimple currentValue = new PropertySimple("code", loaded.getCode());
+ PropertySimple currentValue2 = new PropertySimple("type", loaded.getType());
+ configuration.put(currentValue);
+ configuration.put(currentValue2);
+ } else {//code flag
+ PropertySimple currentValue = new PropertySimple("code", loaded.getCode());
+ PropertySimple currentValue2 = new PropertySimple("flag", loaded.getFlag());
+ configuration.put(currentValue);
+ configuration.put(currentValue2);
+ }
+ }
+
+ /** Populates the Value instance passed in or returns new Value instance with values loaded.
+ *
+ * @param configuration
+ * @param attribute
+ * @param loaded
+ * @return
+ */
+ private Value loadCodeFlagType(Configuration configuration, String attribute, Value loaded) {
+ //if required data is not present then return null.
+ if ((configuration == null) || attribute == null) {
+ return null;
+ }
+ if (loaded == null) {// initialize if null
+ loaded = new Value();
+ }
+ if (attribute.equals(providerModules)) {//audit=classic. Ex. only code
+ String code = configuration.getSimpleValue("code");
+ loaded.setCode(code);
+ } else if (attribute.equals(mappingModules)) {//mapping=classic. Ex. code type
+ String code = configuration.getSimpleValue("code");
+ String type = configuration.getSimpleValue("type");
+ loaded.setCode(code);
+ loaded.setType(type);
+ } else {//code flag
+ String code = configuration.getSimpleValue("code");
+ String flag = configuration.getSimpleValue("flag");
+ loaded.setCode(code);
+ loaded.setFlag(flag);
+ }
+ return loaded;
+ }
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ //determine the component
+ ResourceType resourceType = context.getResourceType();
+ ConfigurationDefinition configDef = resourceType.getPluginConfigurationDefinition();
+ Set<ResourceType> nodeParentTypes = context.getResourceType().getParentResourceTypes();
+ ResourceType parentType = (ResourceType) nodeParentTypes.toArray()[0];
+ ResourceType grandParentType = (ResourceType) parentType.getParentResourceTypes().toArray()[0];
+ ///if child of SecurityDomain then
+ if (isSupportedModuleOptionTypeOrImmediateChildOf(parentType, resourceType)) {
+ boolean currentNodeIsModuleType = false;
+ if (ModuleOptionsComponent.attributeMap.get(resourceType.getName()) != null) {
+ currentNodeIsModuleType = true;
+ }
+ //get type and lookup supported node and type
+ //retreive the parent resource
+ String attribute = ModuleOptionsComponent.attributeMap.get(parentType.getName());
+ if (currentNodeIsModuleType) {
+ attribute = ModuleOptionsComponent.attributeMap.get(resourceType.getName());
+ }
+
+ //get the current attribute value. Will write module types back out exactly as read in with these new updates
+ ReadAttribute op = new ReadAttribute(address, attribute);
+ Result result = getASConnection().execute(op);
+ if (result.isSuccess()) {
+ List<String> entries = (List<String>) result.getResult();
+
+ //populate attribute values
+ List<Value> currentAttributeState = new ArrayList<Value>();
+ currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+
+ //retrieve current config changes
+ Configuration conf = report.getConfiguration();
+
+ if (currentNodeIsModuleType) {//grab first available module type
+ Value loaded = currentAttributeState.get(0);
+ //iterate over properties and update values appropriately
+ for (String pKey : conf.getSimpleProperties().keySet()) {
+ if (pKey.equals("flag")) {
+ loaded.setFlag(conf.getSimpleProperties().get(pKey).getStringValue());
+ } else if (pKey.equals("code")) {
+ loaded.setCode(conf.getSimpleProperties().get(pKey).getStringValue());
+ } else if (pKey.equals("type")) {
+ loaded.setType(conf.getSimpleProperties().get(pKey).getStringValue());
+ }
+ }
+ Operation write = new WriteAttribute(address);
+ write.addAdditionalProperty("name", attribute);//attribute to execute on
+
+ //now complete the write operation by updating the value
+ write.addAdditionalProperty("value", (Object) currentAttributeState);
+ executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
+ } else {//Need to locate specific module type
+
+ //locate specific node and populate the config
+ String loginModuleIdentifier = attribute + ":";
+ int index = path.indexOf(loginModuleIdentifier);
+ String loginModuleIndex = path.substring(index + loginModuleIdentifier.length());
+ int lmi = Integer.valueOf(loginModuleIndex);//Ex 0,1,30
+ Value valueObject = currentAttributeState.get(lmi);
+
+ //iterate over properties and update values appropriately
+ for (String pKey : conf.getSimpleProperties().keySet()) {
+ if (pKey.equals("flag")) {
+ valueObject.setFlag(conf.getSimpleProperties().get(pKey).getStringValue());
+ } else if (pKey.equals("code")) {
+ valueObject.setCode(conf.getSimpleProperties().get(pKey).getStringValue());
+ } else if (pKey.equals("type")) {
+ valueObject.setType(conf.getSimpleProperties().get(pKey).getStringValue());
+ }
+ }
+ Operation write = new WriteAttribute(address);
+ write.addAdditionalProperty("name", attribute);//attribute to execute on
+
+ //now complete the write operation by updating the value
+ write.addAdditionalProperty("value", (Object) currentAttributeState);
+ executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
+ }
+ }
+ } else if (supportsLoginModuleOptionType(grandParentType)) {//Module Options child.
+ //get type and lookup supported node and type
+ String attribute = ModuleOptionsComponent.attributeMap.get(grandParentType.getName());
+
+ //get the current attribute value. Will write module types back out exactly as read in with these new updates
+ ReadAttribute op = new ReadAttribute(address, attribute);
+ Result result = getASConnection().execute(op);
+ if (result.isSuccess()) {
+
+ //populate attribute values
+ List<Value> currentAttributeState = new ArrayList<Value>();
+ currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+
+ //locate specific node and populate the config
+ String loginModuleIdentifier = attribute + ":";
+ int index = path.indexOf(loginModuleIdentifier);
+ String loginModuleIndex = path.substring(index + loginModuleIdentifier.length());
+ String[] split = loginModuleIndex.split(",");
+ int lmi = Integer.valueOf(split[0]);//Ex 0,1,30
+ Value valueObject = currentAttributeState.get(lmi);
+
+ //retrieve current config changes
+ Configuration conf = report.getConfiguration();
+ //list current conf stated being defined.
+ String mapKey = (String) conf.getMap().keySet().toArray()[0];
+ PropertyMap mapType = (PropertyMap) conf.getMap().get(mapKey);
+ //insert update logic.
+ //set this new state passed in as state of the attribute.
+ LinkedHashMap<String, Object> currentOptions = new LinkedHashMap<String, Object>();
+ for (String propertyKey : mapType.getMap().keySet()) {
+ currentOptions.put(propertyKey, ((PropertySimple) mapType.get(propertyKey)).getStringValue());
+ }
+
+ //make these settings the new state for this part of the attribute.
+ valueObject.setOptions(currentOptions);
+ currentAttributeState.set(lmi, valueObject);
+
+ Operation write = new WriteAttribute(address);
+ write.addAdditionalProperty("name", attribute);//attribute to execute on
+
+ //now complete the write operation by updating the value
+ write.addAdditionalProperty("value", (Object) currentAttributeState);
+ executeWriteAndGenerateAs7ServerUpdate(report, conf, write);
+ }
+ } else {
+ ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address);
+ delegate.updateResourceConfiguration(report);
+ }
+
+ }
+
+ /**Executes boilerplate finish for write operation.
+ *
+ * @param report
+ * @param conf
+ * @param write
+ */
+ private void executeWriteAndGenerateAs7ServerUpdate(ConfigurationUpdateReport report, Configuration conf,
+ Operation write) {
+ Result result;
+ result = getASConnection().execute(write);
+ if (!result.isSuccess()) {
+ report.setStatus(ConfigurationUpdateStatus.FAILURE);
+ report.setErrorMessage(result.getFailureDescription());
+ } else {
+ report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ // signal "need reload"
+ if (result.isReloadRequired()) {
+ PropertySimple oobMessage = new PropertySimple("__OOB",
+ "The server needs a reload for the latest changes to come effective.");
+ conf.put(oobMessage);
+ }
+ if (result.isRestartRequired()) {
+ PropertySimple oobMessage = new PropertySimple("__OOB",
+ "The server needs a restart for the latest changes to come effective.");
+ conf.put(oobMessage);
+ }
+ }
+ }
+
+ /**Executes boilerplate finish for read operation.
+ *
+ * @param report
+ * @param conf
+ * @param write
+ */
+ private void executeAndGenerateServerUpdateIfNecessary(Configuration configuration, ReadAttribute op) {
+ Result res = getASConnection().execute(op);
+ if (res.isReloadRequired()) {
+ PropertySimple oobMessage = new PropertySimple("__OOB",
+ "The server needs a reload for the latest changes to come effective.");
+ configuration.put(oobMessage);
+ }
+ if (res.isRestartRequired()) {
+ PropertySimple oobMessage = new PropertySimple("__OOB",
+ "The server needs a restart for the latest changes to come effective.");
+ configuration.put(oobMessage);
+ }
+ }
+
+ /** Locates the write ModuleOptionType mapped to the AS7Node attribute passed in.
+ * Ex. 'login-modules' -> Authentication (Classic * type. One of three types.
+ *
+ * @param attribute
+ * @return
+ */
+ public static ModuleOptionType loadModuleOptionType(String attribute) {
+ ModuleOptionType located = ModuleOptionType.typeMap.get(attribute);
+ if (located == null) {
+ throw new IllegalArgumentException("Unknown node '" + attribute
+ + "' entered for which no valid ModuleOptionType could be found.");
+ }
+ return located;
+ }
+
+ /** Takes the result passed in(successful readAttribute for ModuleOptionType) and
+ * parses the json to populate a json object of type List<Value> with the
+ * results.
+ * Handles inconsistencies in model representation for login-modules vs.
+ * the other supported ModuleOptionTypes.
+ *
+ * @param result json.Result type from successful read of attribute.
+ * @param type ModuleOptionType
+ * @return List<Value> type populated with moduleOption details.
+ */
+ public static List<Value> populateSecurityDomainModuleOptions(Result result, ModuleOptionType type) {
+ //initialize empty
+ List<Value> populated = new ArrayList<Value>();
+ //input validation
+ if ((result != null) && (result.isSuccess())) {
+
+ //parse json and populate the object.
+ Object rawResult = result.getResult();
+
+ if (rawResult instanceof ArrayList) {
+ //iterate over the module option type passed in.
+ ArrayList moduleOptionTypeChildrenList = (ArrayList) rawResult;
+ for (int i = 0; i < moduleOptionTypeChildrenList.size(); i++) {
+ Value value = new Value();
+ //stores current <module-options> defined.
+ LinkedHashMap<String, Object> optionsMap = new LinkedHashMap<String, Object>();
+ Object entryCheck = ((ArrayList) rawResult).get(i);
+
+ if (entryCheck instanceof HashMap) {
+
+ //this is the root attribute map for all children of the specific custom Security Domain
+ //type attributes.
+ Map<String, Object> attributeMap = (HashMap<String, Object>) entryCheck;
+ for (String key : attributeMap.keySet()) {
+
+ //peek at contents to exclude empty values.
+ String extracted = String.valueOf(attributeMap.get(key));
+ if (!extracted.trim().isEmpty()) {
+ if (key.equals("flag")) {
+ value.setFlag(extracted);
+ } else if (key.equals("code")) {
+ value.setCode(extracted);
+ } else if (key.equals("type")) {
+ value.setType(extracted);
+ } else if (key.equals("module-options")) {
+ //Need to support both Map and List types here because of inconsistent representations.
+ Object optionEntity = attributeMap.get(key);
+ if (optionEntity instanceof HashMap) {
+ Map<String, Object> entryList = (HashMap<String, Object>) optionEntity;
+ for (String oKey : entryList.keySet()) {
+ //get key and value and populate ModuleEntries found.
+ optionsMap.put(oKey, String.valueOf(entryList.get(oKey)));
+ }
+ } else if (optionEntity instanceof ArrayList) {
+ Object listEntryCheck = ((ArrayList) optionEntity).get(0);
+ if (listEntryCheck instanceof HashMap) {
+ ArrayList list = (ArrayList) optionEntity;
+ for (Object listEntry : list) {//iterate over each instance to get all values.
+ Map<String, Object> entryList = (HashMap<String, Object>) listEntry;
+ for (String oKey : entryList.keySet()) {
+ //get key and value and populate ModuleEntries found.
+ optionsMap.put(oKey, String.valueOf(entryList.get(oKey)));
+ }
+ }
+ }
+ }//end of if/else
+ }
+ }//end of empty value check
+ }
+ }//end of HashMap for SecurityDomain child check
+ value.setOptions(optionsMap);
+ populated.add(value);
+ }//end of moduleOptionType iteration
+ }
+ }
+
+ return populated;
+ }
+
+ @JsonSerialize(include = Inclusion.NON_NULL)
+ public static class Value {
+ // no args for jackson.
+ public Value() {
+ };
+
+ /** Three possible flags can be set. c-> code f->flag t->type
+ * Acl c f
+ * Authentication c f
+ * Authentication(Jaspi)c f
+ * Authorization c f
+ * Identity Trust c f
+ * Mapping c t
+ * Audit c
+ *
+ * @param code
+ * @param flag
+ * @param type
+ */
+ public Value(String code, String flag, String type) {
+ setCode(code);
+ if ((flag != null) && (!flag.trim().isEmpty())) {
+ setFlag(flag);
+ }
+ if ((type != null) && (!type.trim().isEmpty())) {
+ setType(type);
+ }
+ }
+
+ //default to empty string for case where specific attribute is not used.
+ @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ private String flag;
+ private String code;
+ @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getFlag() {
+ return flag;
+ }
+
+ public void setFlag(String flag) {
+ this.flag = flag;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ //overrides the type name for serialization/deserialization.
+ @JsonProperty(value = "module-options")
+ @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+ private LinkedHashMap<String, Object> options = null;
+
+ @JsonProperty(value = "module-options")
+ public LinkedHashMap<String, Object> getOptions() {
+ if (options == null) {
+ options = new LinkedHashMap<String, Object>();
+ }
+ return options;
+ }
+
+ @JsonProperty(value = "module-options")
+ public void setOptions(LinkedHashMap<String, Object> options) {
+ this.options = options;
+ }
+
+ @Override
+ public String toString() {
+ String serialized = "";
+ serialized += "code=" + getCode() + ", ";
+ if (getFlag() != null) {
+ serialized += "flag=" + getFlag() + ", ";
+ } else if (getType() != null) {
+ serialized += "type=" + getType() + ", ";
+ }
+ String options = "module-options=";
+ if (getOptions().isEmpty()) {
+ options += " {}";
+ } else {
+ options += " {";
+ for (String key : getOptions().keySet()) {
+ options += key + "=\"" + getOptions().get(key) + "\",";
+ }
+ options = options.substring(0, options.length() - 1);
+ options += "} ";
+ }
+ serialized += options;
+ return serialized;
+ }
+ }
+
+ /** Handles the creation of
+ *
+ * @param address
+ * @param attribute
+ * @param moduleTypeValue
+ * @return
+ */
+ public static Operation createAddModuleOptionTypeOperation(Address address, String attribute,
+ List<Value> moduleTypeValue) {
+ Operation add = null;
+ if ((address != null) & (attribute != null) & (moduleTypeValue != null)) {
+ add = new Operation("add", address);
+ add.addAdditionalProperty(attribute, moduleTypeValue);
+ }
+ return add;
+ }
+}
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsDiscoveryComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsDiscoveryComponent.java
new file mode 100644
index 0000000..619d7d5
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ModuleOptionsDiscoveryComponent.java
@@ -0,0 +1,188 @@
+package org.rhq.modules.plugins.jbossas7;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.ReadAttribute;
+import org.rhq.modules.plugins.jbossas7.json.ReadChildrenNames;
+import org.rhq.modules.plugins.jbossas7.json.ReadResource;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+
+/**
+ * Discovery class for Module Options nodes.
+ *
+ * @author Simeon Pinder
+ */
+public class ModuleOptionsDiscoveryComponent implements ResourceDiscoveryComponent<BaseComponent<?>> {
+
+ private final Log log = LogFactory.getLog(this.getClass());
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<BaseComponent<?>> context)
+ throws InvalidPluginConfigurationException, Exception {
+
+ Set<DiscoveredResourceDetails> details = new HashSet<DiscoveredResourceDetails>();
+
+ BaseComponent parentComponent = context.getParentResourceComponent();
+ ASConnection connection = parentComponent.getASConnection();
+
+ Configuration config = context.getDefaultPluginConfiguration();
+ String confPath = config.getSimpleValue("path", "");
+ if (confPath == null || confPath.isEmpty()) {
+ log.error("Path plugin config is null for ResourceType [" + context.getResourceType().getName() + "].");
+ return details;
+ }
+
+ //locate parent component identifier via path
+ Configuration configParent = parentComponent.pluginConfiguration;
+ String parentConfPath = configParent.getSimpleValue("path", "");
+
+ //create relevant path and address details.
+ String path = confPath;//Ex. subsystem=security
+ //processing to retrieve parent for profile/domain mode.
+ if ((parentConfPath != null) && (!parentConfPath.isEmpty())) {
+ path = parentConfPath + "," + confPath;//Ex. profile=standalone-ha,subsystem=security
+ }
+
+ String name = "";//name=security
+ Address address = new Address(path);
+
+ //process the specific nodes
+ //Then we need to find out which of subchildren of ModOpsComponent is used i)security-domain=*
+ //ii)[Authentication*,etc] or iii)[ModOptions]
+
+ //path should already be right
+ if (path.endsWith("security-domain")) {//individual security domain entries
+ //ex. path => /subsystem=security/security-domain=(entry name)
+ //find all children and iterate over and update name appropriately
+ Address typeAddress = new Address(path);
+ String childType = "security-domain";
+ Result result = connection.execute(new ReadChildrenNames(typeAddress, childType));
+
+ if (result.isSuccess()) {
+
+ @SuppressWarnings("unchecked")
+ List<String> children = (List<String>) result.getResult();
+ for (String child : children) {
+ //update the components for discovery
+ name = child;//ex. basic, databaseDomain
+ String currentChildPath = path + //ex. /subsystem=security,security-domain=jboss-web
+ "=" + child;
+ address = new Address(currentChildPath);
+ addDiscoveredResource(context, details, connection, currentChildPath, name, address);
+ }
+ }
+ } else if (ifResourceIsSupportedModuleType(path)) {//is ModOptions map child
+ //ex. path => /subsystem=security/security-domain=(entry name)/authentication=classic/login-modules
+ //Ex. String attribute = "login-modules";
+ String attribute = lookupAttributeType(path);
+ //query all the module-options defined and discover them here
+ //Ex. String typeAddress = "subsystem=security,security-domain=testDomain2,authentication=classic";
+ String typeAddress = parentConfPath;
+ ReadAttribute readModuleOptionType = new ReadAttribute(new Address(typeAddress), attribute);
+ Result result = connection.execute(readModuleOptionType);
+ if (result.isSuccess()) {
+ List<Value> loadedLoginModuleTypes = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ int moduleIndex = 0;
+ for (Value loginModule : loadedLoginModuleTypes) {
+ //Ex. name = "Login Module " + moduleIndex;
+ name = ModuleOptionsComponent.ModuleOptionType.readableNameMap.get(attribute) + " " + moduleIndex;
+ //Ex. subsystem=security,security-domain=testDomain2,authentication=classic,login-modules:0
+ String currentPath = path + ":" + moduleIndex++;
+ //add the discovered resource
+ addDiscoveredResource(context, details, connection, currentPath, name, address);
+ }
+ }
+ } else if (path.endsWith("module-options")) {//is ModOptions map child
+ //ex. path => /subsystem=security/security-domain=(entry name)/acl=classic/login-modules*module-options
+ //update name appropriately
+ name = "Module Options";
+ //add the discovered resource
+ addDiscoveredResource(context, details, connection, path, name, address);
+ } else {//[Authentication*,etc] children aka all others.
+ //ex. path => /subsystem=security/security-domain=(entry name)/authentication=classic
+ //update name appropriately
+ name = context.getResourceType().getName();//Authentication (Classic). Singletons.
+ //add the discovered resource
+ addDiscoveredResource(context, details, connection, path, name, address);
+ }
+ return details;
+ }
+
+ private String lookupAttributeType(String path) {
+ String attribute = null;
+ if ((path != null) && (!path.trim().isEmpty())) {
+ //Ex. subsystem=security,security-domain=testDomain2,authentication=classic,login-modules
+ String[] segments = path.split(",");
+ //contents of last segment should be the 'attribute' value of one of the ModuleOptionTypes
+ if (segments.length > 1) {
+ String last = segments[segments.length - 1];
+ if (ModuleOptionsComponent.ModuleOptionType.typeMap.keySet().contains(last)) {
+ attribute = last;
+ }
+ }
+ }
+ return attribute;
+ }
+
+ private boolean ifResourceIsSupportedModuleType(String path) {
+ boolean resourceIsSupported =false;
+ if ((path != null) && (!path.trim().isEmpty())) {
+ //Ex. subsystem=security,security-domain=testDomain2,authentication=classic,login-modules
+ String[] segments = path.split(",");
+ //contents of last segment should be the 'attribute' value of one of the ModuleOptionTypes
+ if (segments.length > 1) {
+ String last = segments[segments.length - 1];
+ if (ModuleOptionsComponent.ModuleOptionType.typeMap.keySet().contains(last)) {
+ resourceIsSupported = true;
+ }
+ }
+ }
+ return resourceIsSupported;
+ }
+
+ /** Adds discovered resource.
+ *
+ * @param context
+ * @param details
+ * @param connection
+ * @param path
+ * @param name
+ * @param address
+ */
+ private void addDiscoveredResource(ResourceDiscoveryContext context, Set<DiscoveredResourceDetails> details,
+ ASConnection connection, String path, String name, Address address) {
+ //ping the resource to determine if it's enabled and available.
+ ReadResource op = new ReadResource(address);
+ Result result = connection.execute(op);
+ if (result.isSuccess()) {
+
+ //include the config entry for the discovered node.
+ Configuration config2 = context.getDefaultPluginConfiguration();
+ //add path component to config as well.
+ PropertySimple pathProp = new PropertySimple("path", path);
+ config2.put(pathProp);
+
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), // DataType
+ path, // Key
+ name, // Name
+ null, // Version
+ context.getResourceType().getDescription(), // Description
+ config2, null);
+ details.add(detail);
+ }
+ }
+}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 956eed8..ecbaea2 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -768,6 +768,60 @@
</resource-configuration>
'>
+ <!ENTITY loginModuleResourceConfig '
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="true"
+ description="Class name of the module to be instantiated.">
+ <c:property-options>
+ <c:option value="AdvancedADLdap" />
+ <c:option value="AdvancedLdap" />
+ <c:option value="Certificate" />
+ <c:option value="CertificateRoles" />
+ <c:option value="CertificateUsers" />
+ <c:option value="Client" />
+ <c:option value="ConfigureIdentity" />
+ <c:option value="Database" />
+ <c:option value="DatabaseCertificate" />
+ <c:option value="DatabaseUsers" />
+ <c:option value="Identity" />
+ <c:option value="Kerberos" />
+ <c:option value="Ldap" />
+ <c:option value="LdapExtended" />
+ <c:option value="LdapUsers" />
+ <c:option value="PropertiesUsers" />
+ <c:option value="RoleMapping" />
+ <c:option value="RunAs" />
+ <c:option value="Simple" />
+ <c:option value="SimpleUsers" />
+ <c:option value="SPNEGOUsers" />
+ <c:option value="UsersRoles" />
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
+ <c:property-options>
+ <c:option value="optional"/>
+ <c:option value="required"/>
+ <c:option value="requisite"/>
+ <c:option value="sufficient"/>
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+'>
+
+ <!ENTITY flagModuleResourceConfig '
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
+ <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
+ <c:property-options>
+ <c:option value="optional"/>
+ <c:option value="required"/>
+ <c:option value="requisite"/>
+ <c:option value="sufficient"/>
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+'>
+
]>
<plugin name="&pluginName;"
displayName="JBoss Application Server 7.x"
@@ -3095,272 +3149,306 @@
</c:simple-property>
</resource-configuration>
- <service name="ACL (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <service name="ACL (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="acl=classic"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl=classic" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="acl-modules" required="false" description="List of acl modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the acl provider module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ &flagModuleResourceConfig;
+ <service name="Acl Modules (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <service name="Audit (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl-modules" />
+ </plugin-configuration>
+ &flagModuleResourceConfig;
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="audit=classic"/>
- </plugin-configuration>
+ <service name="Module Options (Acl - Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <resource-configuration>
- <c:list-property name="provider-modules" required="false" description="List of provider modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <service name="Authentication (Classic - Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Acl - Managed Server) -->
+ </service><!-- End of Acl Modules (Managed Server) -->
+ </service>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=classic"/>
- </plugin-configuration>
+ <service name="Audit (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <resource-configuration>
- <c:list-property name="login-modules" required="false" description="List of authentication modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true"
- description="Class name of the module to be instantiated.">
- <c:property-options>
- <c:option value="AdvancedADLdap" />
- <c:option value="AdvancedLdap" />
- <c:option value="Certificate" />
- <c:option value="CertificateRoles" />
- <c:option value="Client" />
- <c:option value="Database" />
- <c:option value="DatabaseCertificate" />
- <c:option value="DatabaseUsers" />
- <c:option value="Identity" />
- <c:option value="Kerberos" />
- <c:option value="Ldap" />
- <c:option value="LdapExtended" />
- <c:option value="RoleMapping" />
- <c:option value="Simple" />
- <c:option value="SPNEGOUsers" />
- <c:option value="UserRoles" />
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="audit=classic" />
+ </plugin-configuration>
- <service name="Authentication (Jaspi - Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
+ <service name="Provider Modules (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=jaspi"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="provider-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
- <resource-configuration>
- <c:list-property name="auth-modules" required="true" description="List of authentication modules to be used." >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the auth module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- <c:simple-property name="login-module-stack-ref" required="false" type="string" readOnly="true" description="Reference to a login module stack name previously configured in the same security domain."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
+ <service name="Module Options (Provider Modules - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
- <service name="Login Module Stack (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="login-module-stack"/>
- </plugin-configuration>
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Provider Modules - Managed Server) -->
+ </service><!-- End of Provider Modules - Managed Server -->
+ </service>
- <resource-configuration>
- <c:list-property name="login-modules" required="true" description="List of authentication modules" >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
- </service>
+ <service name="Authentication (Classic - Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <service name="Authorization (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=classic" />
+ </plugin-configuration>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authorization=classic"/>
- </plugin-configuration>
+ <service name="Login Modules (Classic - Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <resource-configuration>
- <c:list-property name="policy-modules" required="false" description="List of authorization modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the policy module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-modules" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
- <service name="Identity Trust (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <service name="Module Options (Classic - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="identity-trust=classic"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="trust-modules" required="false" description="List of trust modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="true" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="true" description="Name of JBoss Module where the identity trust module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options -->
+ </service><!-- End of Login Modules (Classic - Managed Server) -->
+ </service><!-- End of Authentication (Classic - Managed Server) -->
- <service name="JSSE (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent">
+ <service name="Authentication (Jaspi - Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="jsse"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=jaspi" />
+ </plugin-configuration>
- <resource-configuration>
- <c:simple-property name="cipher-suites" required="false" type="string" readOnly="true" description="Comma separated list of cipher suites to enable on SSLSockets."/>
- <c:simple-property name="client-alias" required="false" type="string" readOnly="true" description="Preferred alias to use when the KeyManager chooses the client alias."/>
- <c:simple-property name="client-auth" required="false" type="boolean" readOnly="true" description="Boolean attribute to indicate if client's certificates should also be authenticated on the server side."/>
- <c:map-property name="key-manager" required="false" description="JSEE Key Manager factory">
- <c:simple-property name="algorithm" required="false" type="string" readOnly="true" description="Algorithm to use when creating the KeyManagerFactory."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="true" description="Provider class name to use when creating the KeyManagerFactory."/>
- </c:map-property>
- <c:map-property name="keystore" required="false" description="Configures a JSSE key store">
- <c:simple-property name="password" required="false" type="string" readOnly="true" description="Sets the password of the keystore. Either this or 'truststore-password' must be present otherwise the security domain will be useless."/>
- <c:simple-property name="type" required="false" type="string" readOnly="true" description="Type of the keystore. If not set, type defaults to 'JKS'."/>
- <c:simple-property name="url" required="false" type="string" readOnly="true" description="URL of the keystore."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="true" description="Provider class name to use when creating the KeyStore."/>
- <c:simple-property name="provider-argument" required="false" type="string" readOnly="true" description="String argument to pass to the keystore Provider constructor when instantiating it."/>
- </c:map-property>
- <c:simple-property name="protocols" required="false" type="string" readOnly="true" description="Comma separated list of protocols to enable on SSLSockets."/>
- <c:simple-property name="server-alias" required="false" type="string" readOnly="true" description="Preferred alias to use when the KeyManager chooses the server alias."/>
- <c:simple-property name="service-auth-token" required="false" type="string" readOnly="true" description="Token to retrieve PrivateKeys from the KeyStore."/>
- <c:map-property name="trust-manager" required="false" description="JSEE Trust Manager factory">
- <c:simple-property name="algorithm" required="false" type="string" readOnly="true" description="Algorithm to use when creating the TrustManagerFactory."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="true" description="Provider class name to use when creating the TrustManagerFactory."/>
- </c:map-property>
- <c:map-property name="truststore" required="false" description="Configures a JSSE trust store">
- <c:simple-property name="password" required="false" type="string" readOnly="true" description="Sets the password of the truststore. Either this or 'keystore-password' must be present otherwise the security domain will be useless."/>
- <c:simple-property name="type" required="false" type="string" readOnly="true" description="Type of the truststore. If not set, type defaults to 'JKS'."/>
- <c:simple-property name="url" required="false" type="string" readOnly="true" description="URL of the truststore."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="true" description="Provider class name to use when creating the truststore."/>
- <c:simple-property name="provider-argument" required="false" type="string" readOnly="true" description="String argument to pass to the truststore Provider constructor when instantiating it."/>
- </c:map-property>
- </resource-configuration>
- </service>
+ &loginModuleResourceConfig;
- <service name="Mapping (Managed Server)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true">
+ <service name="Login Module Stack (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="mapping=classic"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-module-stack" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="mapping-modules" required="false" description="List of modules that map principal, role, and credential information">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true" description="Class name of the module to be instantiated."/>
- <c:simple-property name="type" required="true" type="string" readOnly="true" description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential.."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="true" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ &loginModuleResourceConfig;
+
+ <service name="Module Options (Login Module Stack (Managed Server))" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options -->
+
+ </service>
+ </service>
+
+ <service name="Authorization (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authorization=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Authorization Modules (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="policy-modules" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Authorization - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Authorization - Managed Server) -->
+ </service><!-- End of Authorization Modules (Managed Server) -->
+ </service>
+
+ <service name="Identity Trust (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="identity-trust=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+ <service name="Identity Trust Modules (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="trust-modules" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Identity Trust - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Identity Trust - Managed Server) -->
+ </service><!-- End of Identity Trust Modules (Managed Server) -->
+ </service>
+
+ <service name="JSSE (Managed Server)" discovery="SubsystemDiscovery" class="BaseComponent">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="jsse" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="cipher-suites" required="false" type="string" readOnly="true"
+ description="Comma separated list of cipher suites to enable on SSLSockets." />
+ <c:simple-property name="client-alias" required="false" type="string" readOnly="true"
+ description="Preferred alias to use when the KeyManager chooses the client alias." />
+ <c:simple-property name="client-auth" required="false" type="boolean" readOnly="true"
+ description="Boolean attribute to indicate if client's certificates should also be authenticated on the server side." />
+ <c:map-property name="key-manager" required="false" description="JSEE Key Manager factory">
+ <c:simple-property name="algorithm" required="false" type="string" readOnly="true"
+ description="Algorithm to use when creating the KeyManagerFactory." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="true"
+ description="Provider class name to use when creating the KeyManagerFactory." />
+ </c:map-property>
+ <c:map-property name="keystore" required="false" description="Configures a JSSE key store">
+ <c:simple-property name="password" required="false" type="string" readOnly="true"
+ description="Sets the password of the keystore. Either this or 'truststore-password' must be present otherwise the security domain will be useless." />
+ <c:simple-property name="type" required="false" type="string" readOnly="true"
+ description="Type of the keystore. If not set, type defaults to 'JKS'." />
+ <c:simple-property name="url" required="false" type="string" readOnly="true" description="URL of the keystore." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="true"
+ description="Provider class name to use when creating the KeyStore." />
+ <c:simple-property name="provider-argument" required="false" type="string" readOnly="true"
+ description="String argument to pass to the keystore Provider constructor when instantiating it." />
+ </c:map-property>
+ <c:simple-property name="protocols" required="false" type="string" readOnly="true"
+ description="Comma separated list of protocols to enable on SSLSockets." />
+ <c:simple-property name="server-alias" required="false" type="string" readOnly="true"
+ description="Preferred alias to use when the KeyManager chooses the server alias." />
+ <c:simple-property name="service-auth-token" required="false" type="string" readOnly="true"
+ description="Token to retrieve PrivateKeys from the KeyStore." />
+ <c:map-property name="trust-manager" required="false" description="JSEE Trust Manager factory">
+ <c:simple-property name="algorithm" required="false" type="string" readOnly="true"
+ description="Algorithm to use when creating the TrustManagerFactory." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="true"
+ description="Provider class name to use when creating the TrustManagerFactory." />
+ </c:map-property>
+ <c:map-property name="truststore" required="false" description="Configures a JSSE trust store">
+ <c:simple-property name="password" required="false" type="string" readOnly="true"
+ description="Sets the password of the truststore. Either this or 'keystore-password' must be present otherwise the security domain will be useless." />
+ <c:simple-property name="type" required="false" type="string" readOnly="true"
+ description="Type of the truststore. If not set, type defaults to 'JKS'." />
+ <c:simple-property name="url" required="false" type="string" readOnly="true" description="URL of the truststore." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="true"
+ description="Provider class name to use when creating the truststore." />
+ <c:simple-property name="provider-argument" required="false" type="string" readOnly="true"
+ description="String argument to pass to the truststore Provider constructor when instantiating it." />
+ </c:map-property>
+ </resource-configuration>
+ </service>
+
+ <service name="Mapping (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping=classic" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+ <service name="Mapping Modules (Managed Server)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+
+ <service name="Module Options (Mapping - Managed Server)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Mapping - Managed Server) -->
+ </service><!-- End of Mapping Modules (Managed Server) -->
+ </service>
</service>
<service name="Vault (Managed Server)"
@@ -5863,8 +5951,8 @@
</service>
<service name="Security (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
+ discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent"
description="The configuration of the security subsystem."
singleton="true">
@@ -5877,8 +5965,8 @@
</resource-configuration>
<service name="Security Domain (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
+ discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent"
createDeletePolicy="both">
<plugin-configuration>
@@ -5894,281 +5982,305 @@
</c:simple-property>
</resource-configuration>
- <service name="ACL (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="ACL (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="acl=classic"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl=classic" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="acl-modules" required="false" description="List of acl modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the acl provider module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ &flagModuleResourceConfig;
+ <service name="Acl Modules (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <service name="Audit (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl-modules" />
+ </plugin-configuration>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="audit=classic"/>
- </plugin-configuration>
+ &flagModuleResourceConfig;
- <resource-configuration>
- <c:list-property name="provider-modules" required="false" description="List of provider modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <service name="Module Options (Acl - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <service name="Authentication (Classic - Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=classic"/>
- </plugin-configuration>
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Acl - Profile) -->
+ </service><!-- End of Acl Modules (Profile) -->
+ </service>
- <resource-configuration>
- <c:list-property name="login-modules" required="false" description="List of authentication modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true"
- description="Class name of the module to be instantiated.">
- <c:property-options>
- <c:option value="AdvancedADLdap" />
- <c:option value="AdvancedLdap" />
- <c:option value="Certificate" />
- <c:option value="CertificateRoles" />
- <c:option value="Client" />
- <c:option value="Database" />
- <c:option value="DatabaseCertificate" />
- <c:option value="DatabaseUsers" />
- <c:option value="Identity" />
- <c:option value="Kerberos" />
- <c:option value="Ldap" />
- <c:option value="LdapExtended" />
- <c:option value="RoleMapping" />
- <c:option value="Simple" />
- <c:option value="SPNEGOUsers" />
- <c:option value="UserRoles" />
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <service name="Audit (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
- <service name="Authentication (Jaspi - Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="audit=classic" />
+ </plugin-configuration>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=jaspi"/>
- </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
+ <service name="Provider Modules (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <resource-configuration>
- <c:list-property name="auth-modules" required="true" description="List of authentication modules to be used." >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the auth module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- <c:simple-property name="login-module-stack-ref" required="false" type="string" readOnly="false" description="Reference to a login module stack name previously configured in the same security domain."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="provider-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
- <service name="Login Module Stack (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- createDeletePolicy="both">
+ <service name="Module Options (Provider Modules - Profile)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="login-module-stack"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="login-modules" required="true" description="List of authentication modules" >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
- </service>
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Provider Modules - Profile) -->
+ </service><!-- End of Provider Modules (Profile) -->
+ </service>
- <service name="Authorization (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Authentication (Classic - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authorization=classic"/>
- </plugin-configuration>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=classic" />
+ </plugin-configuration>
- <resource-configuration>
- <c:list-property name="policy-modules" required="false" description="List of authorization modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the policy module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <service name="Login Modules (Classic - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <service name="Identity Trust (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-modules" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="identity-trust=classic"/>
- </plugin-configuration>
+ <service name="Module Options (Classic - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
- <resource-configuration>
- <c:list-property name="trust-modules" required="false" description="List of trust modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the identity trust module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
- <service name="JSSE (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- createDeletePolicy="both">
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options -->
+ </service><!-- End of Module Options -->
+ </service><!-- End of Authentication (Classic) -->
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="jsse"/>
- </plugin-configuration>
+ <service name="Authentication (Jaspi - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
- <resource-configuration>
- <c:simple-property name="cipher-suites" required="false" type="string" readOnly="false" description="Comma separated list of cipher suites to enable on SSLSockets."/>
- <c:simple-property name="client-alias" required="false" type="string" readOnly="false" description="Preferred alias to use when the KeyManager chooses the client alias."/>
- <c:simple-property name="client-auth" required="false" type="boolean" readOnly="false" description="Boolean attribute to indicate if client's certificates should also be authenticated on the server side."/>
- <c:map-property name="key-manager" required="false" description="JSEE Key Manager factory">
- <c:simple-property name="algorithm" required="false" type="string" readOnly="false" description="Algorithm to use when creating the KeyManagerFactory."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="false" description="Provider class name to use when creating the KeyManagerFactory."/>
- </c:map-property>
- <c:map-property name="keystore" required="false" description="Configures a JSSE key store">
- <c:simple-property name="password" required="false" type="string" readOnly="false" description="Sets the password of the keystore. Either this or 'truststore-password' must be present otherwise the security domain will be useless."/>
- <c:simple-property name="type" required="false" type="string" readOnly="false" description="Type of the keystore. If not set, type defaults to 'JKS'."/>
- <c:simple-property name="url" required="false" type="string" readOnly="false" description="URL of the keystore."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="false" description="Provider class name to use when creating the KeyStore."/>
- <c:simple-property name="provider-argument" required="false" type="string" readOnly="false" description="String argument to pass to the keystore Provider constructor when instantiating it."/>
- </c:map-property>
- <c:simple-property name="protocols" required="false" type="string" readOnly="false" description="Comma separated list of protocols to enable on SSLSockets."/>
- <c:simple-property name="server-alias" required="false" type="string" readOnly="false" description="Preferred alias to use when the KeyManager chooses the server alias."/>
- <c:simple-property name="service-auth-token" required="false" type="string" readOnly="false" description="Token to retrieve PrivateKeys from the KeyStore."/>
- <c:map-property name="trust-manager" required="false" description="JSEE Trust Manager factory">
- <c:simple-property name="algorithm" required="false" type="string" readOnly="false" description="Algorithm to use when creating the TrustManagerFactory."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="false" description="Provider class name to use when creating the TrustManagerFactory."/>
- </c:map-property>
- <c:map-property name="truststore" required="false" description="Configures a JSSE trust store">
- <c:simple-property name="password" required="false" type="string" readOnly="false" description="Sets the password of the truststore. Either this or 'keystore-password' must be present otherwise the security domain will be useless."/>
- <c:simple-property name="type" required="false" type="string" readOnly="false" description="Type of the truststore. If not set, type defaults to 'JKS'."/>
- <c:simple-property name="url" required="false" type="string" readOnly="false" description="URL of the truststore."/>
- <c:simple-property name="provider" required="false" type="string" readOnly="false" description="Provider class name to use when creating the truststore."/>
- <c:simple-property name="provider-argument" required="false" type="string" readOnly="false" description="String argument to pass to the truststore Provider constructor when instantiating it."/>
- </c:map-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=jaspi" />
+ </plugin-configuration>
- <service name="Mapping (Profile)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ &loginModuleResourceConfig;
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="mapping=classic"/>
- </plugin-configuration>
+ <service name="Login Module Stack (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
- <resource-configuration>
- <c:list-property name="mapping-modules" required="false" description="List of modules that map principal, role, and credential information">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="type" required="true" type="string" readOnly="false" description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential.."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-module-stack" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
+
+ <service name="Module Options (Login Module Stack (Profile))" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options -->
+
+ </service>
+ </service>
+
+ <service name="Authorization (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authorization=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+ <service name="Authorization Modules (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="policy-modules" />
+ </plugin-configuration>
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Authorization - Profile)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Authorization - Profile) -->
+ </service><!-- End of Authorization Modules (Profile) -->
+ </service>
+
+ <service name="Identity Trust (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="identity-trust=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+ <service name="Identity Trust Modules (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="trust-modules" />
+ </plugin-configuration>
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Identity Trust - Profile)" discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent" singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Identity Trust - Profile) -->
+ </service><!-- End of Identity Trust Modules (Profile) -->
+ </service>
+
+ <service name="JSSE (Profile)" discovery="SubsystemDiscovery" class="BaseComponent" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="jsse" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="cipher-suites" required="false" type="string" readOnly="false"
+ description="Comma separated list of cipher suites to enable on SSLSockets." />
+ <c:simple-property name="client-alias" required="false" type="string" readOnly="false"
+ description="Preferred alias to use when the KeyManager chooses the client alias." />
+ <c:simple-property name="client-auth" required="false" type="boolean" readOnly="false"
+ description="Boolean attribute to indicate if client's certificates should also be authenticated on the server side." />
+ <c:map-property name="key-manager" required="false" description="JSEE Key Manager factory">
+ <c:simple-property name="algorithm" required="false" type="string" readOnly="false"
+ description="Algorithm to use when creating the KeyManagerFactory." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="false"
+ description="Provider class name to use when creating the KeyManagerFactory." />
+ </c:map-property>
+ <c:map-property name="keystore" required="false" description="Configures a JSSE key store">
+ <c:simple-property name="password" required="false" type="string" readOnly="false"
+ description="Sets the password of the keystore. Either this or 'truststore-password' must be present otherwise the security domain will be useless." />
+ <c:simple-property name="type" required="false" type="string" readOnly="false"
+ description="Type of the keystore. If not set, type defaults to 'JKS'." />
+ <c:simple-property name="url" required="false" type="string" readOnly="false" description="URL of the keystore." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="false"
+ description="Provider class name to use when creating the KeyStore." />
+ <c:simple-property name="provider-argument" required="false" type="string" readOnly="false"
+ description="String argument to pass to the keystore Provider constructor when instantiating it." />
+ </c:map-property>
+ <c:simple-property name="protocols" required="false" type="string" readOnly="false"
+ description="Comma separated list of protocols to enable on SSLSockets." />
+ <c:simple-property name="server-alias" required="false" type="string" readOnly="false"
+ description="Preferred alias to use when the KeyManager chooses the server alias." />
+ <c:simple-property name="service-auth-token" required="false" type="string" readOnly="false"
+ description="Token to retrieve PrivateKeys from the KeyStore." />
+ <c:map-property name="trust-manager" required="false" description="JSEE Trust Manager factory">
+ <c:simple-property name="algorithm" required="false" type="string" readOnly="false"
+ description="Algorithm to use when creating the TrustManagerFactory." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="false"
+ description="Provider class name to use when creating the TrustManagerFactory." />
+ </c:map-property>
+ <c:map-property name="truststore" required="false" description="Configures a JSSE trust store">
+ <c:simple-property name="password" required="false" type="string" readOnly="false"
+ description="Sets the password of the truststore. Either this or 'keystore-password' must be present otherwise the security domain will be useless." />
+ <c:simple-property name="type" required="false" type="string" readOnly="false"
+ description="Type of the truststore. If not set, type defaults to 'JKS'." />
+ <c:simple-property name="url" required="false" type="string" readOnly="false" description="URL of the truststore." />
+ <c:simple-property name="provider" required="false" type="string" readOnly="false"
+ description="Provider class name to use when creating the truststore." />
+ <c:simple-property name="provider-argument" required="false" type="string" readOnly="false"
+ description="String argument to pass to the truststore Provider constructor when instantiating it." />
+ </c:map-property>
+ </resource-configuration>
+ </service>
+
+ <service name="Mapping (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping=classic" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+ <service name="Mapping Modules (Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+
+ <service name="Module Options (Mapping - Profile)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:map-property name="Module Options" required="false" />
+ </resource-configuration>
+ </service><!-- End of Module Options (Mapping - Profile) -->
+ </service><!-- End of Mapping Modules (Managed Server) -->
+ </service>
</service>
<service name="Vault (Profile)"
@@ -6611,6 +6723,27 @@
<c:simple-property name="routing-name" required="false" type="string" readOnly="false" description="Routing name of the divert"/>
<c:simple-property name="transformer-class-name" required="false" type="string" readOnly="false" description="The name of a class used to transform the message's body or properties before it is diverted."/>
</resource-configuration>
+
+ <service name="Module Option"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ createDeletePolicy="both"
+ description="The module options to be used."
+ singleton="true">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="module-options"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:list-property name="Modules Options" required="false" description="List of module options.">
+ <c:map-property name="*" required="false">
+ <c:simple-property name="name"/>
+ <c:simple-property name="value"/>
+ </c:map-property>
+ </c:list-property>
+ </resource-configuration>
+ </service>
</service>
<service name="Queue (Profile)"
@@ -10323,8 +10456,8 @@
</resource-configuration>
<service name="Security Domain"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
+ discovery="ModuleOptionsDiscoveryComponent"
+ class="ModuleOptionsComponent"
createDeletePolicy="both">
<plugin-configuration>
@@ -10352,219 +10485,200 @@
</c:simple-property>
</resource-configuration>
- <service name="ACL"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="ACL" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent" singleton="true"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+ <service name="Acl Modules" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="acl-modules" />
+ </plugin-configuration>
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Acl)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="acl=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="acl-modules" required="false" description="List of acl modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the acl provider module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options (Acl) -->
+ </service><!-- End of Acl Modules -->
+ </service>
- <service name="Audit"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Audit" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent" singleton="true"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="audit=classic" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
+ <service name="Provider Modules" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="provider-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ </resource-configuration>
+
+ <service name="Module Options (Provider Modules)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="audit=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="provider-modules" required="false" description="List of provider modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options (Provider Modules) -->
+ </service><!-- End of Provider Modules -->
+ </service>
- <service name="Authentication (Classic)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Authentication (Classic)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=classic" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
+
+ <service name="Login Modules (Classic)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-modules" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
+
+ <service name="Module Options (Classic)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="login-modules" required="false" description="List of authentication modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="true"
- description="Class name of the module to be instantiated.">
- <c:property-options>
- <c:option value="AdvancedADLdap" />
- <c:option value="AdvancedLdap" />
- <c:option value="Certificate" />
- <c:option value="CertificateRoles" />
- <c:option value="Client" />
- <c:option value="Database" />
- <c:option value="DatabaseCertificate" />
- <c:option value="DatabaseUsers" />
- <c:option value="Identity" />
- <c:option value="Kerberos" />
- <c:option value="Ldap" />
- <c:option value="LdapExtended" />
- <c:option value="RoleMapping" />
- <c:option value="Simple" />
- <c:option value="SPNEGOUsers" />
- <c:option value="UserRoles" />
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options -->
+ </service><!-- End of Login Modules (Classic) -->
+ </service><!-- End of Authentication (Classic) -->
- <service name="Authentication (Jaspi)"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Authentication (Jaspi)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authentication=jaspi" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
+
+ <service name="Login Module Stack" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="login-module-stack" />
+ </plugin-configuration>
+
+ &loginModuleResourceConfig;
+
+ <service name="Module Options (Login Module Stack)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authentication=jaspi"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="auth-modules" required="true" description="List of authentication modules to be used." >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the auth module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- <c:simple-property name="login-module-stack-ref" required="false" type="string" readOnly="false" description="Reference to a login module stack name previously configured in the same security domain."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
+ </service><!-- End of Module Options -->
- <service name="Login Module Stack"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- createDeletePolicy="both">
+ </service>
+ </service>
- <plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="login-module-stack"/>
- </plugin-configuration>
+ <service name="Authorization" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
- <resource-configuration>
- <c:list-property name="login-modules" required="true" description="List of authentication modules" >
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the login module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
- </resource-configuration>
- </service>
- </service>
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="authorization=classic" />
+ </plugin-configuration>
- <service name="Authorization"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ &flagModuleResourceConfig;
+
+ <service name="Authorization Modules" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="policy-modules" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Authorization)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="authorization=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="policy-modules" required="false" description="List of authorization modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the policy module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options (Authorization) -->
+ </service><!-- End of Authorization Modules -->
+ </service>
- <service name="Identity Trust"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Identity Trust" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true" createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="identity-trust=classic" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Identity Trust Modules" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="trust-modules" />
+ </plugin-configuration>
+
+ &flagModuleResourceConfig;
+
+ <service name="Module Options (Identity Trust)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="identity-trust=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="trust-modules" required="false" description="List of trust modules">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="flag" required="true" type="string" readOnly="false" description="The flag controls how the module participates in the overall procedure. Allowed values are requisite, required, sufficient or optional.">
- <c:property-options>
- <c:option value="sufficient"/>
- <c:option value="requisite"/>
- <c:option value="optional"/>
- <c:option value="required"/>
- </c:property-options>
- </c:simple-property>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="Name of JBoss Module where the identity trust module code is located."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options (Identity Trust) -->
+ </service><!-- End of Identity Trust Modules -->
+ </service>
<service name="JSSE"
discovery="SubsystemDiscovery"
@@ -10607,26 +10721,59 @@
</resource-configuration>
</service>
- <service name="Mapping"
- discovery="SubsystemDiscovery"
- class="BaseComponent"
- singleton="true"
- createDeletePolicy="both">
+ <service name="Mapping" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent" singleton="true"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping=classic" />
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+ <service name="Mapping Modules" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ createDeletePolicy="both">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="mapping-modules" />
+ </plugin-configuration>
+ <resource-configuration>
+ <c:simple-property name="code" required="true" type="string" readOnly="false"
+ description="Class name of the module to be instantiated." />
+ <c:simple-property name="type" required="true" type="string" readOnly="false"
+ description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential..">
+ <c:property-options>
+ <c:option value="attribute" />
+ <c:option value="credential" />
+ <c:option value="principal" />
+ <c:option value="role" />
+ </c:property-options>
+ </c:simple-property>
+ </resource-configuration>
+
+ <service name="Module Options (Mapping)" discovery="ModuleOptionsDiscoveryComponent" class="ModuleOptionsComponent"
+ singleton="true">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="mapping=classic"/>
+ <c:simple-property name="path" readOnly="true" default="module-options" />
</plugin-configuration>
<resource-configuration>
- <c:list-property name="mapping-modules" required="false" description="List of modules that map principal, role, and credential information">
- <c:map-property name="*" required="false">
- <c:simple-property name="code" required="true" type="string" readOnly="false" description="Class name of the module to be instantiated."/>
- <c:simple-property name="type" required="true" type="string" readOnly="false" description="Type of mapping this module performs. Allowed values are principal, role, attribute or credential.."/>
- <c:simple-property name="module-options" required="false" type="string" readOnly="false" description="List of module options containing a name/value pair."/>
- </c:map-property>
- </c:list-property>
+ <c:map-property name="Module Options" required="false" />
</resource-configuration>
- </service>
+ </service><!-- End of Module Options (Mapping) -->
+ </service><!-- End of Mapping Modules -->
+ </service>
</service>
<service name="Vault"
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/SecurityModuleOptionsTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/SecurityModuleOptionsTest.java
new file mode 100644
index 0000000..49d8040
--- /dev/null
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/SecurityModuleOptionsTest.java
@@ -0,0 +1,319 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2011 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.modules.plugins.jbossas7;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.Test;
+
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.ModuleOptionType;
+import org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent.Value;
+import org.rhq.modules.plugins.jbossas7.json.Address;
+import org.rhq.modules.plugins.jbossas7.json.Operation;
+import org.rhq.modules.plugins.jbossas7.json.ReadAttribute;
+import org.rhq.modules.plugins.jbossas7.json.Remove;
+import org.rhq.modules.plugins.jbossas7.json.Result;
+import org.rhq.modules.plugins.jbossas7.json.WriteAttribute;
+
+/**
+ * Test exercising the subsystem=security/SecurityDomain/[Authentication, Authorization, Mapping, Audit, Acl,
+ * Identity-Trust]
+ * @author Simeon Pinder
+ */
+@Test(groups = "unit")
+public class SecurityModuleOptionsTest extends AbstractConfigurationHandlingTest {
+
+ private static String user = "rhqadmin";
+ private static String pass = "as7";
+ private static String host = "localhost";
+ private static ASConnection con = null;
+ private static ObjectMapper mapper = null;
+ private ModuleOptionsComponent moc = null;
+
+ //Define some shared and reusable content
+ static HashMap<String, String> jsonMap = new HashMap<String, String>();
+ static {
+ jsonMap
+ .put(
+ "login-modules",
+ "[{\"flag\":\"required\", \"code\":\"Ldap\", \"module-options\":{\"bindDn\":\"uid=ldapSecureUser,ou=People,dc=redat,dc=com\", \"bindPw\":\"test126\", \"allowEmptyPasswords\":\"true\"}}]");
+ // "[{\"flag\":\"required\", \"code\":\"Ldap\"}]");
+ jsonMap
+ .put(
+ "policy-modules",
+ "[{\"flag\":\"requisite\", \"code\":\"LdapExtended\", \"module-options\":{\"policy\":\"module\", \"policy1\":\"module1\"}}]");
+ jsonMap
+ .put("mapping-modules",
+ "[{\"code\":\"Test\", \"type\":\"attribute\", \"module-options\":{\"mapping\":\"module\", \"mapping1\":\"module1\"}}]");
+ jsonMap.put("provider-modules",
+ "[{\"code\":\"Providers\", \"module-options\":{\"provider\":\"module\", \"provider1\":\"module1\"}}]");
+ }
+
+ @BeforeSuite
+ private void initializeConnectionDetails() {
+ con = new ASConnection(host, 9990, user, pass);
+ mapper = new ObjectMapper();
+ mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+
+ moc = new ModuleOptionsComponent();
+ }
+
+ public static void main(String[] args) {
+ SecurityModuleOptionsTest test = new SecurityModuleOptionsTest();
+ try {
+ test.initializeConnectionDetails();
+ test.testPopulateModuleOptionsAndTypes();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ /**The test reads the existing property values, deserializes them and writes the same
+ * contents back out to a running instance for all known ModuleOptionTypes.
+ *
+ * @throws Exception
+ */
+ public void testPopulateModuleOptionsAndTypes() throws Exception {
+
+ //as7 node details.
+ String securityDomainId = "testDomain";
+ //TODO: spinder 6-6-12: this cannot run as a standalone itest until JIRA https://issues.jboss.org/browse/AS7-4951
+ // is addressed as there is no way to automate setup of the information being tested.
+ String address = "subsystem=security,security-domain=" + securityDomainId + ",authentication=classic";
+ boolean verboseOutput = true;
+ boolean executeOperation = true;
+ for (ModuleOptionType t : ModuleOptionType.values()) {
+ String attribute = t.getAttribute();
+ if (verboseOutput) {
+ System.out.println("======= Running with ModuleOptionType:" + t + " attribute:" + attribute + ":");
+ }
+ if (attribute.equals("policy-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",authorization=classic";
+ } else if (attribute.equals("acl-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",acl=classic";
+ } else if (attribute.equals("mapping-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",mapping=classic";
+ } else if (attribute.equals("trust-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",identity-trust=classic";
+ } else if (attribute.equals("provider-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",audit=classic";
+ } else if (attribute.equals("login-modules")) {
+ address = "subsystem=security,security-domain=" + securityDomainId + ",authentication=classic";
+ } else {
+ assert false : "An unknown attribute '" + attribute
+ + "' was found. Is there a new type to be supported?";
+ }
+
+ //test operation- read property always available.
+ Operation op = null;
+
+ //read the login-modules attribute
+ op = new ReadAttribute(new Address(address), attribute);
+ Result result = exerciseOperation(op, true, verboseOutput);
+ assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
+ + result.getFailureDescription();
+ //extract current results
+ Object rawResult = result.getResult();
+ assert rawResult != null : "Read of attribute'" + attribute + "' from address '" + address
+ + "' has returned no value. Are those values in the model?";
+
+ List<Value> list2 = new ArrayList<Value>();
+ //populate the Value component complete with module Options.
+ list2 = moc.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ if (verboseOutput) {
+ if (rawResult != null) {
+ System.out.println("Raw Result is:" + rawResult + " and of type:" + rawResult.getClass());
+ } else {
+ System.out.println("Read of attribute'" + attribute + "' from address '" + address
+ + "' has returned no value. Are those values in the model?");
+ }
+ }
+ //write the login-modules attribute
+ op = new WriteAttribute(new Address(address));
+ op.addAdditionalProperty("name", attribute);//attribute to execute on
+ op.addAdditionalProperty("value", list2);
+
+ //Now test the operation
+ result = exerciseOperation(op, executeOperation, verboseOutput);
+ assert ((result.isSuccess() == true) || (result.getOutcome() == null)) : "The operation '" + op
+ + "' failed to write the resource.." + result.getFailureDescription();
+
+ //read the login-modules attribute
+ op = new ReadAttribute(new Address(address), attribute);
+ result = exerciseOperation(op, true, verboseOutput);
+ assert (result.isSuccess() == true) : "The operation '" + op + "' failed to read the resource."
+ + result.getFailureDescription();
+ }
+ if (verboseOutput) {
+ System.out.println("Successfully detected,read and wrote out attribute values for:");
+ for (ModuleOptionType type : ModuleOptionType.values()) {
+ System.out.println("\n" + type.ordinal() + " " + type.name());
+ }
+ }
+ }
+
+ /**Attempts to create a new Authentication node(authentication=classic) with a
+ * 'login-modules' attribute complete with 'code':'Ldap' and 'flag':'required'
+ * and some sample 'module-options' values.
+ *
+ */
+ @Test(enabled = true)
+ public void testCreateSecurityDomainChildLoginModules() {
+ boolean execute = true;
+ boolean verboseOutput = false;
+ String address = "subsystem=security,security-domain=testDomain3,authentication=classic";
+ String attribute = ModuleOptionType.Authentication.getAttribute();
+
+ //test operation- read property always available.
+ Operation op = null;
+
+ //read the login-modules attribute
+ op = new ReadAttribute(new Address(address), attribute);
+ Result result = exerciseOperation(op, execute, verboseOutput);
+ assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
+ + result.getFailureDescription();
+
+ //extract current results
+ Object rawResult = result.getResult();
+
+ //#### Have to create new content for the new node.
+ List<Value> moduleTypeValue = new ArrayList<Value>();
+ try {
+ // loading 'login-module'
+ JsonNode node = mapper.readTree(jsonMap.get(attribute));
+ result.setResult(mapper.treeToValue(node, Object.class));
+ } catch (JsonProcessingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ //populate the Value component complete with module Options.
+ moduleTypeValue = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+
+ //add the login-modules attribute
+ op = ModuleOptionsComponent
+ .createAddModuleOptionTypeOperation(new Address(address), attribute, moduleTypeValue);
+
+ result = exerciseOperation(op, execute, verboseOutput);
+ assert ((result.isSuccess() == true) || (result.getOutcome() == null)) : "The operation '" + op
+ + "' failed to write the resource.." + result.getFailureDescription();
+
+ //read the login-modules attribute
+ op = new ReadAttribute(new Address(address), attribute);
+ result = exerciseOperation(op, execute, verboseOutput);
+ assert result.isSuccess() == true : "The operation '" + op + "' failed to read the resource."
+ + result.getFailureDescription();
+
+ //exercise values retrieved from read
+ List<Value> serverResponse = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
+ ModuleOptionsComponent.loadModuleOptionType(attribute));
+ Value serverState = serverResponse.get(0);
+ assert serverState.getFlag().equals("required") : "Incorrect state retrieved for 'flag'. Expected 'required'.";
+ assert serverState.getCode().equals("Ldap") : "Incorrect state retrieved for 'code'. Expected 'Ldap'.";
+ LinkedHashMap<String, Object> options = serverState.getOptions();
+ assert options.size() == 3 : "Invalid number of module options returned. Expected 3.";
+ int found = 0;
+ for (String key : options.keySet()) {
+ if (key.equals("bindPw")) {
+ assert "test126".equals(options.get(key)) : "Module option value not correct for key '" + key + "'.";
+ found++;
+ } else if (key.equals("bindDn")) {
+ assert "uid=ldapSecureUser,ou=People,dc=redat,dc=com".equals(options.get(key)) : "Module option value not correct for key '"
+ + key + "'.";
+ found++;
+ } else if (key.equals("allowEmptyPasswords")) {
+ assert "true".equals(options.get(key)) : "Module option value not correct for key '" + key + "'.";
+ found++;
+ }
+ }
+ assert found == 3 : "All module options were not loaded.";
+
+ //remove the original node to reset for next run.
+ op = new Remove(new Address(address));
+ result = exerciseOperation(op, execute, verboseOutput);
+ assert result.isSuccess() == true : "The operation '" + op + "' failed to remove the resource."
+ + result.getFailureDescription();
+ }
+
+ /** For each operation
+ * - will write verbose json and operation details to system.out if verboseOutput = true;
+ * - will execute the operation against running server if execute = true.
+ *
+ * @param op
+ * @param execute
+ * @param verboseOutput
+ * @return
+ */
+ public static Result exerciseOperation(Operation op, boolean execute, boolean verboseOutput) {
+ //display operation as AS7 plugin will build it
+ if (verboseOutput) {
+ System.out.println("\tOperation is:" + op);
+ }
+
+ String jsonToSend = "";
+ try {
+ // jsonToSend = mapper.writeValueAsString(op);
+ jsonToSend = mapper.defaultPrettyPrintingWriter().writeValueAsString(op);
+ } catch (JsonGenerationException e) {
+ e.printStackTrace();
+ } catch (JsonMappingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ //As generated by jackson mapper
+ if (verboseOutput) {
+ System.out.println("@@@@ OUTBOUND JSON#\n" + jsonToSend + "#");
+ }
+
+ //Execute the operation
+ Result result = new Result();
+ if (execute) {
+ result = con.execute(op);
+ } else {
+ if (verboseOutput) {
+ System.out.println("**** NOTE: Execution disabled . NOT exercising write-attribute operation. **** ");
+ }
+ }
+ if (verboseOutput) {
+ //result wrapper details
+ System.out.println("\tResult:" + result);
+ //detailed results
+ System.out.println("\tValue:" + result.getResult());
+ System.out.println("-----------------------------------------------------\n");
+ }
+ return result;
+ }
+}
11 years, 11 months
[rhq] modules/enterprise
by lkrejci
modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java | 7 +++++++
modules/enterprise/gui/installer-war/src/main/webapp/start.jsp | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit a580f69b6dbf05df46c766daec53982365dac52e
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Tue Jun 19 13:15:37 2012 +0200
[BZ 801551] - Make sure the server name is not editable when upgrading
existing server in the installer.
diff --git a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
index 2af8f15..e06dbe8 100644
--- a/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
+++ b/modules/enterprise/gui/installer-war/src/main/java/org/rhq/enterprise/installer/ConfigurationBean.java
@@ -895,6 +895,12 @@ public class ConfigurationBean {
return ((null != registeredServerNames) && !registeredServerNames.isEmpty());
}
+ public boolean isInstallationSettingsConfigurable() {
+ String selectedServer = getSelectedRegisteredServerName();
+ return selectedServer == null || selectedServer.isEmpty()
+ || selectedServer.equals(I18Nmsg.getMsg(InstallerI18NResourceKeys.NEW_SERVER_SELECT_ITEM));
+ }
+
public List<SelectItem> getRegisteredServerNames() {
List<SelectItem> result = new ArrayList<SelectItem>(0);
@@ -925,6 +931,7 @@ public class ConfigurationBean {
// should not call getServerConfiguration.setValue()
public void setSelectedRegisteredServerName(String selectedRegisteredServerName) {
this.selectedRegisteredServerName = selectedRegisteredServerName;
+ setHaServerName(selectedRegisteredServerName);
}
public String getHaServerName() {
diff --git a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
index ad0219e..7bbb55c 100644
--- a/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
+++ b/modules/enterprise/gui/installer-war/src/main/webapp/start.jsp
@@ -210,7 +210,8 @@
document.getElementById('propForm:haendpointport').value = '';
document.getElementById('propForm:haendpointsecureport').value = '';
if (document.getElementById('propForm:haaffinitygroup') != null) {
- document.getElementById('propForm:haaffinitygroup').value = ''; }
+ document.getElementById('propForm:haaffinitygroup').value = '';
+ }
submit(); }" >
<f:selectItems value="#{configurationBean.registeredServerNames}" />
</h:selectOneMenu>
@@ -233,7 +234,7 @@
<h:outputText value="#{bundle.propertyHighAvailabilityName}" />
</h:outputLink>
<h:inputText id="haservername" size="#{configurationBean.propHaServerName.itemDefinition.fieldSize}"
- value="#{configurationBean.haServerName}" >
+ value="#{configurationBean.haServerName}" readonly="#{not configurationBean.installationSettingsConfigurable}">
</h:inputText>
<h:outputText value="#{bundle.yesString}" rendered="#{configurationBean.propHaServerName.itemDefinition.requiresRestart}" />
<h:outputText value="#{bundle.noString}" rendered="#{!configurationBean.propHaServerName.itemDefinition.requiresRestart}" />
11 years, 11 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/gui/rest-war/src/main/webapp/index.html | 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java | 96 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerLocal.java | 25 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationHistoryRest.java | 36 +++
modules/enterprise/server/jar/src/main/resources/rest_templates/listGroupDefinition.ftl | 10 -
modules/enterprise/server/jar/src/main/resources/rest_templates/listMetricSchedule.ftl | 6
modules/enterprise/server/jar/src/main/resources/rest_templates/listOperationHistory.ftl | 37 +++
modules/enterprise/server/jar/src/main/resources/rest_templates/operationHistory.ftl | 56 +++++
modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl | 3
9 files changed, 254 insertions(+), 16 deletions(-)
New commits:
commit 36085bd4268ab11fb394a69d92a12e7889a607b2
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 19 10:31:36 2012 +0200
Improve support for resource operation scheduling
diff --git a/modules/enterprise/gui/rest-war/src/main/webapp/index.html b/modules/enterprise/gui/rest-war/src/main/webapp/index.html
index 00d615f..1cb29eb 100644
--- a/modules/enterprise/gui/rest-war/src/main/webapp/index.html
+++ b/modules/enterprise/gui/rest-war/src/main/webapp/index.html
@@ -17,6 +17,7 @@ mobile client (Android) of the API.
<li><a href="1/alert/">Alerts</a></li>
<li><a href="1/status.html">System status</a> </li>
<li><a href="1/user/favorites/resource">Favorite resources</a></li>
+ <li><a href="1/operation/history">Operation histories</a></li>
</ul>
<hr/>
<h2>Misc examples (using <a href="https://github.com/mbostock/d3">D3.js</a>)</h2>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index 73a4ebb..cb233f8 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -27,14 +27,22 @@ import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.CacheControl;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import javax.ws.rs.core.UriInfo;
+import com.wordnik.swagger.annotations.ApiOperation;
+import com.wordnik.swagger.annotations.ApiParam;
+
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertySimple;
@@ -45,10 +53,12 @@ import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
import org.rhq.core.domain.operation.HistoryJobId;
import org.rhq.core.domain.operation.JobId;
import org.rhq.core.domain.operation.OperationDefinition;
+import org.rhq.core.domain.operation.OperationRequestStatus;
import org.rhq.core.domain.operation.ResourceOperationHistory;
import org.rhq.core.domain.operation.bean.ResourceOperationSchedule;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.rest.domain.Link;
@@ -139,7 +149,7 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
@Override
- public Response getOperationDefinitions(Integer resourceId, UriInfo uriInfo, Request request) {
+ public Response getOperationDefinitions(Integer resourceId, UriInfo uriInfo, Request request, HttpHeaders httpHeaders) {
if (resourceId == null)
throw new ParameterMissingException("resourceId");
@@ -281,8 +291,9 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
@Override
- public Response outcome(String jobName, UriInfo uriInfo) {
+ public Response outcome(String jobName, UriInfo uriInfo, Request request, HttpHeaders httpHeaders) {
+ MediaType mediaType = httpHeaders.getAcceptableMediaTypes().get(0);
ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
criteria.addFilterJobId(new JobId(jobName));
@@ -295,6 +306,68 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
history = list.get(0);
+ OperationHistoryRest hist = historyToHistoryRest(history, uriInfo);
+ Response.ResponseBuilder builder;
+ if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
+ builder = Response.ok(renderTemplate("operationHistory.ftl",hist));
+ } else {
+ builder = Response.ok(hist);
+ }
+ if (history.getStatus()== OperationRequestStatus.SUCCESS) {
+ // add a long time cache header
+ CacheControl cc = new CacheControl();
+ cc.setMaxAge(1200);
+ builder.cacheControl(cc);
+ }
+
+ return builder.build();
+
+ }
+
+ public Response listHistory(int resourceId, UriInfo uriInfo, Request request, HttpHeaders httpHeaders) {
+
+ ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
+ if (resourceId>0)
+ criteria.addFilterResourceIds(resourceId);
+
+ criteria.addSortEndTime(PageOrdering.DESC);
+
+ List<ResourceOperationHistory> list = opsManager.findResourceOperationHistoriesByCriteria(caller,criteria);
+
+ List<OperationHistoryRest> result = new ArrayList<OperationHistoryRest>(list.size());
+ for (ResourceOperationHistory roh : list) {
+ OperationHistoryRest historyRest = historyToHistoryRest(roh,uriInfo);
+ result.add(historyRest);
+ }
+
+ MediaType mediaType = httpHeaders.getAcceptableMediaTypes().get(0);
+ Response.ResponseBuilder builder;
+ if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
+ builder = Response.ok(renderTemplate("listOperationHistory.ftl", result));
+ } else {
+ GenericEntity<List<OperationHistoryRest>> res = new GenericEntity<List<OperationHistoryRest>>(result) {};
+ builder = Response.ok(res);
+ }
+ return builder.build();
+ }
+
+ @Override
+ public Response deleteOperationHistoryItem(String jobName) {
+
+ ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
+ criteria.addFilterJobId(new JobId(jobName));
+ List<ResourceOperationHistory> list = opsManager.findResourceOperationHistoriesByCriteria(caller,criteria);
+ if ((list != null && !list.isEmpty())) {
+
+ ResourceOperationHistory history = list.get(0);
+ opsManager.deleteOperationHistory(caller,history.getId(),false);
+ }
+ return Response.noContent().build();
+
+ }
+
+
+ private OperationHistoryRest historyToHistoryRest(ResourceOperationHistory history, UriInfo uriInfo) {
String status;
if (history.getStatus()==null)
status = " - no information yet -";
@@ -303,6 +376,10 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
OperationHistoryRest hist = new OperationHistoryRest();
hist.setStatus(status);
+ if (history.getResource()!=null)
+ hist.setResourceName(history.getResource().getName());
+ hist.setOperationName(history.getOperationDefinition().getName());
+ hist.lastModified(history.getModifiedTime());
if (history.getErrorMessage()!=null)
hist.setErrorMessage(history.getErrorMessage());
if (history.getResults()!=null) {
@@ -317,14 +394,17 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
}
+ String jobName = history.getJobName();
+ String jobGroup = history.getJobGroup();
+ JobId jobId = new JobId(jobName, jobGroup);
+ hist.setJobId(jobId.toString());
+
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/operation/history/{id}");
- URI url = uriBuilder.build(new JobId(jobName));
+ URI url = uriBuilder.build(jobId);
Link self = new Link("self",url.toString());
hist.getLinks().add(self);
-
-
- return Response.ok(hist).build();
-
+ return hist;
}
-}
+
+}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerLocal.java
index a4268b7..8cce452 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerLocal.java
@@ -70,7 +70,8 @@ public interface OperationsHandlerLocal {
public Response getOperationDefinitions(
@ApiParam(value = "Id of the resource",required = true) @QueryParam("resourceId") Integer resourceId,
@Context UriInfo uriInfo,
- @Context Request request
+ @Context Request request,
+ @Context HttpHeaders httpHeaders
);
@POST
@@ -104,7 +105,27 @@ public interface OperationsHandlerLocal {
@GET
@Path("history/{id}")
@ApiOperation("Return the outcome of the scheduled operation")
+ @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
public Response outcome(
@ApiParam("Name of the submitted job.") @PathParam("id") String jobName,
- @Context UriInfo uriInfo);
+ @Context UriInfo uriInfo,
+ @Context Request request,
+ @Context HttpHeaders httpHeaders);
+
+ @GET
+ @Path("history")
+ @ApiOperation("Return the outcome of the scheduled operations")
+ @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_HTML})
+ public Response listHistory(
+ @ApiParam("Id of a resource to limit to") @QueryParam("resourceId") int resourceId,
+ @Context UriInfo uriInfo,
+ @Context Request request,
+ @Context HttpHeaders httpHeaders);
+
+
+ @DELETE
+ @Path("history/{id}")
+ @ApiOperation(value = "Delete the operation history item with the passed id")
+ public Response deleteOperationHistoryItem(
+ @ApiParam("Name fo the submitted job") @PathParam("id") String jobId);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationHistoryRest.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationHistoryRest.java
index 8249db6..10967df 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationHistoryRest.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationHistoryRest.java
@@ -32,8 +32,12 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class OperationHistoryRest {
+ String operationName;
+ String resourceName;
+ long lastModified;
String status;
String errorMessage;
+ String jobId;
Map<String,Object> result = new HashMap<String, Object>();
List<Link> links = new ArrayList<Link>();
@@ -69,4 +73,36 @@ public class OperationHistoryRest {
public void setLinks(List<Link> links) {
this.links = links;
}
+
+ public String getOperationName() {
+ return operationName;
+ }
+
+ public void setOperationName(String operationName) {
+ this.operationName = operationName;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public void setResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ public void lastModified(long date) {
+ this.lastModified = date;
+ }
+
+ public String getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
}
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/listGroupDefinition.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/listGroupDefinition.ftl
index 15e8272..8e8acc3 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/listGroupDefinition.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/listGroupDefinition.ftl
@@ -21,17 +21,17 @@
-->
<#-- @ftlvariable name="var" type="java.util.List<org.rhq.enterprise.server.rest.domain.GroupDefinitionRest>" -->
<html>
+<#if (var?size>0) >
<ul>
- <#-- the next looks odd, but the incoming var is a list -->
- <#if (var?size>0) >
+<#-- the next looks odd, but the incoming var is a list -->
<#list var as var>
<li>
<#include "groupDefinition.ftl"/>
</li>
</#list>
- <#else>
- <strong>No Definitions have been set up</strong>
- </#if>
</ul>
+<#else>
+ <strong>No Definitions have been set up</strong>
+</#if>
<html>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/listMetricSchedule.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/listMetricSchedule.ftl
index b351644..a104675 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/listMetricSchedule.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/listMetricSchedule.ftl
@@ -21,12 +21,18 @@
-->
<#-- @ftlvariable name="var" type="java.util.List<org.rhq.enterprise.server.rest.domain.MetricSchedule>" -->
<html>
+<#if (var?size>0) >
<ul>
<#-- the next looks odd, but the incoming var is a list -->
+
<#list var as var>
<li>
<#include "metricSchedule.ftl"/>
</li>
</#list>
+
</ul>
+<#else>
+ <strong>No Schedules have been set up</strong>
+</#if>
<html>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/listOperationHistory.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/listOperationHistory.ftl
new file mode 100644
index 0000000..60fee92
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/listOperationHistory.ftl
@@ -0,0 +1,37 @@
+<#ftl >
+<#--
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 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.
+ */
+-->
+<#-- @ftlvariable name="var" type="java.util.List<org.rhq.enterprise.server.rest.domain.OperationHistoryRest>" -->
+<html>
+<#if (var?size>0) >
+<ul>
+
+ <#-- the next looks odd, but the incoming var is a list -->
+ <#list var as var>
+ <li>
+ <#include "operationHistory.ftl"/>
+ </li>
+ </#list>
+</ul>
+<#else>
+ <strong>No Operations have been run</strong>
+</#if>
+<html>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/operationHistory.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/operationHistory.ftl
new file mode 100644
index 0000000..b1141e7
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/operationHistory.ftl
@@ -0,0 +1,56 @@
+<#ftl >
+<#--
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 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.
+ */
+-->
+<#-- @ftlvariable name="var" type="org.rhq.enterprise.server.rest.domain.OperationHistoryRest" -->
+<html>
+
+<table>
+ <tr>
+ <td>Operation Name</td>
+ <td>${var.operationName}</td>
+ </tr>
+ <tr>
+ <td>Resource Name</td>
+ <td>${var.resourceName}</td>
+ </tr>
+ <tr>
+ <td>Outcome</td>
+ <td>${var.status}</td>
+ </tr>
+ <#if var.errorMessage?has_content>
+ <tr>
+ <td>Error</td>
+ <td>${var.errorMessage}</td>
+ </tr>
+ </#if>
+ <#if var.result?has_content>
+ <tr>
+ <td>Result Parameters</td>
+ <td>
+ <#assign result=var.result/>
+ <#list result?keys as p>
+ ${p} : ${result[p]}<br/>
+ </#list>
+ </td>
+ </tr>
+ </#if>
+</table>
+</html>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
index f4bfa15..c95c8ba 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
@@ -50,4 +50,5 @@
<a href="/rest/1/resource/${var.resourceId}/schedules.html">Schedules</a><br/>
<a href="/rest/1/resource/${var.resourceId}/availability.html">Current availability</a><br/>
<a href="/rest/1/resource/${var.resourceId}/availability/history.html">Availability History</a><br/>
- <a href="/rest/1/alert.html?resourceId=${var.resourceId}">Up to 20 Alerts for this resource</a>
+ <a href="/rest/1/alert.html?resourceId=${var.resourceId}">Up to 20 Alerts for this resource</a><br/>
+ <a href="/rest/1/operation/history.html?resourceId=${var.resourceId}">Operations history</a>
11 years, 11 months
[rhq] 2 commits - modules/plugins
by snegrea
modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java | 16 +++++++-
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 20 +++++-----
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java | 2 +
3 files changed, 26 insertions(+), 12 deletions(-)
New commits:
commit ed6b6c2a7666218a08c35eee6bd18f1f28b4409a
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jun 18 15:24:31 2012 -0500
Add one more no-argument operation to the list of ignored operations.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index f2d601c..bd904b9 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -108,6 +108,8 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
//ignored because this is not a true operation, it is handled
//internally by a configuration property change
ignoredOperations.add("enable");
+ //ignored because the Osgi subsystem not configured out of box
+ ignoredOperations.add("subsystem:activate");
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
commit 755964e1ac732505f8ef2261e9ed601205679f29
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jun 18 15:23:59 2012 -0500
[BZ 833187] Updates to support nullable lists. If a nullable list is empty then send back to the AS7 the null value instead of an empty list.
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
index d6d7329..366f840 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/ConfigurationWriteDelegate.java
@@ -520,6 +520,18 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet {
PropertyDefinition memberDef = propertyDefinition.getMemberDefinition();
List<Property> embeddedProps = property.getList();
+
+
+ String propertyName = property.getName();
+
+ if (propertyName.endsWith(":nullable")) {
+ propertyName = propertyName.substring(0, propertyName.indexOf(":nullable"));
+
+ if (embeddedProps.isEmpty()) {
+ return new SimpleEntry<String, List<Object>>(propertyName, null);
+ }
+ }
+
List<Object> values = new ArrayList<Object>();
for (Property inner : embeddedProps) {
if (memberDef instanceof PropertyDefinitionSimple) {
@@ -539,9 +551,9 @@ public class ConfigurationWriteDelegate implements ConfigurationFacet {
}
}
- String name = stripNumberIdentifier(property.getName());
+ propertyName = stripNumberIdentifier(property.getName());
- return new SimpleEntry<String, List<Object>>(name, values);
+ return new SimpleEntry<String, List<Object>>(propertyName, values);
}
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 68d5a36..956eed8 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -3638,7 +3638,7 @@
<c:simple-property name="persist-delivery-count-before-delivery" required="false" type="boolean" readOnly="true" defaultValue="false" description="Whether the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. The default value is false."/>
<c:simple-property name="persist-id-cache" required="false" type="boolean" readOnly="true" defaultValue="true" description="Whether IDs are persisted to the journal. The default value is true."/>
<c:simple-property name="persistence-enabled" required="false" type="boolean" readOnly="true" defaultValue="true" description="Whether the server will use the file based journal for persistence. The default value is true."/>
- <c:list-property name="remoting-interceptors" required="false" readOnly="true" description="The list of interceptor classes used by this server." >
+ <c:list-property name="remoting-interceptors:nullable" required="false" readOnly="true" description="The list of interceptor classes used by this server." >
<c:simple-property name="remoting-interceptors" readOnly="true"/>
</c:list-property>
<c:simple-property name="run-sync-speed-test" required="false" type="boolean" readOnly="true" defaultValue="false" description="Whether on startup to perform a diagnostic test on how fast your disk can sync. Useful when determining performance issues. The default value is false."/>
@@ -4604,7 +4604,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="true" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="true" defaultValue="500" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 500."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="true" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" readOnly="true" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined." >
+ <c:list-property name="static-connectors:nullable" required="false" readOnly="true" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined." >
<c:simple-property name="static-connectors" readOnly="true"/>
</c:list-property>
<c:simple-property name="use-duplicate-detection" required="false" type="boolean" readOnly="true" defaultValue="true" description="Whether the bridge will automatically insert a duplicate id property into each message that it forwards. The default value is true."/>
@@ -4727,7 +4727,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="true" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="true" defaultValue="2000" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 2000."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="true" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined." >
+ <c:list-property name="static-connectors:nullable" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined." >
<c:simple-property name="static-connectors" />
</c:list-property>
<c:simple-property name="transformer-class-name" required="false" type="string" readOnly="true" description="The name of a user-defined class which implements the org.hornetq.core.server.cluster.Transformer interface."/>
@@ -6253,7 +6253,7 @@
<c:simple-property name="persist-delivery-count-before-delivery" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. The default value is false."/>
<c:simple-property name="persist-id-cache" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether IDs are persisted to the journal. The default value is true."/>
<c:simple-property name="persistence-enabled" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether the server will use the file based journal for persistence. The default value is true."/>
- <c:list-property name="remoting-interceptors" required="false" description="The list of interceptor classes used by this server." >
+ <c:list-property name="remoting-interceptors:nullable" required="false" description="The list of interceptor classes used by this server." >
<c:simple-property name="remoting-interceptors" />
</c:list-property>
<c:simple-property name="run-sync-speed-test" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether on startup to perform a diagnostic test on how fast your disk can sync. Useful when determining performance issues. The default value is false."/>
@@ -6689,7 +6689,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="false" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="false" defaultValue="500" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 500."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="false" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined." >
+ <c:list-property name="static-connectors:nullable" required="false" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined." >
<c:simple-property name="static-connectors" />
</c:list-property>
<c:simple-property name="use-duplicate-detection" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether the bridge will automatically insert a duplicate id property into each message that it forwards. The default value is true."/>
@@ -6778,7 +6778,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="false" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="false" defaultValue="2000" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 2000."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="false" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined." >
+ <c:list-property name="static-connectors:nullable" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined." >
<c:simple-property name="static-connectors" />
</c:list-property>
<c:simple-property name="transformer-class-name" required="false" type="string" readOnly="false" description="The name of a user-defined class which implements the org.hornetq.core.server.cluster.Transformer interface."/>
@@ -9195,7 +9195,7 @@
<c:simple-property name="persist-delivery-count-before-delivery" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. The default value is false."/>
<c:simple-property name="persist-id-cache" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether IDs are persisted to the journal. The default value is true."/>
<c:simple-property name="persistence-enabled" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether the server will use the file based journal for persistence. The default value is true."/>
- <c:list-property name="remoting-interceptors" required="false" description="The list of interceptor classes used by this server.">
+ <c:list-property name="remoting-interceptors:nullable" required="false" description="The list of interceptor classes used by this server.">
<c:simple-property name="remoting-interceptors"/>
</c:list-property>
<c:simple-property name="run-sync-speed-test" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether on startup to perform a diagnostic test on how fast your disk can sync. Useful when determining performance issues. The default value is false."/>
@@ -11775,7 +11775,7 @@
<c:simple-property name="persist-delivery-count-before-delivery" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether the delivery count is persisted before delivery. False means that this only happens after a message has been cancelled. The default value is false."/>
<c:simple-property name="persist-id-cache" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether IDs are persisted to the journal. The default value is true."/>
<c:simple-property name="persistence-enabled" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether the server will use the file based journal for persistence. The default value is true."/>
- <c:list-property name="remoting-interceptors" required="false" description="The list of interceptor classes used by this server.">
+ <c:list-property name="remoting-interceptors:nullable" required="false" description="The list of interceptor classes used by this server.">
<c:simple-property name="remoting-interceptors"/>
</c:list-property>
<c:simple-property name="run-sync-speed-test" required="false" type="boolean" readOnly="false" defaultValue="false" description="Whether on startup to perform a diagnostic test on how fast your disk can sync. Useful when determining performance issues. The default value is false."/>
@@ -12742,7 +12742,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="false" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="false" defaultValue="500" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 500."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="false" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined.">
+ <c:list-property name="static-connectors:nullable" required="false" description="The statically defined list of connectors to which this cluster connection will make connections. Must be undefined (null) if 'discovery-group-name' is defined.">
<c:simple-property name="static-connectors"/>
</c:list-property>
<c:simple-property name="use-duplicate-detection" required="false" type="boolean" readOnly="false" defaultValue="true" description="Whether the bridge will automatically insert a duplicate id property into each message that it forwards. The default value is true."/>
@@ -12865,7 +12865,7 @@
<c:simple-property name="reconnect-attempts" required="false" type="integer" readOnly="false" defaultValue="-1" description="The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is -1."/>
<c:simple-property name="retry-interval" required="false" type="long" readOnly="false" defaultValue="2000" description="The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed. The default value is 2000."/>
<c:simple-property name="retry-interval-multiplier" required="false" type="double" readOnly="false" defaultValue="1.0" description="A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts. The default value is 1.0."/>
- <c:list-property name="static-connectors" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined.">
+ <c:list-property name="static-connectors:nullable" required="false" description="A list of names of statically defined connectors used by this bridge. Must be undefined (null) if 'discovery-group-name' is defined.">
<c:simple-property name="static-connectors"/>
</c:list-property>
<c:simple-property name="transformer-class-name" required="false" type="string" readOnly="false" description="The name of a user-defined class which implements the org.hornetq.core.server.cluster.Transformer interface."/>
11 years, 11 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
New commits:
commit 5a8b4196beed872022861c0d4110a652c0f5c013
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Jun 18 11:18:13 2012 -0400
[831152 - Repositories Delete Selected Repository button leads to exception page when no permission is given]
A private repo should be able to be deleted by its owner, even if the owner
does not have MANAGE_REPOSITORIES permission.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
index 4a7c2f2..72d7bee 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerBean.java
@@ -20,8 +20,6 @@ package org.rhq.enterprise.server.content;
import java.text.ParseException;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
@@ -78,10 +76,8 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
import org.rhq.enterprise.server.authz.RequiredPermission;
-import org.rhq.enterprise.server.plugin.pc.content.ContentProvider;
import org.rhq.enterprise.server.plugin.pc.content.ContentProviderManager;
import org.rhq.enterprise.server.plugin.pc.content.ContentServerPluginContainer;
-import org.rhq.enterprise.server.plugin.pc.content.PackageSource;
import org.rhq.enterprise.server.plugin.pc.content.PackageTypeBehavior;
import org.rhq.enterprise.server.plugin.pc.content.RepoDetails;
import org.rhq.enterprise.server.plugin.pc.content.RepoGroupDetails;
@@ -150,7 +146,7 @@ public class RepoManagerBean implements RepoManagerLocal, RepoManagerRemote {
}
// remove any unused, orphaned package versions
- contentSourceManager.purgeOrphanedPackageVersions(subject);
+ contentSourceManager.purgeOrphanedPackageVersions(subjectManager.getOverlord());
}
@RequiredPermission(Permission.MANAGE_REPOSITORIES)
11 years, 11 months
[rhq] modules/plugins
by snegrea
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 24 ++--------
1 file changed, 5 insertions(+), 19 deletions(-)
New commits:
commit c7dd1545b7a5264274a9f97289ee62c8dec76eee
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jun 18 10:16:29 2012 -0500
[BZ 833089] Remove more unneeded properties from Local Cache resource.
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 01f9c40..68d5a36 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -2003,29 +2003,22 @@
</plugin-configuration>
<resource-configuration>
- <c:simple-property name="start" required="false" type="string" readOnly="false" default="LAZY" description="The cache start mode, which can be EAGER (immediate start) or LAZY (on-demand start).">
+ <c:simple-property name="start" required="false" type="string" readOnly="true" default="LAZY" description="The cache start mode, which can be EAGER (immediate start) or LAZY (on-demand start).">
<c:property-options>
<c:option value="LAZY"/>
<c:option value="EAGER"/>
</c:property-options>
</c:simple-property>
- <c:simple-property name="batching" required="false" type="boolean" readOnly="false" default="false" description="If enabled, the invocation batching API will be made available for this cache."/>
- <c:simple-property name="indexing" required="false" type="string" readOnly="false" default="NONE" description="If enabled, entries will be indexed when they are added to the cache. Indexes will be updated as entries change or are removed.">
+ <c:simple-property name="batching" required="false" type="boolean" readOnly="true" default="false" description="If enabled, the invocation batching API will be made available for this cache."/>
+ <c:simple-property name="indexing" required="false" type="string" readOnly="true" default="NONE" description="If enabled, entries will be indexed when they are added to the cache. Indexes will be updated as entries change or are removed.">
<c:property-options>
<c:option value="NONE"/>
<c:option value="LOCAL"/>
<c:option value="ALL"/>
</c:property-options>
</c:simple-property>
- <c:simple-property name="jndi-name" required="false" type="string" readOnly="false" description="The jndi-name to which to bind this cache instance."/>
- <c:simple-property name="queue-size" required="false" type="integer" readOnly="false" default="0" description="In ASYNC mode, this attribute can be used to trigger flushing of the queue when it reaches a specific threshold."/>
- <c:simple-property name="queue-flush-interval" required="false" type="long" readOnly="false" default="10" description="In ASYNC mode, this attribute controls how often the asynchronous thread used to flush the replication queue runs. This should be a positive integer which represents thread wakeup time in milliseconds."/>
- <c:simple-property name="remote-timeout" required="false" type="long" readOnly="false" default="17500" description="In SYNC mode, the timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown."/>
- <c:simple-property name="async-marshalling" required="false" type="boolean" readOnly="false" defaultValue="false" description="If enabled, this will cause marshalling of entries to be performed asynchronously. The default value is false."/>
- <c:simple-property name="l1-lifespan" required="false" type="long" readOnly="false" defaultValue="600000" description="Maximum lifespan of an entry placed in the L1 cache. This element configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored. The default value is 600000."/>
- <c:simple-property name="module" required="false" type="string" readOnly="false" description="The module whose class loader should be used when building this cache's configuration."/>
- <c:simple-property name="owners" required="false" type="integer" readOnly="false" defaultValue="2" description="Number of cluster-wide replicas for each cache entry. The default value is 2."/>
- <c:simple-property name="virtual-nodes" required="false" type="integer" readOnly="false" defaultValue="1" description="Controls the number of virtual nodes per 'real' node. If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used. The default value is 1."/>
+ <c:simple-property name="jndi-name" required="false" type="string" readOnly="true" description="The jndi-name to which to bind this cache instance."/>
+ <c:simple-property name="module" required="false" type="string" readOnly="true" description="The module whose class loader should be used when building this cache's configuration."/>
</resource-configuration>
</service>
@@ -11263,14 +11256,7 @@
</c:property-options>
</c:simple-property>
<c:simple-property name="jndi-name" required="false" type="string" readOnly="false" description="The jndi-name to which to bind this cache instance."/>
- <c:simple-property name="queue-size" required="false" type="integer" readOnly="false" default="0" description="In ASYNC mode, this attribute can be used to trigger flushing of the queue when it reaches a specific threshold."/>
- <c:simple-property name="queue-flush-interval" required="false" type="long" readOnly="false" default="10" description="In ASYNC mode, this attribute controls how often the asynchronous thread used to flush the replication queue runs. This should be a positive integer which represents thread wakeup time in milliseconds."/>
- <c:simple-property name="remote-timeout" required="false" type="long" readOnly="false" default="17500" description="In SYNC mode, the timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown."/>
- <c:simple-property name="async-marshalling" required="false" type="boolean" readOnly="false" defaultValue="false" description="If enabled, this will cause marshalling of entries to be performed asynchronously. The default value is false."/>
- <c:simple-property name="l1-lifespan" required="false" type="long" readOnly="false" defaultValue="600000" description="Maximum lifespan of an entry placed in the L1 cache. This element configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored. The default value is 600000."/>
<c:simple-property name="module" required="false" type="string" readOnly="false" description="The module whose class loader should be used when building this cache's configuration."/>
- <c:simple-property name="owners" required="false" type="integer" readOnly="false" defaultValue="2" description="Number of cluster-wide replicas for each cache entry. The default value is 2."/>
- <c:simple-property name="virtual-nodes" required="false" type="integer" readOnly="false" defaultValue="1" description="Controls the number of virtual nodes per 'real' node. If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used. The default value is 1."/>
</resource-configuration>
</service>
11 years, 11 months
[rhq] modules/plugins
by snegrea
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 86 ++++++++--
1 file changed, 76 insertions(+), 10 deletions(-)
New commits:
commit b2f94df78ce141bed4167ed833547c37b8b89598
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jun 18 09:59:49 2012 -0500
[BZ 833089] Created a separate Local Cache resource descriptor with properties only applicable to this resource type.
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 4e3f4da..01f9c40 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -1939,7 +1939,7 @@
class="TemplatedComponent">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="distributed-cache|local-cache|invalidation-cache|replicated-cache"/>
+ <c:simple-property name="path" readOnly="true" default="distributed-cache|invalidation-cache|replicated-cache"/>
</plugin-configuration>
<resource-configuration>
@@ -1975,15 +1975,11 @@
<c:simple-property name="__type" displayName="Type of cache" required="true" readOnly="true" default="local-cache" description="Type of cache">
<c:property-options>
- <c:option value="local-cache"/>
<c:option value="invalidation-cache"/>
<c:option value="distributed-cache"/>
<c:option value="replicated-cache"/>
</c:property-options>
</c:simple-property>
- <c:template name="Local Cache" description="Local Cache">
- <c:simple-property name="__type" readOnly="true" default="local-cache"/>
- </c:template>
<c:template name="Invalidation Cache" description="Invalidation Cache">
<c:simple-property name="__type" readOnly="true" default="invalidation-cache"/>
</c:template>
@@ -1996,6 +1992,43 @@
</resource-configuration>
</service>
+ <service name="Local Cache (Managed Server)"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ createDeletePolicy="both"
+ creationDataType="configuration">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="local-cache"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="start" required="false" type="string" readOnly="false" default="LAZY" description="The cache start mode, which can be EAGER (immediate start) or LAZY (on-demand start).">
+ <c:property-options>
+ <c:option value="LAZY"/>
+ <c:option value="EAGER"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="batching" required="false" type="boolean" readOnly="false" default="false" description="If enabled, the invocation batching API will be made available for this cache."/>
+ <c:simple-property name="indexing" required="false" type="string" readOnly="false" default="NONE" description="If enabled, entries will be indexed when they are added to the cache. Indexes will be updated as entries change or are removed.">
+ <c:property-options>
+ <c:option value="NONE"/>
+ <c:option value="LOCAL"/>
+ <c:option value="ALL"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="jndi-name" required="false" type="string" readOnly="false" description="The jndi-name to which to bind this cache instance."/>
+ <c:simple-property name="queue-size" required="false" type="integer" readOnly="false" default="0" description="In ASYNC mode, this attribute can be used to trigger flushing of the queue when it reaches a specific threshold."/>
+ <c:simple-property name="queue-flush-interval" required="false" type="long" readOnly="false" default="10" description="In ASYNC mode, this attribute controls how often the asynchronous thread used to flush the replication queue runs. This should be a positive integer which represents thread wakeup time in milliseconds."/>
+ <c:simple-property name="remote-timeout" required="false" type="long" readOnly="false" default="17500" description="In SYNC mode, the timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown."/>
+ <c:simple-property name="async-marshalling" required="false" type="boolean" readOnly="false" defaultValue="false" description="If enabled, this will cause marshalling of entries to be performed asynchronously. The default value is false."/>
+ <c:simple-property name="l1-lifespan" required="false" type="long" readOnly="false" defaultValue="600000" description="Maximum lifespan of an entry placed in the L1 cache. This element configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored. The default value is 600000."/>
+ <c:simple-property name="module" required="false" type="string" readOnly="false" description="The module whose class loader should be used when building this cache's configuration."/>
+ <c:simple-property name="owners" required="false" type="integer" readOnly="false" defaultValue="2" description="Number of cluster-wide replicas for each cache entry. The default value is 2."/>
+ <c:simple-property name="virtual-nodes" required="false" type="integer" readOnly="false" defaultValue="1" description="Controls the number of virtual nodes per 'real' node. If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used. The default value is 1."/>
+ </resource-configuration>
+ </service>
+
<service name="Transport (Managed Server)"
discovery="SubsystemDiscovery"
class="BaseComponent"
@@ -11151,7 +11184,7 @@
creationDataType="configuration">
<plugin-configuration>
- <c:simple-property name="path" readOnly="true" default="distributed-cache|local-cache|invalidation-cache|replicated-cache"/>
+ <c:simple-property name="path" readOnly="true" default="distributed-cache|invalidation-cache|replicated-cache"/>
</plugin-configuration>
<resource-configuration>
@@ -11187,15 +11220,11 @@
<c:simple-property name="__type" displayName="Type of cache" required="true" readOnly="true" default="local-cache" description="Type of cache">
<c:property-options>
- <c:option value="local-cache"/>
<c:option value="invalidation-cache"/>
<c:option value="distributed-cache"/>
<c:option value="replicated-cache"/>
</c:property-options>
</c:simple-property>
- <c:template name="Local Cache" description="Local Cache">
- <c:simple-property name="__type" readOnly="true" default="local-cache"/>
- </c:template>
<c:template name="Invalidation Cache" description="Invalidation Cache">
<c:simple-property name="__type" readOnly="true" default="invalidation-cache"/>
</c:template>
@@ -11208,6 +11237,43 @@
</resource-configuration>
</service>
+ <service name="Local Cache"
+ discovery="SubsystemDiscovery"
+ class="BaseComponent"
+ createDeletePolicy="both"
+ creationDataType="configuration">
+
+ <plugin-configuration>
+ <c:simple-property name="path" readOnly="true" default="local-cache"/>
+ </plugin-configuration>
+
+ <resource-configuration>
+ <c:simple-property name="start" required="false" type="string" readOnly="false" default="LAZY" description="The cache start mode, which can be EAGER (immediate start) or LAZY (on-demand start).">
+ <c:property-options>
+ <c:option value="LAZY"/>
+ <c:option value="EAGER"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="batching" required="false" type="boolean" readOnly="false" default="false" description="If enabled, the invocation batching API will be made available for this cache."/>
+ <c:simple-property name="indexing" required="false" type="string" readOnly="false" default="NONE" description="If enabled, entries will be indexed when they are added to the cache. Indexes will be updated as entries change or are removed.">
+ <c:property-options>
+ <c:option value="NONE"/>
+ <c:option value="LOCAL"/>
+ <c:option value="ALL"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="jndi-name" required="false" type="string" readOnly="false" description="The jndi-name to which to bind this cache instance."/>
+ <c:simple-property name="queue-size" required="false" type="integer" readOnly="false" default="0" description="In ASYNC mode, this attribute can be used to trigger flushing of the queue when it reaches a specific threshold."/>
+ <c:simple-property name="queue-flush-interval" required="false" type="long" readOnly="false" default="10" description="In ASYNC mode, this attribute controls how often the asynchronous thread used to flush the replication queue runs. This should be a positive integer which represents thread wakeup time in milliseconds."/>
+ <c:simple-property name="remote-timeout" required="false" type="long" readOnly="false" default="17500" description="In SYNC mode, the timeout (in ms) used to wait for an acknowledgment when making a remote call, after which the call is aborted and an exception is thrown."/>
+ <c:simple-property name="async-marshalling" required="false" type="boolean" readOnly="false" defaultValue="false" description="If enabled, this will cause marshalling of entries to be performed asynchronously. The default value is false."/>
+ <c:simple-property name="l1-lifespan" required="false" type="long" readOnly="false" defaultValue="600000" description="Maximum lifespan of an entry placed in the L1 cache. This element configures the L1 cache behavior in 'distributed' caches instances. In any other cache modes, this element is ignored. The default value is 600000."/>
+ <c:simple-property name="module" required="false" type="string" readOnly="false" description="The module whose class loader should be used when building this cache's configuration."/>
+ <c:simple-property name="owners" required="false" type="integer" readOnly="false" defaultValue="2" description="Number of cluster-wide replicas for each cache entry. The default value is 2."/>
+ <c:simple-property name="virtual-nodes" required="false" type="integer" readOnly="false" defaultValue="1" description="Controls the number of virtual nodes per 'real' node. If numVirtualNodes is 1, then virtual nodes are disabled. The topology aware consistent hash must be used if you wish to take advantage of virtual nodes. A default of 1 is used. The default value is 1."/>
+ </resource-configuration>
+ </service>
+
<service name="Transport"
discovery="SubsystemDiscovery"
class="BaseComponent"
11 years, 11 months
[rhq] modules/core
by John Sanda
modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 7ac429112405857b728cacbc767ab71bdd809292
Author: John Sanda <jsanda(a)redhat.com>
Date: Mon Jun 18 09:44:17 2012 -0400
[BZ 786614] Add some error logging if we cannot find a resource container
We should not be in state where the method getAbsoluteBaseDirectory is
passed a resource id that does not have a corresponding resource
container in the local inventory. If that does happen, we will now log
an error message that includes the resource id and drift definition to
facilitate further debugging. Then an IllegalArgumentException is
thrown.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
index 0a4f5c3..0924288 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java
@@ -664,6 +664,15 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri
// get the resource entity stored in our local inventory
InventoryManager im = getInventoryManager();
ResourceContainer container = im.getResourceContainer(resourceId);
+
+ if (container == null) {
+ log.error("Cannot determine base directory for " + driftDefinition + ". No resource container found " +
+ "for resource id " + resourceId + ". You may want to restart the agent with the -u option so that " +
+ "the agent's local inventory is synchronized with and consistent with the server's inventory.");
+ throw new IllegalArgumentException("Cannot determine base directory for " + driftDefinition +
+ ". No resource container found for resource id " + resourceId);
+ }
+
Resource resource = container.getResource();
// find out the type of base location that is specified by the drift def
11 years, 11 months
[rhq] modules/core modules/plugins
by snegrea
modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java | 139 +++++++++-
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java | 106 +------
2 files changed, 155 insertions(+), 90 deletions(-)
New commits:
commit 5c2899d3522c7caa886c8355d88fc41a3076c4a8
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Mon Jun 18 08:40:35 2012 -0500
Updates for generic integration tests. Moved generic code to base classes and added more ignored resources due to open JIRAs and BZs.
diff --git a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
index 97f3f9a..e60349c 100644
--- a/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
+++ b/modules/core/plugin-test-util/src/main/java/org/rhq/core/plugin/testutil/AbstractAgentPluginTest.java
@@ -18,19 +18,29 @@
*/
package org.rhq.core.plugin.testutil;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.assertTrue;
+
import java.io.File;
import java.io.FilenameFilter;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Queue;
import java.util.Set;
import java.util.TreeSet;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.mockito.Mockito;
@@ -44,7 +54,9 @@ import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
import org.rhq.core.clientapi.agent.PluginContainerException;
+import org.rhq.core.clientapi.agent.configuration.ConfigurationUpdateRequest;
import org.rhq.core.clientapi.agent.configuration.ConfigurationUtility;
+import org.rhq.core.clientapi.server.configuration.ConfigurationUpdateResponse;
import org.rhq.core.clientapi.server.discovery.InventoryReport;
import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
@@ -63,6 +75,7 @@ import org.rhq.core.domain.util.MeasurementDefinitionFilter;
import org.rhq.core.domain.util.ResourceTypeUtility;
import org.rhq.core.pc.PluginContainer;
import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.configuration.ConfigurationManager;
import org.rhq.core.pc.inventory.ResourceContainer;
import org.rhq.core.pc.util.FacetLockType;
import org.rhq.core.pluginapi.availability.AvailabilityFacet;
@@ -79,11 +92,6 @@ import org.rhq.test.arquillian.FakeServerInventory;
import org.rhq.test.arquillian.MockingServerServices;
import org.rhq.test.shrinkwrap.RhqAgentPluginArchive;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
/**
* The base class for an Agent plugin integration test class.
*
@@ -91,6 +99,8 @@ import static org.testng.Assert.assertTrue;
*/
public abstract class AbstractAgentPluginTest extends Arquillian {
+ private Log log = LogFactory.getLog(this.getClass());
+
@ArquillianResource
protected MockingServerServices serverServices;
@@ -589,4 +599,123 @@ public abstract class AbstractAgentPluginTest extends Arquillian {
return serverInventory;
}
+ /**
+ * Test that loads a resource configuration and then immediately updates the resource
+ * with the exact same loaded settings.
+ *
+ * Notes:
+ * 1) load/update is not executed on the root resource provided.
+ * 2) if a resource is ignored then all of subresource of that resources are ignored
+ *
+ * @param rootResource root resource
+ * @param ignoredResources resources to be ignored
+ * @return number of errors
+ * @throws InterruptedException
+ * @throws PluginContainerException
+ */
+ protected int loadUpdateConfigChildResources(Resource rootResource, List<String> ignoredResources)
+ throws InterruptedException, PluginContainerException {
+
+ ignoredResources = (ignoredResources == null) ? new ArrayList<String>() : ignoredResources;
+
+ ConfigurationManager configManager = this.pluginContainer.getConfigurationManager();
+ configManager.initialize();
+ Thread.sleep(10 * 1000L);
+
+ Queue<Resource> unparsedResources = new LinkedList<Resource>();
+ addCommitedChildrenToCollection(unparsedResources, rootResource, ignoredResources);
+
+ int errorCount = 0;
+
+ while (!unparsedResources.isEmpty()) {
+ Resource resourceUnderTest = unparsedResources.poll();
+
+ addCommitedChildrenToCollection(unparsedResources, resourceUnderTest, ignoredResources);
+
+ if (resourceUnderTest.getResourceType().getResourceConfigurationDefinition() != null) {
+ Configuration configUnderTest = configManager.loadResourceConfiguration(resourceUnderTest.getId());
+
+ ConfigurationUpdateRequest updateRequest = new ConfigurationUpdateRequest(1, configUnderTest,
+ resourceUnderTest.getId());
+ ConfigurationUpdateResponse updateResponse = configManager
+ .executeUpdateResourceConfigurationImmediately(updateRequest);
+
+ if (updateResponse == null) {
+ errorCount++;
+ log.error("------------------------------");
+ log.error(resourceUnderTest);
+ log.error("Update Response is NULL!!!!");
+ log.error("------------------------------\n");
+ }
+ if (updateResponse.getErrorMessage() != null) {
+ errorCount++;
+ log.error("------------------------------");
+ log.error(resourceUnderTest);
+ log.error(updateResponse.getErrorMessage());
+ log.error("------------------------------\n");
+ }
+ }
+ }
+
+ return errorCount;
+ }
+
+ /**
+ * Test that executes all the no arg operations for all the subresources of a provided resource.
+ * Notes:
+ * 1) no operations are executed on the root resource provided.
+ * 2) if a resource is ignored then all of subresource of that resources are ignored
+ *
+ * @param rootResource root resource
+ * @param ignoredResources resources to be ignored
+ * @param ignoredOperations operations to be ignored
+ * @throws PluginContainerException
+ */
+ protected void executeNoArgOperations(Resource rootResource, List<String> ignoredResources,
+ List<String> ignoredOperations) throws PluginContainerException {
+
+ ignoredResources = (ignoredResources == null) ? new ArrayList<String>() : ignoredResources;
+ ignoredOperations = (ignoredOperations == null) ? new ArrayList<String>() : ignoredOperations;
+
+ Queue<Resource> unparsedResources = new LinkedList<Resource>();
+ addCommitedChildrenToCollection(unparsedResources, rootResource, ignoredResources);
+
+ while (!unparsedResources.isEmpty()) {
+ Resource resourceUnderTest = unparsedResources.poll();
+
+ addCommitedChildrenToCollection(unparsedResources, resourceUnderTest, ignoredResources);
+
+ for (OperationDefinition operationUnderTest : resourceUnderTest.getResourceType().getOperationDefinitions()) {
+ if (!ignoredOperations.contains(operationUnderTest.getName())) {
+ if (operationUnderTest.getParametersConfigurationDefinition() == null
+ || operationUnderTest.getParametersConfigurationDefinition().getPropertyDefinitions().isEmpty()) {
+ this.invokeOperationAndAssertSuccess(resourceUnderTest, operationUnderTest.getName(),
+ new Configuration());
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Adds direct subresources of resources to a collection.
+ *
+ * @param accumulatorCollection accumulator collection
+ * @param rootResource root resource
+ * @param ignoredResources resources to be ignored
+ */
+ private void addCommitedChildrenToCollection(Collection<Resource> accumulatorCollection, Resource rootResource,
+ List<String> ignoredResources) {
+ for (Resource childResource : rootResource.getChildResources()) {
+ if (childResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)) {
+ if( !ignoredResources.contains(childResource.getResourceType().getName())) {
+ accumulatorCollection.add(childResource);
+ }
+ } else {
+ log.info("Resource NOT COMMITTED --> not added to collection!! - " + childResource + " - "
+ + childResource.getInventoryStatus());
+ }
+ }
+ }
+
}
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index d11e7ab..f2d601c 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -24,22 +24,15 @@ import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
-import java.util.Queue;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.Assert;
import org.testng.annotations.Test;
-import org.rhq.core.clientapi.agent.configuration.ConfigurationUpdateRequest;
-import org.rhq.core.clientapi.server.configuration.ConfigurationUpdateResponse;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.pc.configuration.ConfigurationManager;
import org.rhq.core.pc.inventory.InventoryManager;
import org.rhq.core.pc.inventory.ResourceContainer;
import org.rhq.modules.plugins.jbossas7.itest.AbstractJBossAS7PluginTest;
@@ -69,7 +62,7 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
StandaloneServerComponentTest.RESOURCE_KEY);
inventoryManager.activateResource(server, platformContainer, false);
- Thread.sleep(20 * 1000L);
+ Thread.sleep(40 * 1000L);
}
@@ -81,103 +74,46 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
//works well with real agent
ignoredResources.add("VHost");
- //ignored because the settings different when started with arquillian, inet-address is not set correctly
- //works well with real agent
+ //created JIRA AS7-5011
+ //server is started with the configuration but unable to write it back as is
+ //due to marshaling error
ignoredResources.add("Network Interface");
+ //created JIRA AS7-5012
+ //default value for is float but the resource only accepts integers
+ ignoredResources.add("Load Metric");
+
+ //will revisit after BZ 826542 is resolved
+ ignoredResources.add("Authentication (Classic)");
+
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
- ConfigurationManager configurationManager = this.pluginContainer.getConfigurationManager();
- configurationManager.initialize();
- Thread.sleep(40 * 1000L);
-
- Queue<Resource> unparsedResources = new LinkedList<Resource>();
- for (Resource topLevelResource : server.getChildResources()) {
- if (topLevelResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)) {
- unparsedResources.add(topLevelResource);
- } else {
- log.info("Subsystem not COMMITTED " + topLevelResource + " - " + topLevelResource.getInventoryStatus());
- }
- }
-
- int errorCount = 0;
-
- while (!unparsedResources.isEmpty()) {
- Resource resourceUnderTest = unparsedResources.poll();
-
- for (Resource childResource : resourceUnderTest.getChildResources()) {
- if (childResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)) {
- unparsedResources.add(childResource);
- } else {
- log.info("Subsystem not COMMITTED " + childResource + " - " + childResource.getInventoryStatus());
- }
- }
-
- if (resourceUnderTest.getResourceType().getResourceConfigurationDefinition() != null
- && !ignoredResources.contains(resourceUnderTest.getResourceType().getName())) {
- Configuration configUnderTest = configurationManager
- .loadResourceConfiguration(resourceUnderTest.getId());
-
- ConfigurationUpdateRequest updateRequest = new ConfigurationUpdateRequest(1, configUnderTest,
- resourceUnderTest.getId());
- ConfigurationUpdateResponse updateResponse = configurationManager
- .executeUpdateResourceConfigurationImmediately(updateRequest);
-
- Assert.assertNotNull(updateResponse);
- if (updateResponse.getErrorMessage() != null) {
- errorCount++;
- log.error("------------------------------");
- log.error(resourceUnderTest);
- log.error(updateResponse.getErrorMessage());
- log.error("------------------------------");
- }
- }
- }
-
+ int errorCount = loadUpdateConfigChildResources(server, ignoredResources);
Assert.assertEquals(errorCount, 0);
}
@Test(priority = 11)
- public void executeNoArgOperations() throws Exception {
+ public void standaloneExecuteNoArgOperations() throws Exception {
List<String> ignoredSubsystems = new ArrayList<String>();
+
+ //ignored because mod_cluster is not setup in default server configuration
+ //to be more specific, there is no server to fail-over to
ignoredSubsystems.add("ModCluster Standalone Service");
List<String> ignoredOperations = new ArrayList<String>();
+ //ignored because there is no other server to fail-over to
ignoredOperations.add("subsystem:force-failover");
+ //ignored because this is not a true operation, it is handled
+ //internally by a configuration property change
ignoredOperations.add("enable");
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
- Queue<Resource> unparsedResources = new LinkedList<Resource>();
- for (Resource topLevelResource : server.getChildResources()) {
- if (topLevelResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)
- && !ignoredSubsystems.contains(topLevelResource.getResourceType().getName())) {
- unparsedResources.add(topLevelResource);
- }
- }
-
- while (!unparsedResources.isEmpty()) {
- Resource resourceUnderTest = unparsedResources.poll();
-
- for (Resource childResource : resourceUnderTest.getChildResources()) {
- if (childResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)) {
- unparsedResources.add(childResource);
- }
- }
-
- for (OperationDefinition operationUnderTest : resourceUnderTest.getResourceType().getOperationDefinitions()) {
- if (!ignoredOperations.contains(operationUnderTest.getName())) {
- if (operationUnderTest.getParametersConfigurationDefinition() == null
- || operationUnderTest.getParametersConfigurationDefinition().getPropertyDefinitions().isEmpty()) {
- this.invokeOperationAndAssertSuccess(resourceUnderTest, operationUnderTest.getName(),
- new Configuration());
- }
- }
- }
- }
+ executeNoArgOperations(server, ignoredSubsystems, ignoredOperations);
}
+
}
11 years, 11 months
[rhq] modules/enterprise
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java | 49 +++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationDefinitionRest.java | 15 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationRest.java | 10 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/SimplePropDef.java | 72 ++++++++++
4 files changed, 131 insertions(+), 15 deletions(-)
New commits:
commit 9c27510ac57d09e8283841810f4a889a33760e5f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Mon Jun 18 15:21:00 2012 +0200
Improvements in operation scheduling.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
index 8b827b8..73a4ebb 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/OperationsHandlerBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -30,7 +30,6 @@ import javax.interceptor.Interceptors;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
@@ -41,6 +40,7 @@ import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria;
import org.rhq.core.domain.operation.HistoryJobId;
import org.rhq.core.domain.operation.JobId;
@@ -55,6 +55,7 @@ import org.rhq.enterprise.server.rest.domain.Link;
import org.rhq.enterprise.server.rest.domain.OperationDefinitionRest;
import org.rhq.enterprise.server.rest.domain.OperationHistoryRest;
import org.rhq.enterprise.server.rest.domain.OperationRest;
+import org.rhq.enterprise.server.rest.domain.SimplePropDef;
/**
* Deal with operations
@@ -96,6 +97,8 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
odr.setId(def.getId());
odr.setName(def.getName());
+ copyParamsForDefinition(def, odr);
+
builder=Response.ok(odr);
// Add some links
@@ -115,6 +118,26 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
+ private void copyParamsForDefinition(OperationDefinition def, OperationDefinitionRest odr) {
+ ConfigurationDefinition cd = def.getParametersConfigurationDefinition();
+ if (cd==null)
+ return;
+
+ for (Map.Entry<String,PropertyDefinition> entry : cd.getPropertyDefinitions().entrySet()) {
+ PropertyDefinition pd = entry.getValue();
+ if (pd instanceof PropertyDefinitionSimple) {
+ PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
+ SimplePropDef prop = new SimplePropDef();
+ prop.setName(pds.getName());
+ prop.setRequired(pds.isRequired());
+ prop.setType(pds.getType());
+ prop.setDefaultValue(pds.getDefaultValue());
+ odr.addParam(prop);
+ }
+ log.debug("copyParams: " + pd.getName() + " not yet supported");
+ }
+ }
+
@Override
public Response getOperationDefinitions(Integer resourceId, UriInfo uriInfo, Request request) {
@@ -139,6 +162,9 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
OperationDefinitionRest odr = new OperationDefinitionRest();
odr.setId(def.getId());
odr.setName(def.getName());
+
+ copyParamsForDefinition(def,odr);
+
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/operation/definition/{id}");
uriBuilder.queryParam("resourceId",resourceId);
@@ -174,7 +200,7 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
}
OperationRest operationRest = new OperationRest(resourceId,definitionId);
operationRest.setId((int)System.currentTimeMillis()); // TODO better id (?)(we need one for pUT later on)
- operationRest.setState("creating");
+ operationRest.setReadyToSubmit(false);
operationRest.setName(opDef.getName());
ConfigurationDefinition paramDefinition = opDef.getParametersConfigurationDefinition();
if (paramDefinition != null) {
@@ -208,11 +234,11 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
@Override
public Response updateOperation(int operationId, OperationRest operation, UriInfo uriInfo) {
- if (operation.getState().equals("creating") && operation.getDefinitionId()>0 && !operation.getName().isEmpty()) {
+ if (!operation.isReadyToSubmit() && operation.getDefinitionId()>0 && !operation.getName().isEmpty()) {
// TODO check all the required parameters for presence before allowing to submit
- operation.setState("ready");
+ operation.setReadyToSubmit(true);
}
- if (operation.getState().equals("ready")) {
+ if (operation.isReadyToSubmit()) {
// todo check params
// submit
@@ -222,7 +248,7 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
parameters.put(new PropertySimple(entry.getKey(),entry.getValue())); // TODO honor more types
}
ResourceOperationSchedule sched = opsManager.scheduleResourceOperation(caller,operation.getResourceId(),operation.getName(),0,0,0,-1,
- parameters,"TEst");
+ parameters,"Test");
JobId jobId = new JobId(sched.getJobName(),sched.getJobGroup());
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/operation/history/{id}");
@@ -271,7 +297,7 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
history = list.get(0);
String status;
if (history.getStatus()==null)
- status = " - no infomation yet -";
+ status = " - no information yet -";
else
status = history.getStatus().getDisplayName();
@@ -282,7 +308,12 @@ public class OperationsHandlerBean extends AbstractRestBean implements Operation
if (history.getResults()!=null) {
Configuration results = history.getResults();
for (Property p : results.getProperties()) {
- hist.getResult().put(p.getName(),p.toString());
+ String val;
+ if (p instanceof PropertySimple)
+ val = ((PropertySimple)p).getStringValue();
+ else
+ val = p.toString();
+ hist.getResult().put(p.getName(),val);
}
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationDefinitionRest.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationDefinitionRest.java
index 70f1a97..06cbbcf 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationDefinitionRest.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationDefinitionRest.java
@@ -1,7 +1,9 @@
package org.rhq.enterprise.server.rest.domain;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
@@ -18,7 +20,7 @@ public class OperationDefinitionRest {
String name;
int id;
List<Link> links = new ArrayList<Link>();
- // TODO add parameters
+ List<SimplePropDef> params = new ArrayList<SimplePropDef>();
public String getName() {
return name;
@@ -49,4 +51,15 @@ public class OperationDefinitionRest {
links.add(link);
}
+ public List<SimplePropDef> getParams() {
+ return params;
+ }
+
+ public void setParams(List<SimplePropDef> params) {
+ this.params = params;
+ }
+
+ public void addParam(SimplePropDef prop) {
+ params.add(prop);
+ }
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationRest.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationRest.java
index 50332ae..31f51dc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationRest.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/OperationRest.java
@@ -16,7 +16,7 @@ public class OperationRest {
int id;
String name;
- String state; // TODO Convert to enum
+ boolean readyToSubmit;
int resourceId;
int definitionId;
Map<String,Object> params = new HashMap<String, Object>();
@@ -46,12 +46,12 @@ public class OperationRest {
this.name = name;
}
- public String getState() {
- return state;
+ public boolean isReadyToSubmit() {
+ return readyToSubmit;
}
- public void setState(String state) {
- this.state = state;
+ public void setReadyToSubmit(boolean readyToSubmit) {
+ this.readyToSubmit = readyToSubmit;
}
public int getResourceId() {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/SimplePropDef.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/SimplePropDef.java
new file mode 100644
index 0000000..08527fd
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/SimplePropDef.java
@@ -0,0 +1,72 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 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.rest.domain;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.rhq.core.domain.configuration.definition.PropertySimpleType;
+
+/**
+ * Simple property definition
+ * @author Heiko W. Rupp
+ */
+@XmlRootElement
+public class SimplePropDef {
+
+ String name;
+ boolean required;
+ PropertySimpleType type;
+ String defaultValue;
+
+ public SimplePropDef() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isRequired() {
+ return required;
+ }
+
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ public PropertySimpleType getType() {
+ return type;
+ }
+
+ public void setType(PropertySimpleType type) {
+ this.type = type;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+}
11 years, 11 months