use of org.bimserver.database.query.conditions.IsOfTypeCondition in project BIMserver by opensourceBIM.
the class GetAllModelMergersDatabaseAction method execute.
@Override
public List<ModelMergerPluginConfiguration> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
Condition condition = new IsOfTypeCondition(StorePackage.eINSTANCE.getModelMergerPluginConfiguration());
Map<Long, ModelMergerPluginConfiguration> result = getDatabaseSession().query(condition, ModelMergerPluginConfiguration.class, OldQuery.getDefault());
List<ModelMergerPluginConfiguration> mapToList = CollectionUtils.mapToList(result);
if (onlyEnabled) {
Iterator<ModelMergerPluginConfiguration> iterator = mapToList.iterator();
while (iterator.hasNext()) {
ModelMergerPluginConfiguration modelMerger = iterator.next();
if (!bimServer.getPluginManager().isEnabled(modelMerger.getPluginDescriptor().getPluginClassName()) || !modelMerger.getEnabled()) {
iterator.remove();
}
}
}
return mapToList;
}
Aggregations