Search in sources :

Example 1 with GetDataObjectsDatabaseAction

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

the class LowLevelServiceImpl method getDataObjects.

@Override
public List<SDataObject> getDataObjects(Long roid) throws ServerException, UserException {
    requireAuthenticationAndRunningServer();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<List<DataObject>> action = new GetDataObjectsDatabaseAction(session, getInternalAccessMethod(), getBimServer(), roid, getAuthorization());
        return getBimServer().getSConverter().convertToSListDataObject(session.executeAndCommitAction(action));
    } catch (BimserverDatabaseException e) {
        handleException(e);
    } finally {
        session.close();
    }
    return null;
}
Also used : BimserverDatabaseException(org.bimserver.BimserverDatabaseException) DatabaseSession(org.bimserver.database.DatabaseSession) GetDataObjectsDatabaseAction(org.bimserver.database.actions.GetDataObjectsDatabaseAction) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 GetDataObjectsDatabaseAction (org.bimserver.database.actions.GetDataObjectsDatabaseAction)1