org.springframework.cloud.dataflow.server.db.migration

## Class AbstractMigrateUriRegistrySqlCommand

- java.lang.Object
- - org.springframework.cloud.dataflow.common.flyway.SqlCommand
  - - org.springframework.cloud.dataflow.server.db.migration.AbstractMigrateUriRegistrySqlCommand

- Direct Known Subclasses:
    Db2MigrateUriRegistrySqlCommand, MsSqlMigrateUriRegistrySqlCommand, MysqlMigrateUriRegistrySqlCommand, OracleMigrateUriRegistrySqlCommand, PostgresMigrateUriRegistrySqlCommand

      public abstract class AbstractMigrateUriRegistrySqlCommand
      extends org.springframework.cloud.dataflow.common.flyway.SqlCommand

  Base implementation for a `SqlCommand` copying data from `URI_REGISTRY` table into `app_registration` table.
  Author:
    Janne Valkealahti

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `AbstractMigrateUriRegistrySqlCommand.AppRegistrationMigrationData` Raw migration data from uri registry into app registration.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractMigrateUriRegistrySqlCommand()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canHandleInJdbcTemplate()`
    `protected List<AbstractMigrateUriRegistrySqlCommand.AppRegistrationMigrationData>` | `createAppRegistrationMigrationData(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)` Creates a migration data from URI_REGISTRY table to get inserted into app_registration table.
    `protected void` | `dropUriRegistryTable(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)` Drop uri registry table.
    `void` | `handle(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, Connection connection)`
    `protected abstract void` | `updateAppRegistration(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, List<AbstractMigrateUriRegistrySqlCommand.AppRegistrationMigrationData> data)` Update app registration.

    - ### Methods inherited from class org.springframework.cloud.dataflow.common.flyway.SqlCommand

      `from, from, getCommand, getSuppressedErrorCodes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractMigrateUriRegistrySqlCommand

          public AbstractMigrateUriRegistrySqlCommand()

  - ### Method Detail

    - #### handle

          public void handle(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                             Connection connection)

      Overrides:
        `handle` in class `org.springframework.cloud.dataflow.common.flyway.SqlCommand`

    - #### canHandleInJdbcTemplate

          public boolean canHandleInJdbcTemplate()

      Overrides:
        `canHandleInJdbcTemplate` in class `org.springframework.cloud.dataflow.common.flyway.SqlCommand`

    - #### updateAppRegistration

          protected abstract void updateAppRegistration(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                                                        List<AbstractMigrateUriRegistrySqlCommand.AppRegistrationMigrationData> data)

      Update app registration. Actual database implementation of this method is required to insert data based on list of `AppRegistrationMigrationData`'s and keep `hibernate_sequence` up-to-date.
      Parameters:
        `jdbcTemplate` - the jdbc template
        `data` - the data

    - #### createAppRegistrationMigrationData

          protected List<AbstractMigrateUriRegistrySqlCommand.AppRegistrationMigrationData> createAppRegistrationMigrationData(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)

      Creates a migration data from URI_REGISTRY table to get inserted into app_registration table. We're working on a raw data level thus no use hibernate, spring repositories nor entity classes.
      Parameters:
        `jdbcTemplate` - the jdbc template
      Returns:
        the list

    - #### dropUriRegistryTable

          protected void dropUriRegistryTable(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)

      Drop uri registry table.
      Parameters:
        `jdbcTemplate` - the jdbc template

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.