Search in sources :

Example 1 with PropertyType

use of org.teiid.translator.TranslatorProperty.PropertyType in project teiid by teiid.

the class EmbeddedAdminImpl method getTranslatorPropertyDefinitions.

@Override
public Collection<? extends PropertyDefinition> getTranslatorPropertyDefinitions(String translatorName, TranlatorPropertyType type) throws AdminException {
    List<PropertyDefinition> list = new ArrayList<PropertyDefinition>();
    VDBTranslatorMetaData translator = this.embeddedServer.getTranslatorRepository().getTranslatorMetaData(translatorName);
    TranlatorPropertyType translatorPropertyType = TranlatorPropertyType.valueOf(type.toString().toUpperCase());
    if (translator != null) {
        ExtendedPropertyMetadataList properties = translator.getAttachment(ExtendedPropertyMetadataList.class);
        if (translatorPropertyType.equals(TranlatorPropertyType.ALL)) {
            for (ExtendedPropertyMetadata epm : properties) {
                list.add(buildNode(epm));
            }
        } else {
            PropertyType propType = PropertyType.valueOf(type.toString().toUpperCase());
            for (ExtendedPropertyMetadata epm : properties) {
                if (PropertyType.valueOf(epm.category()).equals(propType)) {
                    list.add(buildNode(epm));
                }
            }
        }
    }
    return list;
}
Also used : ExtendedPropertyMetadataList(org.teiid.deployers.ExtendedPropertyMetadataList) ExtendedPropertyMetadata(org.teiid.deployers.ExtendedPropertyMetadata) PropertyType(org.teiid.translator.TranslatorProperty.PropertyType) VDBTranslatorMetaData(org.teiid.adminapi.impl.VDBTranslatorMetaData)

Aggregations

VDBTranslatorMetaData (org.teiid.adminapi.impl.VDBTranslatorMetaData)1 ExtendedPropertyMetadata (org.teiid.deployers.ExtendedPropertyMetadata)1 ExtendedPropertyMetadataList (org.teiid.deployers.ExtendedPropertyMetadataList)1 PropertyType (org.teiid.translator.TranslatorProperty.PropertyType)1