Search in sources :

Example 1 with GetDataObjectsByTypeDatabaseAction

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

the class LowLevelServiceImpl method getDataObjectsByType.

@Override
public List<SDataObject> getDataObjectsByType(Long roid, String packageName, String className, Boolean flat) throws ServerException, UserException {
    requireAuthenticationAndRunningServer();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    BimDatabaseAction<List<DataObject>> action = new GetDataObjectsByTypeDatabaseAction(getBimServer(), session, getInternalAccessMethod(), roid, packageName, className, getAuthorization(), flat);
    try {
        return getBimServer().getSConverter().convertToSListDataObject(session.executeAndCommitAction(action));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) GetDataObjectsByTypeDatabaseAction(org.bimserver.database.actions.GetDataObjectsByTypeDatabaseAction) ArrayList(java.util.ArrayList) List(java.util.List) UserException(org.bimserver.shared.exceptions.UserException) NoTransactionException(org.bimserver.webservices.NoTransactionException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 GetDataObjectsByTypeDatabaseAction (org.bimserver.database.actions.GetDataObjectsByTypeDatabaseAction)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1 NoTransactionException (org.bimserver.webservices.NoTransactionException)1