use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getAllQueryEngines.
@Override
public List<SQueryEnginePluginConfiguration> getAllQueryEngines(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SQueryEnginePluginConfiguration> queryEngines = getBimServer().getSConverter().convertToSListQueryEnginePluginConfiguration(userSettings.getQueryEngines());
Collections.sort(queryEngines, new SPluginConfigurationComparator());
return queryEngines;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getDefaultQueryEngine.
public SQueryEnginePluginConfiguration getDefaultQueryEngine() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings settings = getUserSettings(session);
return getBimServer().getSConverter().convertToSObject(settings.getDefaultQueryEngine());
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getModelCompareByName.
@Override
public SModelComparePluginConfiguration getModelCompareByName(String name) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(new GetModelCompareByNameDatabaseAction(session, getInternalAccessMethod(), name)));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class PluginServiceImpl method deleteQueryEngine.
@Override
public void deleteQueryEngine(Long iid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Void> action = new DeleteQueryEngineDatabaseAction(session, getInternalAccessMethod(), iid);
session.executeAndCommitAction(action);
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class PluginServiceImpl method getAllModelMergers.
@Override
public List<SModelMergerPluginConfiguration> getAllModelMergers(Boolean onlyEnabled) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
UserSettings userSettings = getUserSettings(session);
List<SModelMergerPluginConfiguration> modelMergers = getBimServer().getSConverter().convertToSListModelMergerPluginConfiguration(userSettings.getModelMergers());
Collections.sort(modelMergers, new SPluginConfigurationComparator());
return modelMergers;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations