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);
}
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;
}
Aggregations