Search in sources :

Example 1 with ExtendedPropertyMetadata

use of org.teiid.deployers.ExtendedPropertyMetadata in project teiid by teiid.

the class EngineStatistics method buildNode.

private ModelNode buildNode(ConfigProperty prop) {
    String name = prop.getConfigPropertyName().getValue();
    String type = prop.getConfigPropertyType().getValue();
    String defaltValue = null;
    if (prop.getConfigPropertyValue() != null) {
        defaltValue = prop.getConfigPropertyValue().getValue();
    }
    String description = null;
    if (prop.getDescriptions() != null) {
        description = prop.getDescriptions().get(0).getValue();
    }
    ExtendedPropertyMetadata extended = new ExtendedPropertyMetadata(name, type, description, defaltValue);
    return ReadTranslatorProperties.buildNode(extended);
}
Also used : ExtendedPropertyMetadata(org.teiid.deployers.ExtendedPropertyMetadata)

Example 2 with ExtendedPropertyMetadata

use of org.teiid.deployers.ExtendedPropertyMetadata 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

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