Search in sources :

Example 1 with AddObjectIDMDatabaseAction

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

the class PluginServiceImpl method addObjectIDM.

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