.getValue();
MetaValue[] metaValues = valueSupport.getElements();
for (MetaValue value : metaValues) {
GenericValueSupport genValueSupport = (GenericValueSupport) value;
ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
.getValue();
String dataRoleName = ProfileServiceUtil.getSimpleValue(
managedObject, "name", String.class);
Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
managedObject, "anyAuthenticated", Boolean.class);
String description = ProfileServiceUtil.getSimpleValue(
managedObject, "description", String.class);
/**
*
* A discovered resource must have a unique key, that must stay
* the same when the resource is discovered the next time
*/
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
discoveryContext.getResourceType(), // ResourceType
dataRoleName, // Resource Key
dataRoleName, // Resource Name
null, // Version
PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
discoveryContext.getDefaultPluginConfiguration(), // Plugin
// Config
null // Process info from a process scan
);
Configuration configuration = detail.getPluginConfiguration();
configuration.put(new PropertySimple("name", dataRoleName));
configuration.put(new PropertySimple("anyAuthenticated",
anyAuthenticated));
configuration
.put(new PropertySimple("description", description));
PropertyList mappedRoleNameList = new PropertyList(
"mappedRoleNameList");
configuration.put(mappedRoleNameList);
ManagedProperty mappedRoleNames = managedObject
.getProperty("mappedRoleNames");
if (mappedRoleNames != null) {
CollectionValueSupport props = (CollectionValueSupport)mappedRoleNames.getValue();
for (MetaValue mappedRoleName : props.getElements()) {
mappedRoleNameList.add(new PropertySimple("name", ProfileServiceUtil.stringValue(mappedRoleName)));