use of io.fabric8.api.jmx.MetaTypeSummaryDTO in project fabric8 by jboss-fuse.
the class ProfileMetadata method metaTypeSummary.
@Override
public MetaTypeSummaryDTO metaTypeSummary(String versionId, String profileId) throws Exception {
final MetaTypeSummaryDTO answer = new MetaTypeSummaryDTO();
MetadataHandler handler = new MetadataHandler() {
@Override
public void invoke(MetaData metadata, Properties resources) {
addMetaData(answer, metadata, resources);
}
};
findMetadataForProfile(versionId, profileId, handler);
return answer;
}
use of io.fabric8.api.jmx.MetaTypeSummaryDTO in project fabric8 by jboss-fuse.
the class ProfileMetadata method addMetaData.
protected void addMetaData(MetaTypeSummaryDTO summary, MetaData metadata, Properties resources) {
Map<String, Object> map = metadata.getDesignates();
Map<String, Object> objects = metadata.getObjectClassDefinitions();
Set<Map.Entry<String, Object>> entries = map.entrySet();
for (Map.Entry<String, Object> entry : entries) {
String pid = entry.getKey();
Object value = objects.get(pid);
if (value instanceof OCD) {
OCD ocd = (OCD) value;
MetaTypeObjectSummaryDTO object = summary.getOrCreateMetaTypeSummaryDTO(pid);
object.setId(pid);
object.setName(localize(resources, ocd.getName()));
object.setDescription(localize(resources, ocd.getDescription()));
}
}
}
use of io.fabric8.api.jmx.MetaTypeSummaryDTO in project fabric8 by jboss-fuse.
the class MetaTypeFacade method metaTypeSummary.
@Override
public MetaTypeSummaryDTO metaTypeSummary() {
MetaTypeSummaryDTO answer = new MetaTypeSummaryDTO();
Bundle[] bundles = bundleContext.getBundles();
for (Bundle bundle : bundles) {
MetaTypeInformation info = getMetaTypeInformation(bundle);
if (info != null) {
answer.addTypeInformation(bundle, info);
}
}
return answer;
}
Aggregations