return repoMD;
}
private static IdentityStoreConfigurationMetaData createIdentityStoreConfigurationMetaData(IdentityStoreType identityStoreType)
{
IdentityStoreConfigurationMetaDataImpl storeMD = new IdentityStoreConfigurationMetaDataImpl();
storeMD.setId(identityStoreType.getId());
storeMD.setClassName(identityStoreType.getClazz());
if (identityStoreType.getExternalConfig() != null)
{
storeMD.setExternalConfig(identityStoreType.getExternalConfig().getValue());
}
storeMD.setSupportedRelationshipTypes(identityStoreType.getSupportedRelationshipTypes().getRelationshipType());
if (identityStoreType.getSupportedIdentityObjectTypes() != null &&
identityStoreType.getSupportedIdentityObjectTypes().getIdentityObjectType() != null)
{
for (IdentityObjectTypeType identityObjectTypeType : identityStoreType.getSupportedIdentityObjectTypes().getIdentityObjectType())
{
IdentityObjectTypeMetaDataImpl identityObjectTypeMD = new IdentityObjectTypeMetaDataImpl();
identityObjectTypeMD.setName(identityObjectTypeType.getName());
// Attributes
List<IdentityObjectAttributeMetaData> attributes = new LinkedList<IdentityObjectAttributeMetaData>();
if (identityObjectTypeType.getAttributes() != null &&
identityObjectTypeType.getAttributes().getAttribute() != null)
{
for (AttributeType attributeType : identityObjectTypeType.getAttributes().getAttribute())
{
String readOnly = attributeType.getIsReadOnly();
String multivalued = attributeType.getIsMultivalued();
String required = attributeType.getIsRequired();
String unique = attributeType.getIsUnique();
IdentityObjectAttributeMetaDataImpl attributeMD = new IdentityObjectAttributeMetaDataImpl(
attributeType.getName(),
attributeType.getMapping(),
attributeType.getType(),
(readOnly != null && readOnly.equalsIgnoreCase("true")),
(multivalued != null && multivalued.equalsIgnoreCase("true")),
(required != null && required.equalsIgnoreCase("true")),
(unique != null && unique.equalsIgnoreCase("true"))
);
attributes.add(attributeMD);
}
}
identityObjectTypeMD.setAttributes(attributes);
// Credentials
List<String> credentials = new LinkedList<String>();
if (identityObjectTypeType.getCredentials() != null &&
identityObjectTypeType.getCredentials().getCredentialType() != null)
{
for (String credentialType : identityObjectTypeType.getCredentials().getCredentialType())
{
credentials.add(credentialType);
}
}
identityObjectTypeMD.setCredentials(credentials);
// Relationships
List<RelationshipMetaData> relationships = new LinkedList<RelationshipMetaData>();
if (identityObjectTypeType.getRelationships() != null &&
identityObjectTypeType.getRelationships().getRelationship() != null)
{
for (RelationshipType relationshipType : identityObjectTypeType.getRelationships().getRelationship())
{
RelationshipMetaDataImpl relMD = new RelationshipMetaDataImpl();
relMD.setIdentityObjectTypeRef(relationshipType.getIdentityObjectTypeRef());
relMD.setRelationshipTypeRef(relationshipType.getRelationshipTypeRef());
relationships.add(relMD);
}
}
identityObjectTypeMD.setRelationships(relationships);
// Options
Map<String, List<String>> options = new HashMap<String, List<String>>();
if (identityObjectTypeType.getOptions() != null &&
identityObjectTypeType.getOptions().getOption() != null)
{
for (OptionType optionType : identityObjectTypeType.getOptions().getOption())
{
options.put(optionType.getName(), optionType.getValue());
}
}
identityObjectTypeMD.setOptions(options);
storeMD.getSupportedIdentityTypes().add(identityObjectTypeMD);
}
}
Map<String, List<String>> options = new HashMap<String, List<String>>();
if (identityStoreType.getOptions() != null &&
identityStoreType.getOptions().getOption() != null)
{
for (OptionType optionType : identityStoreType.getOptions().getOption())
{
options.put(optionType.getName(), optionType.getValue());
}
}
storeMD.setOptions(options);
return storeMD;
}