Search in sources :

Example 1 with GetObjectIDMByIdDatabaseAction

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

the class PluginServiceImpl method getObjectIDMById.

@Override
public SObjectIDMPluginConfiguration getObjectIDMById(Long oid) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(new GetObjectIDMByIdDatabaseAction(session, getInternalAccessMethod(), oid)));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) GetObjectIDMByIdDatabaseAction(org.bimserver.database.actions.GetObjectIDMByIdDatabaseAction) 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 GetObjectIDMByIdDatabaseAction (org.bimserver.database.actions.GetObjectIDMByIdDatabaseAction)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1