use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class ServiceImpl method getUserByUoid.
@Override
public SUser getUserByUoid(Long uoid) throws ServerException, UserException {
requireAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
GetUserByUoidDatabaseAction action = new GetUserByUoidDatabaseAction(session, getInternalAccessMethod(), uoid);
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class ServiceImpl method getGeoTag.
@Override
public SGeoTag getGeoTag(Long goid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<GeoTag> action = new GetGeoTagDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), goid);
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class ServiceImpl method getTopLevelProjectByName.
@Override
public SProject getTopLevelProjectByName(String name) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
GetTopLevelProjectByNameDatabaseAction action = new GetTopLevelProjectByNameDatabaseAction(session, getInternalAccessMethod(), name, getAuthorization());
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class ServiceImpl method getSerializerByName.
@Override
public SSerializerPluginConfiguration getSerializerByName(String serializerName) throws ServerException, UserException {
requireAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(new GetSerializerByNameDatabaseAction(session, getInternalAccessMethod(), serializerName)));
} catch (Exception e) {
handleException(e);
} finally {
session.close();
}
return null;
}
use of org.bimserver.database.DatabaseSession in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllProjectsSmall.
@Override
public List<SProjectSmall> getAllProjectsSmall() throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<List<SProjectSmall>> action = new GetAllProjectsSmallDatabaseAction(getBimServer(), session, getInternalAccessMethod(), getAuthorization());
return action.execute();
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations