Search in sources :

Example 1 with GetDatabaseInformationAction

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

the class AdminServiceImpl method getDatabaseInformation.

@Override
public SDatabaseInformation getDatabaseInformation() throws ServerException, UserException {
    requireAdminAuthenticationAndRunningServer();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<DatabaseInformation> action = new GetDatabaseInformationAction(session, getInternalAccessMethod());
        return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseInformation(org.bimserver.models.store.DatabaseInformation) SDatabaseInformation(org.bimserver.interfaces.objects.SDatabaseInformation) DatabaseSession(org.bimserver.database.DatabaseSession) GetDatabaseInformationAction(org.bimserver.database.actions.GetDatabaseInformationAction) UserException(org.bimserver.shared.exceptions.UserException) BimBotsException(org.bimserver.bimbots.BimBotsException) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 BimBotsException (org.bimserver.bimbots.BimBotsException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 GetDatabaseInformationAction (org.bimserver.database.actions.GetDatabaseInformationAction)1 SDatabaseInformation (org.bimserver.interfaces.objects.SDatabaseInformation)1 DatabaseInformation (org.bimserver.models.store.DatabaseInformation)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1