public void initializeDatabase() throws CantInitializeWalletContactsMiddlewareDatabaseException { try { database = this.pluginDatabaseSystem.openDatabase(pluginId, pluginId.toString()); } catch (CantOpenDatabaseException cantOpenDatabaseException) { throw new CantInitializeWalletContactsMiddlewareDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { WalletContactsMiddlewareDatabaseFactory walletContactsMiddlewareDatabaseFactory = new WalletContactsMiddlewareDatabaseFactory(pluginDatabaseSystem); try { database = walletContactsMiddlewareDatabaseFactory.createDatabase(pluginId, pluginId.toString()); } catch (CantCreateDatabaseException cantCreateDatabaseException) { throw new CantInitializeWalletContactsMiddlewareDatabaseException( cantCreateDatabaseException.getMessage()); } } catch (Exception e) { throw new CantInitializeWalletContactsMiddlewareDatabaseException(e.getMessage()); } }
/** * This method initialize the database * * @throws CantInitializeDatabaseException */ private void initializeDb() throws CantInitializeDatabaseException { try { /* * Open new database connection */ this.database = this.pluginDatabaseSystem.openDatabase( pluginId, ChatMiddlewareDatabaseConstants.DATABASE_NAME); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ errorManager.reportUnexpectedPluginException( Plugins.CHAT_MIDDLEWARE, UnexpectedPluginExceptionSeverity.DISABLES_THIS_PLUGIN, cantOpenDatabaseException); throw new CantInitializeDatabaseException(cantOpenDatabaseException.getLocalizedMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ ChatMiddlewareDatabaseFactory chatMiddlewareDatabaseFactory = new ChatMiddlewareDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ this.database = chatMiddlewareDatabaseFactory.createDatabase( pluginId, ChatMiddlewareDatabaseConstants.DATABASE_NAME); } catch (CantCreateDatabaseException cantOpenDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ errorManager.reportUnexpectedPluginException( Plugins.CHAT_MIDDLEWARE, UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, cantOpenDatabaseException); throw new CantInitializeDatabaseException(cantOpenDatabaseException.getLocalizedMessage()); } } }
public void initializeDatabase() throws CantInitializeCashMoneyDestockDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase( pluginId, StockTransactionsCashMoneyDestockDatabaseConstants.CASH_MONEY_DESTOCK_DATABASE_NAME); database.closeDatabase(); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeCashMoneyDestockDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ StockTransactionsCashMoneyDestockDatabaseFactory stockTransactionsCashMoneyDestockDatabaseFactory = new StockTransactionsCashMoneyDestockDatabaseFactory(this.pluginDatabaseSystem); try { /* * We create the new database */ database = stockTransactionsCashMoneyDestockDatabaseFactory.createDatabase( pluginId, StockTransactionsCashMoneyDestockDatabaseConstants .CASH_MONEY_DESTOCK_DATABASE_NAME); database.closeDatabase(); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeCashMoneyDestockDatabaseException( cantCreateDatabaseException.getMessage()); } } }
/** * This method open or creates the database i'll be working with * * @throws CantInitializeAssetRedeemPointIdentityDatabaseException */ private void initializeDatabase() throws CantInitializeAssetRedeemPointIdentityDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase( this.pluginId, AssetRedeemPointIdentityDatabaseConstants.ASSET_REDEEM_POINT_IDENTITY_DB_NAME); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeAssetRedeemPointIdentityDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ AssetRedeemPointIdentityDatabaseFactory assetRedeemPointIdentityDatabaseFactory = new AssetRedeemPointIdentityDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ database = assetRedeemPointIdentityDatabaseFactory.createDatabase(pluginId); database.closeDatabase(); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeAssetRedeemPointIdentityDatabaseException( cantCreateDatabaseException.getMessage()); } } catch (Exception e) { throw new CantInitializeAssetRedeemPointIdentityDatabaseException(e.getMessage()); } }
/** * This method open or creates the database i'll be working with * * @throws CantInitializeCustomerBrokerSaleNegotiationDatabaseException */ public void initializeDatabase() throws CantInitializeCustomerBrokerSaleNegotiationDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase( pluginId, CustomerBrokerSaleNegotiationDatabaseConstants.DATABASE_NAME); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeCustomerBrokerSaleNegotiationDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ CustomerBrokerSaleNegotiationDatabaseFactory customerBrokerSaleNegotiationDatabaseFactory = new CustomerBrokerSaleNegotiationDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ database = customerBrokerSaleNegotiationDatabaseFactory.createDatabase( pluginId, CustomerBrokerSaleNegotiationDatabaseConstants.DATABASE_NAME); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeCustomerBrokerSaleNegotiationDatabaseException( cantCreateDatabaseException.getMessage()); } } }
/** * This method initialize the database * * @throws CantInitializeDatabaseException */ private void initializeDb() throws CantInitializeDatabaseException { try { /* * Open new database connection */ this.database = this.pluginDatabaseSystem.openDatabase( pluginId, BrokerSubmitOnlineMerchandiseBusinessTransactionDatabaseConstants.DATABASE_NAME); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ reportError(DISABLES_THIS_PLUGIN, cantOpenDatabaseException); throw new CantInitializeDatabaseException(cantOpenDatabaseException.getLocalizedMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ BrokerSubmitOnlineMerchandiseBusinessTransactionDatabaseFactory factory = new BrokerSubmitOnlineMerchandiseBusinessTransactionDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ this.database = factory.createDatabase( pluginId, BrokerSubmitOnlineMerchandiseBusinessTransactionDatabaseConstants.DATABASE_NAME); } catch (CantCreateDatabaseException cantOpenDatabaseException) { reportError(DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, cantOpenDatabaseException); throw new CantInitializeDatabaseException(cantOpenDatabaseException.getLocalizedMessage()); } } }
/** * This method open or creates the database i'll be working with * * @throws CantInitializeAssetsOverBitcoinCryptoVaultDatabaseException */ public void initializeDatabase() throws CantInitializeAssetsOverBitcoinCryptoVaultDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase(pluginId, pluginId.toString()); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeAssetsOverBitcoinCryptoVaultDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ AssetsOverBitcoinCryptoVaultDatabaseFactory assetsOverBitcoinCryptoVaultDatabaseFactory = new AssetsOverBitcoinCryptoVaultDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ database = assetsOverBitcoinCryptoVaultDatabaseFactory.createDatabase( pluginId, pluginId.toString()); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeAssetsOverBitcoinCryptoVaultDatabaseException( cantCreateDatabaseException.getMessage()); } } }
/** * This method open or creates the database i'll be working with * * @throws CantInitializeTimeOutNotifierAgentDatabaseException */ public void initializeDatabase() throws CantInitializeTimeOutNotifierAgentDatabaseException { try { /* * Open new database connection */ database = this.pluginDatabaseSystem.openDatabase(pluginId, "TimeOut Notifier"); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /* * The database exists but cannot be open. I can not handle this situation. */ throw new CantInitializeTimeOutNotifierAgentDatabaseException( cantOpenDatabaseException.getMessage()); } catch (DatabaseNotFoundException e) { /* * The database no exist may be the first time the plugin is running on this device, * We need to create the new database */ TimeOutNotifierAgentDatabaseFactory timeOutNotifierAgentDatabaseFactory = new TimeOutNotifierAgentDatabaseFactory(pluginDatabaseSystem); try { /* * We create the new database */ database = timeOutNotifierAgentDatabaseFactory.createDatabase(pluginId, "TimeOut Notifier"); } catch (CantCreateDatabaseException cantCreateDatabaseException) { /* * The database cannot be created. I can not handle this situation. */ throw new CantInitializeTimeOutNotifierAgentDatabaseException( cantCreateDatabaseException.getMessage()); } } }