Search in sources :

Example 26 with ServiceException

use of org.bimserver.shared.exceptions.ServiceException in project BIMserver by opensourceBIM.

the class ServiceImpl method initiateCheckin.

@Override
public Long initiateCheckin(Long poid, Long deserializerOid) throws ServerException, UserException {
    requireAuthenticationAndRunningServer();
    ProgressOnProjectTopic progressTopic = getBimServer().getNotificationsManager().createProgressOnProjectTopic(getAuthorization().getUoid(), poid, SProgressTopicType.UPLOAD, "Checkin");
    long topicId = progressTopic.getKey().getId();
    try (DatabaseSession tmpSession = getBimServer().getDatabase().createSession(OperationType.POSSIBLY_WRITE)) {
        Project tmpProject = tmpSession.get(poid, OldQuery.getDefault());
        if (tmpProject.getCheckinInProgress() != topicId && tmpProject.getCheckinInProgress() != 0) {
            Thread.sleep(1000);
            throw new UserException("Checkin in progress on this project (topicId: " + tmpProject.getCheckinInProgress() + "), please try again later");
        }
        tmpProject.setCheckinInProgress(topicId);
        tmpSession.store(tmpProject);
        tmpSession.commit();
    } catch (BimserverDatabaseException e) {
        // TODO
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ServiceException e) {
        if (e instanceof UserException) {
            throw (UserException) e;
        }
        e.printStackTrace();
    }
    final DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);
    try {
        User user = (User) session.get(StorePackage.eINSTANCE.getUser(), getAuthorization().getUoid(), OldQuery.getDefault());
        Project project = session.get(poid, OldQuery.getDefault());
        if (!getAuthorization().hasRightsOnProjectOrSuperProjects(user, project)) {
            throw new UserException("User has no rights to checkin models to this project");
        }
        if (!MailSystem.isValidEmailAddress(user.getUsername())) {
            throw new UserException("Users must have a valid e-mail address to checkin");
        }
        if (project == null) {
            throw new UserException("No project found with poid " + poid);
        }
        return progressTopic.getKey().getId();
    } catch (UserException e) {
        throw e;
    } catch (Throwable e) {
        LOGGER.error("", e);
        throw new ServerException(e);
    } finally {
        session.close();
    }
}
Also used : Project(org.bimserver.models.store.Project) SProject(org.bimserver.interfaces.objects.SProject) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) ProgressOnProjectTopic(org.bimserver.notifications.ProgressOnProjectTopic) SUser(org.bimserver.interfaces.objects.SUser) User(org.bimserver.models.store.User) ServerException(org.bimserver.shared.exceptions.ServerException) ServiceException(org.bimserver.shared.exceptions.ServiceException) DatabaseSession(org.bimserver.database.DatabaseSession) UserException(org.bimserver.shared.exceptions.UserException)

Example 27 with ServiceException

use of org.bimserver.shared.exceptions.ServiceException in project BIMserver by opensourceBIM.

the class TestAddExtendedData method start.

private void start() {
    try {
        BimServerClientInterface client = LocalDevSetup.setupJson("http://localhost:8080");
        SFile file = new SFile();
        file.setData("test".getBytes(Charsets.UTF_8));
        file.setMime("text");
        file.setFilename("test.txt");
        long fileId = client.getServiceInterface().uploadFile(file);
        SProject project = client.getServiceInterface().addProject("t2es035442t23", "ifc2x3tc1");
        SDeserializerPluginConfiguration deserializerForExtension = client.getServiceInterface().getSuggestedDeserializerForExtension("ifc", project.getOid());
        SLongCheckinActionState checkinSync = client.checkinSync(project.getOid(), "initial", deserializerForExtension.getOid(), false, Paths.get("../../TestFiles/TestData/data/AC11-FZK-Haus-IFC.ifc"));
        SExtendedDataSchema extendedDataSchemaByNamespace = client.getServiceInterface().getExtendedDataSchemaByName("GEOMETRY_GENERATION_REPORT_JSON_1_1");
        SExtendedData extendedData = new SExtendedData();
        extendedData.setFileId(fileId);
        extendedData.setTitle("test3");
        extendedData.setSchemaId(extendedDataSchemaByNamespace.getOid());
        client.getServiceInterface().addExtendedDataToRevision(checkinSync.getRoid(), extendedData);
    } catch (ServiceException e) {
        e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) SExtendedData(org.bimserver.interfaces.objects.SExtendedData) ServiceException(org.bimserver.shared.exceptions.ServiceException) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) SLongCheckinActionState(org.bimserver.interfaces.objects.SLongCheckinActionState) BimServerClientInterface(org.bimserver.plugins.services.BimServerClientInterface) IOException(java.io.IOException) SFile(org.bimserver.interfaces.objects.SFile) SProject(org.bimserver.interfaces.objects.SProject) SExtendedDataSchema(org.bimserver.interfaces.objects.SExtendedDataSchema)

Example 28 with ServiceException

use of org.bimserver.shared.exceptions.ServiceException in project BIMserver by opensourceBIM.

the class GetLogs method start.

private void start() {
    try (JsonBimServerClientFactory factory = new JsonBimServerClientFactory(null, "[ADD]")) {
        client = factory.create(new UsernamePasswordAuthenticationInfo("[ADD]", "[ADD]"));
        List<SLogAction> logs = client.getAdminInterface().getLogs();
        Path file = Paths.get("log.txt");
        writer = new PrintWriter(file.toFile());
        try {
            for (SLogAction sLogAction : logs) {
                if (sLogAction instanceof SDatabaseCreated) {
                    write(sLogAction, "Database created");
                } else if (sLogAction instanceof SUserAddedToProject) {
                    SUserAddedToProject sUserAddedToProject = (SUserAddedToProject) sLogAction;
                    SProject project = getProject(sUserAddedToProject.getProjectId());
                    SUser user = getUser(sUserAddedToProject.getUserId());
                    write(sLogAction, "User " + user.getUsername() + " added to project " + project.getName());
                } else if (sLogAction instanceof SUserRemovedFromProject) {
                    SUserRemovedFromProject sUserRemovedFromProject = (SUserRemovedFromProject) sLogAction;
                    SProject project = getProject(sUserRemovedFromProject.getProjectId());
                    SUser user = getUser(sUserRemovedFromProject.getUserId());
                    write(sLogAction, "User " + user.getUsername() + " removed from project " + project.getName());
                } else if (sLogAction instanceof SNewUserAdded) {
                    SNewUserAdded sNewUserAdded = (SNewUserAdded) sLogAction;
                    SUser user = getUser(sNewUserAdded.getUserId());
                    write(sLogAction, "User " + user.getUsername() + " created");
                } else if (sLogAction instanceof SNewProjectAdded) {
                    SNewProjectAdded sNewProject = (SNewProjectAdded) sLogAction;
                    SProject project = getProject(sNewProject.getProjectId());
                    write(sLogAction, "Project " + project.getName() + " created");
                } else if (sLogAction instanceof SNewRevisionAdded) {
                    SNewRevisionAdded sNewRevisionAdded = (SNewRevisionAdded) sLogAction;
                    SProject project = getProject(sNewRevisionAdded.getProjectId());
                    SRevision revision = getRevision(sNewRevisionAdded.getRevisionId());
                    write(sLogAction, "Revision " + revision.getId() + " with comment " + revision.getComment() + " added to project " + project.getName());
                } else if (sLogAction instanceof SProjectUpdated) {
                    SProjectUpdated sProjectUpdated = (SProjectUpdated) sLogAction;
                    SProject project = getProject(sProjectUpdated.getProjectId());
                    write(sLogAction, "Project " + project.getName() + " updated");
                } else if (sLogAction instanceof SProjectDeleted) {
                    SProjectDeleted sProjectDeleted = (SProjectDeleted) sLogAction;
                    SProject project = getProject(sProjectDeleted.getProjectId());
                    write(sLogAction, "Project " + project.getName() + " deleted");
                } else if (sLogAction instanceof SUserChanged) {
                    SUserChanged sUserChanged = (SUserChanged) sLogAction;
                    SUser user = getUser(sUserChanged.getUserId());
                    write(sLogAction, "User " + user.getUsername() + " updated");
                } else if (sLogAction instanceof SServerStarted) {
                    write(sLogAction, "Server started");
                } else {
                    write(sLogAction, "NOT IMPL " + sLogAction.getClass().getSimpleName());
                }
            }
        } finally {
            writer.close();
        }
    } catch (ServiceException | ChannelConnectionException e) {
        e.printStackTrace();
    } catch (PublicInterfaceNotFoundException e) {
        e.printStackTrace();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (BimServerClientException e) {
        e.printStackTrace();
    } catch (Exception e1) {
        e1.printStackTrace();
    }
}
Also used : UsernamePasswordAuthenticationInfo(org.bimserver.shared.UsernamePasswordAuthenticationInfo) JsonBimServerClientFactory(org.bimserver.client.json.JsonBimServerClientFactory) SUser(org.bimserver.interfaces.objects.SUser) FileNotFoundException(java.io.FileNotFoundException) SProject(org.bimserver.interfaces.objects.SProject) SNewUserAdded(org.bimserver.interfaces.objects.SNewUserAdded) SUserChanged(org.bimserver.interfaces.objects.SUserChanged) SDatabaseCreated(org.bimserver.interfaces.objects.SDatabaseCreated) PrintWriter(java.io.PrintWriter) Path(java.nio.file.Path) SUserRemovedFromProject(org.bimserver.interfaces.objects.SUserRemovedFromProject) ChannelConnectionException(org.bimserver.shared.ChannelConnectionException) SProjectUpdated(org.bimserver.interfaces.objects.SProjectUpdated) SProjectDeleted(org.bimserver.interfaces.objects.SProjectDeleted) BimServerClientException(org.bimserver.shared.exceptions.BimServerClientException) ChannelConnectionException(org.bimserver.shared.ChannelConnectionException) ServiceException(org.bimserver.shared.exceptions.ServiceException) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) BimServerClientException(org.bimserver.shared.exceptions.BimServerClientException) FileNotFoundException(java.io.FileNotFoundException) UserException(org.bimserver.shared.exceptions.UserException) ServerException(org.bimserver.shared.exceptions.ServerException) SUserAddedToProject(org.bimserver.interfaces.objects.SUserAddedToProject) SRevision(org.bimserver.interfaces.objects.SRevision) SNewRevisionAdded(org.bimserver.interfaces.objects.SNewRevisionAdded) ServiceException(org.bimserver.shared.exceptions.ServiceException) PublicInterfaceNotFoundException(org.bimserver.shared.exceptions.PublicInterfaceNotFoundException) SLogAction(org.bimserver.interfaces.objects.SLogAction) SServerStarted(org.bimserver.interfaces.objects.SServerStarted) SNewProjectAdded(org.bimserver.interfaces.objects.SNewProjectAdded)

Example 29 with ServiceException

use of org.bimserver.shared.exceptions.ServiceException in project BIMserver by opensourceBIM.

the class BimServer method initDatabaseDependantItems.

private void initDatabaseDependantItems() throws BimserverDatabaseException {
    LOGGER.info("Initializing database dependant logic...");
    long start = System.nanoTime();
    notificationsManager.init();
    getSerializerFactory().init(pluginManager, bimDatabase, this);
    try {
        DatabaseSession session = bimDatabase.createSession(OperationType.POSSIBLY_WRITE);
        try {
            updatePlugins(session);
            session.commit();
        } catch (ServiceException e) {
            LOGGER.error("", e);
        } finally {
            session.close();
        }
        int renderEngineProcesses = getServerSettingsCache().getServerSettings().getRenderEngineProcesses();
        RenderEnginePoolFactory renderEnginePoolFactory = new CommonsPoolingRenderEnginePoolFactory(renderEngineProcesses);
        renderEnginePools = new RenderEnginePools(this, renderEnginePoolFactory);
        session = bimDatabase.createSession(OperationType.POSSIBLY_WRITE);
        // createDatabaseObjects(session);
        ServerSettings serverSettings = serverSettingsCache.getServerSettings();
        for (Entry<PluginContext, WebModulePlugin> entry : pluginManager.getAllWebPlugins(true).entrySet()) {
            WebModulePluginConfiguration webPluginConfiguration = find(serverSettings.getWebModules(), entry.getKey().getIdentifier());
            if (webPluginConfiguration == null) {
                webPluginConfiguration = session.create(WebModulePluginConfiguration.class);
                serverSettings.getWebModules().add(webPluginConfiguration);
                PluginDescriptor pluginDescriptor = getPluginDescriptor(session, entry.getKey().getIdentifier());
                if (pluginDescriptor == null) {
                    throw new BimserverDatabaseException("No plugin descriptor found: " + entry.getKey().getIdentifier());
                }
                genericPluginConversion(entry.getKey(), session, webPluginConfiguration, pluginDescriptor);
            } else {
                if (webPluginConfiguration == serverSettings.getWebModule()) {
                    setDefaultWebModule(entry.getValue());
                }
            }
        }
        // Set the default
        // if (serverSettings.getWebModule() == null) {
        // WebModulePluginConfiguration bimviewsWebModule = findWebModule(serverSettings, "BIM Views");
        // if (bimviewsWebModule != null) {
        // serverSettings.setWebModule(bimviewsWebModule);
        // setDefaultWebModule(pluginManager.getWebModulePlugin(bimviewsWebModule.getPluginDescriptor().getPluginClassName(), true));
        // } else {
        // WebModulePluginConfiguration defaultWebModule = findWebModule(serverSettings, "org.bimserver.defaultwebmodule.DefaultWebModulePlugin");
        // if (defaultWebModule != null) {
        // serverSettings.setWebModule(defaultWebModule);
        // setDefaultWebModule(pluginManager.getWebModulePlugin(defaultWebModule.getPluginDescriptor().getPluginClassName(), true));
        // }
        // }
        // }
        session.store(serverSettings);
        Condition condition = new AttributeCondition(StorePackage.eINSTANCE.getUser_Username(), new StringLiteral("system"));
        User systemUser = session.querySingle(condition, User.class, OldQuery.getDefault());
        ServerStarted serverStarted = session.create(ServerStarted.class);
        serverStarted.setDate(new Date());
        serverStarted.setAccessMethod(AccessMethod.INTERNAL);
        serverStarted.setExecutor(systemUser);
        try {
            session.store(serverStarted);
            session.commit();
        } catch (BimserverLockConflictException e) {
            throw new BimserverDatabaseException(e);
        } catch (ServiceException e) {
            throw new BimserverDatabaseException(e);
        } finally {
            session.close();
        }
        webModules = new HashMap<String, WebModulePlugin>();
        List<WebModulePluginConfiguration> webModuleConfigurations = serverSettingsCache.getServerSettings().getWebModules();
        for (WebModulePluginConfiguration webModulePluginConfiguration : webModuleConfigurations) {
            String contextPath = "";
            for (Parameter parameter : webModulePluginConfiguration.getSettings().getParameters()) {
                if (parameter.getName().equals("contextPath")) {
                    contextPath = ((StringType) parameter.getValue()).getValue();
                }
            }
            String identifier = webModulePluginConfiguration.getPluginDescriptor().getIdentifier();
            webModules.put(contextPath, (WebModulePlugin) pluginManager.getPlugin(identifier, true));
        }
        try (DatabaseSession databaseSession = getDatabase().createSession(OperationType.POSSIBLY_WRITE)) {
            ExtendedDataSchema htmlSchema = (ExtendedDataSchema) databaseSession.querySingle(StorePackage.eINSTANCE.getExtendedDataSchema_Name(), "GEOMETRY_GENERATION_REPORT_HTML_1_1");
            ExtendedDataSchema jsonSchema = (ExtendedDataSchema) databaseSession.querySingle(StorePackage.eINSTANCE.getExtendedDataSchema_Name(), "GEOMETRY_GENERATION_REPORT_JSON_1_1");
            if (htmlSchema == null) {
                htmlSchema = createExtendedDataSchema(databaseSession, "GEOMETRY_GENERATION_REPORT_HTML_1_1", "text/html");
            }
            if (jsonSchema == null) {
                jsonSchema = createExtendedDataSchema(databaseSession, "GEOMETRY_GENERATION_REPORT_JSON_1_1", "application/json");
            }
            databaseSession.commit();
        } catch (ServiceException e) {
            LOGGER.error("", e);
        }
        Integer protocolBuffersPort = getServerSettingsCache().getServerSettings().getProtocolBuffersPort();
        if (protocolBuffersPort >= 1 && protocolBuffersPort <= 65535) {
            try {
                protocolBuffersMetaData = new ProtocolBuffersMetaData();
                protocolBuffersMetaData.load(servicesMap, ProtocolBuffersBimServerClientFactory.class);
                protocolBuffersServer = new ProtocolBuffersServer(protocolBuffersMetaData, serviceFactory, servicesMap, protocolBuffersPort);
                protocolBuffersServer.start();
            } catch (Exception e) {
                LOGGER.error("", e);
            }
        }
        bimServerClientFactory = new DirectBimServerClientFactory<ServiceInterface>(serverSettingsCache.getServerSettings().getSiteAddress(), serviceFactory, servicesMap, pluginManager, metaDataManager);
        pluginManager.setBimServerClientFactory(bimServerClientFactory);
        try (DatabaseSession session2 = bimDatabase.createSession(OperationType.READ_ONLY)) {
            IfcModelInterface pluginBundleVersions = session2.getAllOfType(StorePackage.eINSTANCE.getPluginBundleVersion(), OldQuery.getDefault());
            for (PluginBundleVersion pluginBundleVersion : pluginBundleVersions.getAll(PluginBundleVersion.class)) {
                if (pluginBundleVersion.getType() == PluginBundleType.MAVEN || pluginBundleVersion.getType() == PluginBundleType.LOCAL) {
                    PluginBundleVersionIdentifier pluginBundleVersionIdentifier = new PluginBundleVersionIdentifier(pluginBundleVersion.getGroupId(), pluginBundleVersion.getArtifactId(), pluginBundleVersion.getVersion());
                    IfcModelInterface pluginDescriptors = session2.getAllOfType(StorePackage.eINSTANCE.getPluginDescriptor(), OldQuery.getDefault());
                    List<SPluginInformation> plugins = new ArrayList<>();
                    for (PluginDescriptor pluginDescriptor : pluginDescriptors.getAll(PluginDescriptor.class)) {
                        if (pluginDescriptor.getPluginBundleVersion() == pluginBundleVersion && pluginDescriptor.getEnabled()) {
                            SPluginInformation sPluginInformation = new SPluginInformation();
                            sPluginInformation.setEnabled(true);
                            sPluginInformation.setDescription(pluginDescriptor.getDescription());
                            sPluginInformation.setIdentifier(pluginDescriptor.getIdentifier());
                            sPluginInformation.setInstallForAllUsers(pluginDescriptor.isInstallForNewUsers());
                            sPluginInformation.setInstallForNewUsers(pluginDescriptor.isInstallForNewUsers());
                            sPluginInformation.setName(pluginDescriptor.getName());
                            sPluginInformation.setType(pluginManager.getPluginTypeFromClass(pluginDescriptor.getPluginClassName()));
                            plugins.add(sPluginInformation);
                        }
                    }
                    try {
                        pluginBundleManager.loadFromPluginDir(pluginBundleVersionIdentifier, getSConverter().convertToSObject(pluginBundleVersion), plugins, serverSettingsCache.getServerSettings().isPluginStrictVersionChecking());
                    } catch (Exception e) {
                        LOGGER.error("", e);
                    }
                }
            }
        } catch (Exception e) {
            throw new BimserverDatabaseException(e);
        }
    } catch (BimserverLockConflictException e) {
        throw new BimserverDatabaseException(e);
    // } catch (PluginException e) {
    // throw new BimserverDatabaseException(e);
    } catch (RenderEngineException e) {
        throw new BimserverDatabaseException(e);
    }
    long end = System.nanoTime();
    LOGGER.info("Done initializing database dependant logic (" + ((end - start) / 1000000) + "ms)");
}
Also used : User(org.bimserver.models.store.User) DatabaseSession(org.bimserver.database.DatabaseSession) IfcModelInterface(org.bimserver.emf.IfcModelInterface) ArrayList(java.util.ArrayList) ProtocolBuffersMetaData(org.bimserver.shared.pb.ProtocolBuffersMetaData) PluginBundleVersionIdentifier(org.bimserver.plugins.PluginBundleVersionIdentifier) ServerSettings(org.bimserver.models.store.ServerSettings) CommonsPoolingRenderEnginePoolFactory(org.bimserver.renderengine.pooled.CommonsPoolingRenderEnginePoolFactory) ServiceInterface(org.bimserver.shared.interfaces.ServiceInterface) ExtendedDataSchema(org.bimserver.models.store.ExtendedDataSchema) WebModulePlugin(org.bimserver.plugins.web.WebModulePlugin) PluginBundleVersion(org.bimserver.models.store.PluginBundleVersion) SPluginBundleVersion(org.bimserver.interfaces.objects.SPluginBundleVersion) RenderEngineException(org.bimserver.plugins.renderengine.RenderEngineException) Condition(org.bimserver.database.query.conditions.Condition) AttributeCondition(org.bimserver.database.query.conditions.AttributeCondition) PluginContext(org.bimserver.plugins.PluginContext) WebModulePluginConfiguration(org.bimserver.models.store.WebModulePluginConfiguration) SPluginInformation(org.bimserver.interfaces.objects.SPluginInformation) AttributeCondition(org.bimserver.database.query.conditions.AttributeCondition) RenderEnginePoolFactory(org.bimserver.renderengine.RenderEnginePoolFactory) CommonsPoolingRenderEnginePoolFactory(org.bimserver.renderengine.pooled.CommonsPoolingRenderEnginePoolFactory) Date(java.util.Date) ServiceException(org.bimserver.shared.exceptions.ServiceException) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) PluginException(org.bimserver.shared.exceptions.PluginException) QueryException(org.bimserver.database.queries.om.QueryException) InconsistentModelsException(org.bimserver.database.migrations.InconsistentModelsException) BimserverLockConflictException(org.bimserver.database.BimserverLockConflictException) DatabaseRestartRequiredException(org.bimserver.database.DatabaseRestartRequiredException) DatabaseInitException(org.bimserver.database.berkeley.DatabaseInitException) RenderEngineException(org.bimserver.plugins.renderengine.RenderEngineException) ProtocolBuffersServer(org.bimserver.pb.server.ProtocolBuffersServer) PluginDescriptor(org.bimserver.models.store.PluginDescriptor) ServerStarted(org.bimserver.models.log.ServerStarted) ServiceException(org.bimserver.shared.exceptions.ServiceException) StringLiteral(org.bimserver.database.query.literals.StringLiteral) RenderEnginePools(org.bimserver.renderengine.RenderEnginePools) Parameter(org.bimserver.models.store.Parameter) BimserverLockConflictException(org.bimserver.database.BimserverLockConflictException)

Example 30 with ServiceException

use of org.bimserver.shared.exceptions.ServiceException in project BIMserver by opensourceBIM.

the class BimServer method cleanupStaleData.

private void cleanupStaleData() throws BimserverDatabaseException {
    LOGGER.info("Checking for stale records, this can take some time...");
    long s = System.nanoTime();
    try (DatabaseSession session = bimDatabase.createSession(OperationType.POSSIBLY_WRITE)) {
        for (Project project : session.getAll(Project.class)) {
            if (project.getCheckinInProgress() == 0) {
                continue;
            }
            if (project.getName().equals("INT-Store")) {
                continue;
            }
            int recordsRemoved = 0;
            if (project.getRevisions().size() == 0) {
                recordsRemoved += checkPidRid(session, project, project.getId(), 0);
            } else {
                ConcreteRevision lastConcreteRevision = project.getLastConcreteRevision();
                if (lastConcreteRevision != null) {
                    recordsRemoved += checkPidRid(session, project, project.getId(), lastConcreteRevision.getId());
                }
            }
            if (recordsRemoved > 0) {
                LOGGER.info("Removed " + recordsRemoved + " stale records for project " + project.getName());
            }
            project.setCheckinInProgress(0);
            session.store(project);
        }
        session.commit();
    } catch (ServiceException e1) {
        LOGGER.error("", e1);
    }
    long e = System.nanoTime();
    LOGGER.info("Done checking for stale records (" + ((e - s) / 1000000) + " ms)");
}
Also used : Project(org.bimserver.models.store.Project) ConcreteRevision(org.bimserver.models.store.ConcreteRevision) ServiceException(org.bimserver.shared.exceptions.ServiceException) DatabaseSession(org.bimserver.database.DatabaseSession)

Aggregations

ServiceException (org.bimserver.shared.exceptions.ServiceException)53 IOException (java.io.IOException)21 PublicInterfaceNotFoundException (org.bimserver.shared.exceptions.PublicInterfaceNotFoundException)21 SProject (org.bimserver.interfaces.objects.SProject)19 DatabaseSession (org.bimserver.database.DatabaseSession)18 BimServerClientInterface (org.bimserver.plugins.services.BimServerClientInterface)17 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)16 User (org.bimserver.models.store.User)13 Project (org.bimserver.models.store.Project)11 BimServerClientException (org.bimserver.shared.exceptions.BimServerClientException)11 UserException (org.bimserver.shared.exceptions.UserException)11 Date (java.util.Date)10 JsonBimServerClientFactory (org.bimserver.client.json.JsonBimServerClientFactory)9 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)9 ChannelConnectionException (org.bimserver.shared.ChannelConnectionException)9 Path (java.nio.file.Path)8 UsernamePasswordAuthenticationInfo (org.bimserver.shared.UsernamePasswordAuthenticationInfo)8 ServerException (org.bimserver.shared.exceptions.ServerException)8 ArrayList (java.util.ArrayList)6 BimServerClientFactory (org.bimserver.shared.BimServerClientFactory)6