Search in sources :

Example 1 with SignalIndexHistogramHistoryDBEntryMapper

use of horse.wtf.nzyme.dot11.networks.signalstrength.SignalIndexHistogramHistoryDBEntryMapper in project nzyme by lennartkoopmann.

the class Database method initializeAndMigrate.

public void initializeAndMigrate() throws LiquibaseException {
    this.jdbi = Jdbi.create("jdbc:" + configuration.databasePath()).installPlugin(new PostgresPlugin()).installPlugin(new JodaTimePlugin()).registerRowMapper(new MeasurementMapper()).registerRowMapper(new BeaconRateMapper()).registerRowMapper(new SignalIndexHistogramHistoryDBEntryMapper()).registerRowMapper(new AlertDatabaseEntryMapper()).registerRowMapper(new BanditMapper()).registerRowMapper(new BanditIdentifierMapper()).registerRowMapper(new ContactMapper()).registerRowMapper(new SentrySSIDMapper()).registerRowMapper(new DeauthenticationMonitorRecordingMapper()).registerRowMapper(new EventRecordMapper()).registerRowMapper(new ScheduledReportEntryMapper()).registerRowMapper(new ExecutionLogEntryMapper()).registerRowMapper(new ContactRecordMapper()).registerRowMapper(new ContactRecordValueAggregationMapper()).registerRowMapper(new ContactRecorderHistogramEntryMapper());
    // Run migrations against underlying JDBC connection.
    JdbcConnection connection = new JdbcConnection(jdbi.open().getConnection());
    try {
        liquibase.database.Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
        Liquibase liquibase = new liquibase.Liquibase("db/migrations.xml", new ClassLoaderResourceAccessor(), database);
        liquibase.update(new Contexts(), new LabelExpression());
    } finally {
        connection.close();
    }
}
Also used : ExecutionLogEntryMapper(horse.wtf.nzyme.reporting.db.ExecutionLogEntryMapper) DeauthenticationMonitorRecordingMapper(horse.wtf.nzyme.dot11.deauth.db.DeauthenticationMonitorRecordingMapper) JodaTimePlugin(org.jdbi.v3.jodatime2.JodaTimePlugin) BeaconRateMapper(horse.wtf.nzyme.dot11.networks.beaconrate.BeaconRateMapper) SignalIndexHistogramHistoryDBEntryMapper(horse.wtf.nzyme.dot11.networks.signalstrength.SignalIndexHistogramHistoryDBEntryMapper) JdbcConnection(liquibase.database.jvm.JdbcConnection) Contexts(liquibase.Contexts) PostgresPlugin(org.jdbi.v3.postgres.PostgresPlugin) Liquibase(liquibase.Liquibase) SentrySSIDMapper(horse.wtf.nzyme.dot11.networks.sentry.db.SentrySSIDMapper) horse.wtf.nzyme.bandits.database(horse.wtf.nzyme.bandits.database) MeasurementMapper(horse.wtf.nzyme.measurements.mappers.MeasurementMapper) EventRecordMapper(horse.wtf.nzyme.events.db.EventRecordMapper) LabelExpression(liquibase.LabelExpression) AlertDatabaseEntryMapper(horse.wtf.nzyme.alerts.service.AlertDatabaseEntryMapper) ScheduledReportEntryMapper(horse.wtf.nzyme.reporting.db.ScheduledReportEntryMapper) ClassLoaderResourceAccessor(liquibase.resource.ClassLoaderResourceAccessor)

Aggregations

AlertDatabaseEntryMapper (horse.wtf.nzyme.alerts.service.AlertDatabaseEntryMapper)1 horse.wtf.nzyme.bandits.database (horse.wtf.nzyme.bandits.database)1 DeauthenticationMonitorRecordingMapper (horse.wtf.nzyme.dot11.deauth.db.DeauthenticationMonitorRecordingMapper)1 BeaconRateMapper (horse.wtf.nzyme.dot11.networks.beaconrate.BeaconRateMapper)1 SentrySSIDMapper (horse.wtf.nzyme.dot11.networks.sentry.db.SentrySSIDMapper)1 SignalIndexHistogramHistoryDBEntryMapper (horse.wtf.nzyme.dot11.networks.signalstrength.SignalIndexHistogramHistoryDBEntryMapper)1 EventRecordMapper (horse.wtf.nzyme.events.db.EventRecordMapper)1 MeasurementMapper (horse.wtf.nzyme.measurements.mappers.MeasurementMapper)1 ExecutionLogEntryMapper (horse.wtf.nzyme.reporting.db.ExecutionLogEntryMapper)1 ScheduledReportEntryMapper (horse.wtf.nzyme.reporting.db.ScheduledReportEntryMapper)1 Contexts (liquibase.Contexts)1 LabelExpression (liquibase.LabelExpression)1 Liquibase (liquibase.Liquibase)1 JdbcConnection (liquibase.database.jvm.JdbcConnection)1 ClassLoaderResourceAccessor (liquibase.resource.ClassLoaderResourceAccessor)1 JodaTimePlugin (org.jdbi.v3.jodatime2.JodaTimePlugin)1 PostgresPlugin (org.jdbi.v3.postgres.PostgresPlugin)1