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