org.rhq.modules.plugins.jbossas7
Class ModuleOptionsComponent

java.lang.Object
  extended by org.rhq.modules.plugins.jbossas7.BaseComponent
      extended by org.rhq.modules.plugins.jbossas7.ModuleOptionsComponent
All Implemented Interfaces:
AvailabilityFacet, ConfigurationFacet, CreateChildResourceFacet, DeleteResourceFacet, ResourceComponent, MeasurementFacet, OperationFacet, AS7Component

public class ModuleOptionsComponent
extends BaseComponent
implements ConfigurationFacet, DeleteResourceFacet, CreateChildResourceFacet

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

Nested Class Summary
static class ModuleOptionsComponent.ModuleOptionType
           
static class ModuleOptionsComponent.Value
           
 
Field Summary
static HashMap<String,String> attributeMap
           
static HashMap<String,String> newChildTypeMap
           
 
Fields inherited from class org.rhq.modules.plugins.jbossas7.BaseComponent
MANAGED_SERVER, testConnection
 
Constructor Summary
ModuleOptionsComponent()
           
 
Method Summary
static Operation createAddModuleOptionTypeOperation(Address address, String attribute, List<ModuleOptionsComponent.Value> moduleTypeValue)
          Handles the creation of
 CreateResourceReport createResource(CreateResourceReport report)
           
static ModuleOptionsComponent.ModuleOptionType loadModuleOptionType(String attribute)
          Locates the write ModuleOptionType mapped to the AS7Node attribute passed in.
 org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
           
static List<ModuleOptionsComponent.Value> populateSecurityDomainModuleOptions(Result result, ModuleOptionsComponent.ModuleOptionType type)
          Takes the result passed in(successful readAttribute for ModuleOptionType) and parses the json to populate a json object of type List with the results.
 void updateResourceConfiguration(ConfigurationUpdateReport report)
           
 
Methods inherited from class org.rhq.modules.plugins.jbossas7.BaseComponent
collectMulticastAddressTrait, deleteResource, deployContent, getAddress, getASConnection, getAvailability, getPath, getResourceDescription, getServerAddress, getServerComponent, getSocketBindingGroup, getStringValue, getValues, invokeOperation, readAttribute, readAttribute, readAttribute, runDeploymentMagicOnServer, setConnection, setPath, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rhq.core.pluginapi.inventory.DeleteResourceFacet
deleteResource
 

Field Detail

attributeMap

public static HashMap<String,String> attributeMap

newChildTypeMap

public static HashMap<String,String> newChildTypeMap
Constructor Detail

ModuleOptionsComponent

public ModuleOptionsComponent()
Method Detail

createResource

public CreateResourceReport createResource(CreateResourceReport report)
Specified by:
createResource in interface CreateChildResourceFacet
Overrides:
createResource in class BaseComponent

loadResourceConfiguration

public org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
                                                                          throws Exception
Specified by:
loadResourceConfiguration in interface ConfigurationFacet
Overrides:
loadResourceConfiguration in class BaseComponent
Throws:
Exception

updateResourceConfiguration

public void updateResourceConfiguration(ConfigurationUpdateReport report)
Specified by:
updateResourceConfiguration in interface ConfigurationFacet
Overrides:
updateResourceConfiguration in class BaseComponent

loadModuleOptionType

public static ModuleOptionsComponent.ModuleOptionType loadModuleOptionType(String attribute)
Locates the write ModuleOptionType mapped to the AS7Node attribute passed in. Ex. 'login-modules' -> Authentication (Classic * type. One of three types.

Parameters:
attribute -
Returns:

populateSecurityDomainModuleOptions

public static List<ModuleOptionsComponent.Value> populateSecurityDomainModuleOptions(Result result,
                                                                                     ModuleOptionsComponent.ModuleOptionType type)
Takes the result passed in(successful readAttribute for ModuleOptionType) and parses the json to populate a json object of type List with the results. Handles inconsistencies in model representation for login-modules vs. the other supported ModuleOptionTypes.

Parameters:
result - json.Result type from successful read of attribute.
type - ModuleOptionType
Returns:
List type populated with moduleOption details.

createAddModuleOptionTypeOperation

public static Operation createAddModuleOptionTypeOperation(Address address,
                                                           String attribute,
                                                           List<ModuleOptionsComponent.Value> moduleTypeValue)
Handles the creation of

Parameters:
address -
attribute -
moduleTypeValue -
Returns:


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.