Search in sources :

Example 1 with GetDataObjectByOidDatabaseAction

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

the class LowLevelServiceImpl method getDataObjectByOid.

@Override
public SDataObject getDataObjectByOid(Long roid, Long oid) throws ServerException, UserException {
    requireAuthenticationAndRunningServer();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<DataObject> action = new GetDataObjectByOidDatabaseAction(getBimServer(), session, getInternalAccessMethod(), roid, oid, getAuthorization());
        SDataObject dataObject = getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
        return dataObject;
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : GetDataObjectByOidDatabaseAction(org.bimserver.database.actions.GetDataObjectByOidDatabaseAction) SDataObject(org.bimserver.interfaces.objects.SDataObject) DataObject(org.bimserver.models.store.DataObject) DatabaseSession(org.bimserver.database.DatabaseSession) SDataObject(org.bimserver.interfaces.objects.SDataObject) UserException(org.bimserver.shared.exceptions.UserException) NoTransactionException(org.bimserver.webservices.NoTransactionException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Aggregations

BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 GetDataObjectByOidDatabaseAction (org.bimserver.database.actions.GetDataObjectByOidDatabaseAction)1 SDataObject (org.bimserver.interfaces.objects.SDataObject)1 DataObject (org.bimserver.models.store.DataObject)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1 NoTransactionException (org.bimserver.webservices.NoTransactionException)1