Search in sources :

Example 1 with AddQueryEngineDatabaseAction

use of org.bimserver.database.actions.AddQueryEngineDatabaseAction in project BIMserver by opensourceBIM.

the class PluginServiceImpl method addQueryEngine.

@Override
public Long addQueryEngine(SQueryEnginePluginConfiguration queryEngine) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        QueryEnginePluginConfiguration convert = getBimServer().getSConverter().convertFromSObject(queryEngine, session);
        return session.executeAndCommitAction(new AddQueryEngineDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), convert));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : SQueryEnginePluginConfiguration(org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration) QueryEnginePluginConfiguration(org.bimserver.models.store.QueryEnginePluginConfiguration) AddQueryEngineDatabaseAction(org.bimserver.database.actions.AddQueryEngineDatabaseAction) DatabaseSession(org.bimserver.database.DatabaseSession) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 AddQueryEngineDatabaseAction (org.bimserver.database.actions.AddQueryEngineDatabaseAction)1 SQueryEnginePluginConfiguration (org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration)1 QueryEnginePluginConfiguration (org.bimserver.models.store.QueryEnginePluginConfiguration)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1