ManagedProperty property = mcVdb.getProperty("models");
CollectionValueSupport valueSupport = (CollectionValueSupport) property
.getValue();
MetaValue[] metaValues = valueSupport.getElements();
PropertyList sourceModelsList = new PropertyList("singleSourceModels");
configuration.put(sourceModelsList);
PropertyList multiSourceModelsList = new PropertyList(
"multiSourceModels");
configuration.put(multiSourceModelsList);
PropertyList logicalModelsList = new PropertyList("logicalModels");
configuration.put(logicalModelsList);
PropertyList errorList = new PropertyList("errorList");
configuration.put(errorList);
for (MetaValue value : metaValues) {
GenericValueSupport genValueSupport = (GenericValueSupport) value;
ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
.getValue();
Boolean isSource = Boolean.TRUE;
try {
isSource = ProfileServiceUtil.booleanValue(managedObject
.getProperty("source").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
Boolean supportMultiSource = Boolean.TRUE;
try {
supportMultiSource = ProfileServiceUtil
.booleanValue(managedObject.getProperty(
"supportsMultiSourceBindings").getValue());
} catch (Exception e) {
LOG.error(e.getMessage());
}
String modelName = managedObject.getName();
ManagedProperty connectorBinding = managedObject
.getProperty("sourceMappings");
Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();
getSourceMappingValue(connectorBinding.getValue(), sourceList);
String visibility = ((SimpleValueSupport) managedObject
.getProperty("visible").getValue()).getValue().toString();
String type = ((EnumValueSupport) managedObject.getProperty(
"modelType").getValue()).getValue().toString();
// Get any model errors/warnings
MetaValue errors = managedObject.getProperty("errors").getValue();
if (errors != null) {
CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
MetaValue[] errorArray = errorValueSupport.getElements();
for (MetaValue error : errorArray) {
GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;
ManagedObject errorMo = (ManagedObject) errorGenValueSupport
.getValue();
String severity = ((SimpleValue) errorMo.getProperty(
"severity").getValue()).getValue().toString();
String message = ((SimpleValue) errorMo
.getProperty("value").getValue()).getValue()
.toString();
PropertyMap errorMap = new PropertyMap("errorMap",
new PropertySimple("severity", severity),
new PropertySimple("message", message));
errorList.add(errorMap);
}
}
for (Map<String, String> sourceMap : sourceList) {