*/
private Resource getModuleOptionTypeResource(String optionAttributeType) {
Resource moduleOptionResource = null;
String securityDomainId = SECURITY_DOMAIN_RESOURCE_KEY + "=" + TEST_DOMAIN + "2";
if (testSecurityDomain == null) {
InventoryManager im = pluginContainer.getInventoryManager();
Resource platform = im.getPlatform();
if (platform != null)
System.out.println("*** Found Platform [" + platform.getResourceKey() + "]");
//host controller
Resource hostController = waitForResourceByTypeAndKey(platform, platform, DOMAIN_RESOURCE_TYPE,
DOMAIN_RESOURCE_KEY);
if (hostController != null)
System.out.println("*** Found Host Controller [" + hostController.getResourceKey() + "]");
//profile=full-ha
ResourceType profileType = new ResourceType("Profile", PLUGIN_NAME, ResourceCategory.SERVICE, null);
String key = PROFILE;
Resource profile = waitForResourceByTypeAndKey(platform, hostController, profileType, key);
if (profile != null)
System.out.println("*** Found Profile [" + platform.getResourceKey() + "]");
//Security (Profile)
ResourceType securityType = new ResourceType("Security (Profile)", PLUGIN_NAME, ResourceCategory.SERVICE,
null);
key += "," + SECURITY_RESOURCE_KEY;
Resource security = waitForResourceByTypeAndKey(platform, profile, securityType, key);
if (security != null)
System.out.println("*** Found Security [" + security.getResourceKey() + "]");
//Security Domain (Profile)
ResourceType domainType = new ResourceType("Security Domain (Profile)", PLUGIN_NAME,
ResourceCategory.SERVICE, null);
key += "," + securityDomainId;
testSecurityDomainKey = key;
testSecurityDomain = waitForResourceByTypeAndKey(platform, security, domainType, key);
if (testSecurityDomain != null)
System.out.println("*** Found Domain [" + testSecurityDomain.getResourceKey() + "]");
}
//acl=classic
String descriptorName = "";
String moduleAttribute = "";
//acl
if (optionAttributeType.equals(ModuleOptionType.Acl.getAttribute())) {
descriptorName = "ACL (Profile)";
moduleAttribute = "acl=classic";
} else if (optionAttributeType.equals(ModuleOptionType.Audit.getAttribute())) {
descriptorName = "Audit (Profile)";
moduleAttribute = "audit=classic";
} else if (optionAttributeType.equals(ModuleOptionType.Authentication.getAttribute())) {
descriptorName = "Authentication (Classic - Profile)";
moduleAttribute = "authentication=classic";
} else if (optionAttributeType.equals(ModuleOptionType.Authorization.getAttribute())) {
descriptorName = "Authorization (Profile)";
moduleAttribute = "authorization=classic";
} else if (optionAttributeType.equals(ModuleOptionType.IdentityTrust.getAttribute())) {
descriptorName = "Identity Trust (Profile)";
moduleAttribute = "identity-trust=classic";
} else if (optionAttributeType.equals(ModuleOptionType.Mapping.getAttribute())) {
descriptorName = "Mapping (Profile)";
moduleAttribute = "mapping=classic";
}
//Build the right Module Option Type. Ex. ACL (Profile), etc.
ResourceType moduleOptionType = new ResourceType(descriptorName, PLUGIN_NAME, ResourceCategory.SERVICE, null);
ConfigurationDefinition cdef = new ConfigurationDefinition(descriptorName, null);
moduleOptionType.setResourceConfigurationDefinition(cdef);
//Ex. profile=full-ha,subsystem=security,security-domain=testDomain2,identity-trust=classic
String moduleOptionTypeKey = testSecurityDomainKey += "," + moduleAttribute;
if (!testSecurityDomainKey.endsWith(securityDomainId)) {
moduleOptionTypeKey = testSecurityDomainKey.substring(0, testSecurityDomainKey.indexOf(securityDomainId)
+ securityDomainId.length())
+ "," + moduleAttribute;
}
InventoryManager im = pluginContainer.getInventoryManager();
Resource platform = im.getPlatform();
moduleOptionResource = waitForResourceByTypeAndKey(platform, testSecurityDomain, moduleOptionType,
moduleOptionTypeKey);
if (moduleOptionResource != null)
System.out.println("*** Found ModuleOption [" + moduleOptionResource.getResourceKey() + "]");