@Override public List<DeveloperDatabaseTableRecord> getDatabaseTableContent( DeveloperObjectFactory developerObjectFactory, DeveloperDatabase developerDatabase, DeveloperDatabaseTable developerDatabaseTable) { Database database; try { database = this.pluginDatabaseSystem.openDatabase( pluginId, IssuerRedemptionDatabaseConstants.ASSET_ISSUER_REDEMPTION_DATABASE); return IssuerRedemptionDeveloperDatabaseFactory.getDatabaseTableContent( developerObjectFactory, database, developerDatabaseTable); } catch (CantOpenDatabaseException cantOpenDatabaseException) { /** The database exists but cannot be open. I can not handle this situation. */ FermatException e = new CantDeliverDatabaseException( "Cannot open the database", cantOpenDatabaseException, "DeveloperDatabase: " + developerDatabase.getName(), ""); this.errorManager.reportUnexpectedPluginException( Plugins.BITDUBAI_ISSUER_REDEMPTION_TRANSACTION, UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e); } catch (DatabaseNotFoundException databaseNotFoundException) { FermatException e = new CantDeliverDatabaseException( "Database does not exists", databaseNotFoundException, "DeveloperDatabase: " + developerDatabase.getName(), ""); this.errorManager.reportUnexpectedPluginException( Plugins.BITDUBAI_ISSUER_REDEMPTION_TRANSACTION, UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e); } catch (Exception exception) { FermatException e = new CantDeliverDatabaseException( "Unexpected Exception", exception, "DeveloperDatabase: " + developerDatabase.getName(), ""); this.errorManager.reportUnexpectedPluginException( Plugins.BITDUBAI_ISSUER_REDEMPTION_TRANSACTION, UnexpectedPluginExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_PLUGIN, e); } // If we are here the database could not be opened, so we return an empty list return new ArrayList<>(); }
@Override public List<DeveloperDatabaseTable> getDatabaseTableList( DeveloperObjectFactory developerObjectFactory, DeveloperDatabase developerDatabase) { return IssuerRedemptionDeveloperDatabaseFactory.getDatabaseTableList(developerObjectFactory); }
@Override public List<DeveloperDatabase> getDatabaseList(DeveloperObjectFactory developerObjectFactory) { IssuerRedemptionDeveloperDatabaseFactory assetReceptionDatabaseFactory = new IssuerRedemptionDeveloperDatabaseFactory(this.pluginDatabaseSystem, this.pluginId); return assetReceptionDatabaseFactory.getDatabaseList(developerObjectFactory); }