Search in sources :

Example 1 with DefaultCertificateStorage

use of org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage in project dbeaver by serge-rider.

the class DBeaverTestPlatform method initialize.

protected void initialize() {
    long startTime = System.currentTimeMillis();
    log.debug("Initialize Test Platform...");
    this.defaultCertificateStorage = new DefaultCertificateStorage(DBeaverTestActivator.getConfigurationFile("cert-storage"));
    // Register properties adapter
    this.workspace = new DBeaverTestWorkspace(this, ResourcesPlugin.getWorkspace());
    this.workspace.initializeProjects();
    this.qmController = new QMControllerImpl();
    super.initialize();
    log.debug("Test Platform initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}
Also used : DefaultCertificateStorage(org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage) QMControllerImpl(org.jkiss.dbeaver.runtime.qm.QMControllerImpl)

Example 2 with DefaultCertificateStorage

use of org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage in project dbeaver by dbeaver.

the class DBeaverCore method initialize.

private void initialize() {
    long startTime = System.currentTimeMillis();
    log.debug("Initialize Core...");
    DBPPreferenceStore prefsStore = getGlobalPreferenceStore();
    // ' Global pref events forwarder
    prefsStore.addPropertyChangeListener(new DBPPreferenceListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent event) {
            // Forward event to all data source preferences
            for (DataSourceDescriptor ds : DataSourceRegistry.getAllDataSources()) {
                ds.getPreferenceStore().firePropertyChangeEvent(event.getProperty(), event.getOldValue(), event.getNewValue());
            }
        }
    });
    // Register properties adapter
    this.workspace = ResourcesPlugin.getWorkspace();
    this.localSystem = new OSDescriptor(Platform.getOS(), Platform.getOSArch());
    {
        this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.getDefault());
        if (this.language == null) {
            log.debug("Language for locale '" + Locale.getDefault() + "' not found. Use default.");
            this.language = PlatformLanguageRegistry.getInstance().getLanguage(Locale.ENGLISH);
        }
    }
    QMUtils.initApplication(this);
    this.queryManager = new QMControllerImpl();
    this.qmLogWriter = new QMLogFileWriter();
    this.queryManager.registerMetaListener(qmLogWriter);
    // Init default network settings
    Authenticator.setDefault(new GlobalProxyAuthenticator());
    ProxySelector.setDefault(new GlobalProxySelector(ProxySelector.getDefault()));
    this.certificateStorage = new DefaultCertificateStorage(new File(DBeaverActivator.getInstance().getStateLocation().toFile(), "security"));
    // Init project registry
    this.projectRegistry = new ProjectRegistry(workspace);
    // Projects registry
    initializeProjects();
    // Navigator model
    this.navigatorModel = new DBNModel(this);
    this.navigatorModel.initialize();
    // Activate plugin services
    for (IPluginService pluginService : PluginServiceRegistry.getInstance().getServices()) {
        try {
            pluginService.activateService();
            activatedServices.add(pluginService);
        } catch (Throwable e) {
            log.error("Error activating plugin service", e);
        }
    }
    // Keep-alive job
    new KeepAliveJob(this).scheduleMonitor();
    log.debug("Core initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}
Also used : DefaultCertificateStorage(org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage) QMControllerImpl(org.jkiss.dbeaver.runtime.qm.QMControllerImpl) QMLogFileWriter(org.jkiss.dbeaver.runtime.qm.QMLogFileWriter) KeepAliveJob(org.jkiss.dbeaver.runtime.jobs.KeepAliveJob) DBNModel(org.jkiss.dbeaver.model.navigator.DBNModel) GlobalProxySelector(org.jkiss.dbeaver.runtime.net.GlobalProxySelector) IPluginService(org.jkiss.dbeaver.runtime.IPluginService) DBPPreferenceStore(org.jkiss.dbeaver.model.preferences.DBPPreferenceStore) OSDescriptor(org.jkiss.dbeaver.model.runtime.OSDescriptor) File(java.io.File) DBPPreferenceListener(org.jkiss.dbeaver.model.preferences.DBPPreferenceListener)

Example 3 with DefaultCertificateStorage

use of org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage in project dbeaver by serge-rider.

the class DBeaverCore method initialize.

protected void initialize() {
    long startTime = System.currentTimeMillis();
    log.debug("Initialize Core...");
    if (getPreferenceStore().getBoolean(DBeaverPreferences.SECURITY_USE_BOUNCY_CASTLE)) {
        // Register BC security provider
        SecurityProviderUtils.registerSecurityProvider();
    }
    this.certificateStorage = new DefaultCertificateStorage(new File(DBeaverActivator.getInstance().getStateLocation().toFile(), "security"));
    // Register properties adapter
    this.workspace = new DBeaverWorkspace(this, ResourcesPlugin.getWorkspace());
    this.workspace.initializeProjects();
    QMUtils.initApplication(this);
    this.queryManager = new QMControllerImpl();
    this.qmLogWriter = new QMLogFileWriter();
    this.queryManager.registerMetaListener(qmLogWriter);
    super.initialize();
    log.debug("Core initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}
Also used : DefaultCertificateStorage(org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage) QMControllerImpl(org.jkiss.dbeaver.runtime.qm.QMControllerImpl) QMLogFileWriter(org.jkiss.dbeaver.runtime.qm.QMLogFileWriter) File(java.io.File)

Aggregations

DefaultCertificateStorage (org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage)3 QMControllerImpl (org.jkiss.dbeaver.runtime.qm.QMControllerImpl)3 File (java.io.File)2 QMLogFileWriter (org.jkiss.dbeaver.runtime.qm.QMLogFileWriter)2 DBNModel (org.jkiss.dbeaver.model.navigator.DBNModel)1 DBPPreferenceListener (org.jkiss.dbeaver.model.preferences.DBPPreferenceListener)1 DBPPreferenceStore (org.jkiss.dbeaver.model.preferences.DBPPreferenceStore)1 OSDescriptor (org.jkiss.dbeaver.model.runtime.OSDescriptor)1 IPluginService (org.jkiss.dbeaver.runtime.IPluginService)1 KeepAliveJob (org.jkiss.dbeaver.runtime.jobs.KeepAliveJob)1 GlobalProxySelector (org.jkiss.dbeaver.runtime.net.GlobalProxySelector)1