List<ManagedObject> models = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(property.getValue());
for(ManagedObject managedModel:models) {
String modelName = ManagedUtil.getSimpleValue(managedModel, "name", String.class); //$NON-NLS-1$
ModelMetaData model = vdb.getModel(modelName);
ManagedProperty sourceMappings = managedModel.getProperty("sourceMappings");//$NON-NLS-1$
if (sourceMappings != null){
List<ManagedObject> mappings = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(sourceMappings.getValue());
for (ManagedObject mo:mappings) {
String name = ManagedUtil.getSimpleValue(mo, "name", String.class);//$NON-NLS-1$
String jndiName = ManagedUtil.getSimpleValue(mo, "connectionJndiName", String.class);//$NON-NLS-1$
String translatorName = ManagedUtil.getSimpleValue(mo, "translatorName", String.class);//$NON-NLS-1$
model.addSourceMapping(name, translatorName, jndiName);
}
}
}
}
else if (property.getName().equals("JAXBProperties")) { //$NON-NLS-1$
List<ManagedObject> properties = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(property.getValue());
for (ManagedObject managedProperty:properties) {
vdb.addProperty(ManagedUtil.getSimpleValue(managedProperty, "name", String.class), ManagedUtil.getSimpleValue(managedProperty, "value", String.class)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
else if (property.getName().equals("dataPolicies")) { //$NON-NLS-1$
List<ManagedObject> policies = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(property.getValue());
for(ManagedObject managedPolicy:policies) {
String policyName = ManagedUtil.getSimpleValue(managedPolicy, "name", String.class); //$NON-NLS-1$
Boolean anyAuthenticated = ManagedUtil.getSimpleValue(managedPolicy, "anyAuthenticated", Boolean.class); //$NON-NLS-1$
DataPolicyMetadata policy = vdb.getDataPolicy(policyName);
policy.setAnyAuthenticated(Boolean.TRUE.equals(anyAuthenticated));
ManagedProperty mappedRoleNames = managedPolicy.getProperty("mappedRoleNames");//$NON-NLS-1$
if (mappedRoleNames != null){
List<String> roleNames = (List<String>)MetaValueFactory.getInstance().unwrap(mappedRoleNames.getValue());
policy.setMappedRoleNames(roleNames);
}
}
}
else if (property.getName().equals("overrideTranslators")) { //$NON-NLS-1$
List<ManagedObject> translators = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(property.getValue());
for (ManagedObject translator:translators) {
VDBTranslatorMetaData translatorInstance = vdb.getTranslator(translator.getName());
ManagedProperty mp = translator.getProperty("property"); //$NON-NLS-1$
List<PropertyMetadata> properties = (List<PropertyMetadata>)MetaValueFactory.getInstance().unwrap(mp.getValue());
for (PropertyMetadata managedProperty:properties) {
translatorInstance.addProperty(managedProperty.getName(), managedProperty.getValue());
}
}
}