Search in sources :

Example 21 with OldQuery

use of org.bimserver.database.OldQuery in project BIMserver by opensourceBIM.

the class ServerSettingsCache method updateCache.

public synchronized void updateCache() {
    DatabaseSession session = database.createSession(OperationType.READ_ONLY);
    try {
        serverSettings = session.getSingle(StorePackage.eINSTANCE.getServerSettings(), new OldQuery(session.getMetaDataManager().getPackageMetaData("store"), true));
        if (serverSettings.getSessionTimeOutSeconds() == 0) {
            serverSettings.setSessionTimeOutSeconds(60 * 60 * 24 * 30);
        }
        allowedHosts.clear();
        for (String domain : serverSettings.getWhitelistedDomains()) {
            allowedHosts.add(domain);
        }
    } catch (BimserverDatabaseException e) {
        LOGGER.error("", e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) OldQuery(org.bimserver.database.OldQuery)

Aggregations

OldQuery (org.bimserver.database.OldQuery)21 UserException (org.bimserver.shared.exceptions.UserException)17 PackageMetaData (org.bimserver.emf.PackageMetaData)14 Revision (org.bimserver.models.store.Revision)14 IfcModelInterface (org.bimserver.emf.IfcModelInterface)12 IdEObject (org.bimserver.emf.IdEObject)10 ConcreteRevision (org.bimserver.models.store.ConcreteRevision)10 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)9 Project (org.bimserver.models.store.Project)9 IfcModelSet (org.bimserver.plugins.IfcModelSet)9 ModelHelper (org.bimserver.plugins.ModelHelper)9 MergeException (org.bimserver.plugins.modelmerger.MergeException)9 DatabaseSession (org.bimserver.database.DatabaseSession)8 ServerException (org.bimserver.shared.exceptions.ServerException)8 IfcModel (org.bimserver.ifc.IfcModel)7 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 BasicIfcModel (org.bimserver.ifc.BasicIfcModel)6 User (org.bimserver.models.store.User)6 EClass (org.eclipse.emf.ecore.EClass)6